root 6 months ago
commit
082f383fc3
6 changed files with 3073 additions and 0 deletions
  1. 3
    0
      __init__.py
  2. BIN
      __pycache__/__init__.cpython-37.pyc
  3. BIN
      __pycache__/xls2table.cpython-37.pyc
  4. 25
    0
      supervisor.py
  5. 1645
    0
      xls2table.py
  6. 1400
    0
      xls2table_bak.py

+ 3
- 0
__init__.py View File

@@ -0,0 +1,3 @@
1
+from .xls2table import *
2
+
3
+

BIN
__pycache__/__init__.cpython-37.pyc View File


BIN
__pycache__/xls2table.cpython-37.pyc View File


+ 25
- 0
supervisor.py View File

@@ -0,0 +1,25 @@
1
+import time
2
+import logging
3
+from xls2table import run_htp
4
+from apscheduler.schedulers.blocking import BlockingScheduler
5
+
6
+
7
+def attendance_job():
8
+    print('Apscheduler Runtime: '+time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
9
+    FMT = '%(asctime)s %(filename)s %(funcName)s %(levelname)s %(message)s'
10
+    logging.basicConfig(format=FMT, level=logging.INFO)
11
+    run_htp(url='http://192.168.80.3:8069', dbname='htp', dburl='postgresql://odoo:odootyughj@192.168.80.3:5432/htp')
12
+
13
+ 
14
+#sched = BlockingScheduler()
15
+sched = BlockingScheduler(daemon=True)
16
+
17
+#sched.add_job(attendance_job, 'interval', seconds=5)
18
+#sched.add_job(attendance_job, 'cron', hour=23, minute=30, timezone='Asia/Taipei')
19
+sched.add_job(attendance_job, 'cron', hour=8, minute=35, timezone='Asia/Taipei')
20
+#sched.add_job(attendance_job, 'cron', hour=18, minute=10, timezone='Asia/Taipei')
21
+
22
+try:
23
+  sched.start()
24
+except (KeyboardInterrupt, SystemExit):
25
+  sched.shutdown()

+ 1645
- 0
xls2table.py
File diff suppressed because it is too large
View File


+ 1400
- 0
xls2table_bak.py
File diff suppressed because it is too large
View File


Loading…
Cancel
Save