Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
2018/5/29 =》增加获取操作系统平台方法,增加网络连通性检测(后续考虑重构)
2018/6/3 =》网络连通性代码重构
2018/6/10 =》增加配置文件读取方法(可能有IO性能影响,考虑重构)
2022/2/09 => 修复 config.json 相对路径问题,便于crontab使用. by DeeDive
'''
import os
import IpGetter
import platform
import subprocess
Expand Down Expand Up @@ -69,6 +71,6 @@ def isOnline():

#从config.json中获取配置信息JSON串
def getConfigJson():
with open('config.json') as file:
with open(os.path.join(os.path.dirname(__file__),'config.json')) as file:
jsonStr = json.loads(file.read())
return jsonStr