|
@@ -1,3 +1,4 @@
|
|
|
|
|
+import json
|
|
|
import os
|
|
import os
|
|
|
import sys
|
|
import sys
|
|
|
|
|
|
|
@@ -9,9 +10,21 @@ CONFIG = {'oss': {
|
|
|
'access_key': 'miniominio',
|
|
'access_key': 'miniominio',
|
|
|
'secret_key': 'miniominio'
|
|
'secret_key': 'miniominio'
|
|
|
}}
|
|
}}
|
|
|
-SERVER_POINT = 'http://221.226.175.250:7215/'
|
|
|
|
|
-
|
|
|
|
|
-TARGET_URL = 'http://221.226.175.250:7215'
|
|
|
|
|
|
|
+dl_code = os.path.realpath(sys.argv[0])[:1]
|
|
|
|
|
+
|
|
|
|
|
+if not os.path.exists(f'{dl_code}:\\ProgramData\\OfficeAssistant\\config.json'):
|
|
|
|
|
+ sys.exit(0)
|
|
|
|
|
+
|
|
|
|
|
+with open(f'{dl_code}:\\ProgramData\\OfficeAssistant\\config.json', 'r', encoding='utf-8') as f:
|
|
|
|
|
+ # with open(f'config.json', 'r', encoding='utf-8') as f:
|
|
|
|
|
+ args = json.load(f)
|
|
|
|
|
+args['worker_path'] = args['worker_path'].replace('\\\\', '\\')
|
|
|
|
|
+if args.get('server_url'):
|
|
|
|
|
+ SERVER_POINT = args.get('server_url')
|
|
|
|
|
+ TARGET_URL = args.get('server_url')
|
|
|
|
|
+else:
|
|
|
|
|
+ SERVER_POINT = 'http://221.226.41.58/:7215/'
|
|
|
|
|
+ TARGET_URL = 'http://221.226.41.58/:7215'
|
|
|
|
|
|
|
|
def get_config(config_name):
|
|
def get_config(config_name):
|
|
|
return CONFIG.get(config_name)
|
|
return CONFIG.get(config_name)
|