|
|
@@ -4,15 +4,6 @@ import json
|
|
|
from os.path import join
|
|
|
|
|
|
|
|
|
-try:
|
|
|
- with open('conf.json') as f:
|
|
|
- data = json.load(f)
|
|
|
- smtp = data.get('smtp')
|
|
|
- wechat = data.get('wechat')
|
|
|
-except:
|
|
|
- smtp = None
|
|
|
- wechat = None
|
|
|
-
|
|
|
class path:
|
|
|
base = os.path.dirname(sys.argv[0])
|
|
|
geckodriver = join(base, 'driver/geckodriver')
|
|
|
@@ -20,11 +11,21 @@ class path:
|
|
|
log = join(base, 'log/punch.log')
|
|
|
geckodriver_log = join(base, 'log/geckodriver.log')
|
|
|
chromedriver_log = join(base, 'log/chromedriver.log')
|
|
|
- conf = join(base, 'conf/conf.json')
|
|
|
- users = join(base, 'conf/users.json')
|
|
|
+ conf = join(base, 'conf.json')
|
|
|
|
|
|
class text:
|
|
|
subject = '疫情防控通自动打卡结果'
|
|
|
failed = '自动打卡失败!'
|
|
|
ok = '自动打卡成功'
|
|
|
- already = '已打卡过'
|
|
|
+ already = '已打卡过'
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+try:
|
|
|
+ with open(path.conf) as f:
|
|
|
+ data = json.load(f)
|
|
|
+ smtp = data.get('smtp')
|
|
|
+ wechat = data.get('wechat')
|
|
|
+except:
|
|
|
+ smtp = None
|
|
|
+ wechat = None
|