forked from LiveCarta/LiveCartaMeta
run with all params
This commit is contained in:
@@ -9,14 +9,14 @@ from configs.configs import CONFIGS
|
|||||||
|
|
||||||
class AppConfig:
|
class AppConfig:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.refresh()
|
self.refresh()
|
||||||
connect(
|
connect(
|
||||||
db=CONFIGS['db']['name'],
|
db=CONFIGS['db']['name'],
|
||||||
host="mongodb://{host}:27017/{database}".format(host=CONFIGS['db']['host'], database=CONFIGS['db']['name'])
|
host="mongodb://{host}:27017/{database}".format(host=CONFIGS['db']['host'], database=CONFIGS['db']['name'])
|
||||||
)
|
)
|
||||||
|
|
||||||
def refresh(self):
|
def refresh(self):
|
||||||
self.config = Dynaconf(settings_files=[
|
self.config = Dynaconf(settings_files=[
|
||||||
"/app/configs/main.json",
|
"/app/configs/main.json",
|
||||||
"/app/configs/sources.json"
|
"/app/configs/sources.json"
|
||||||
])
|
])
|
||||||
@@ -52,6 +52,6 @@ class AppConfig:
|
|||||||
with open("./configs/sources.json", "w") as outfile:
|
with open("./configs/sources.json", "w") as outfile:
|
||||||
outfile.write(json.dumps(new_config))
|
outfile.write(json.dumps(new_config))
|
||||||
|
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
||||||
config = AppConfig()
|
config = AppConfig()
|
||||||
@@ -34,11 +34,10 @@ class Updater:
|
|||||||
config.update_sources()
|
config.update_sources()
|
||||||
|
|
||||||
def do_action(self):
|
def do_action(self):
|
||||||
print("Start Updater");
|
print("Start Updater");
|
||||||
if self.args.config:
|
if self.args.config:
|
||||||
print("Start Configure")
|
print("Start Configure")
|
||||||
self.update_config()
|
self.update_config()
|
||||||
return
|
|
||||||
|
|
||||||
if not self.is_source_exists(self.args.source):
|
if not self.is_source_exists(self.args.source):
|
||||||
print("This source not exists, list of sources: " + ', '.join(config.get_sources_list()))
|
print("This source not exists, list of sources: " + ', '.join(config.get_sources_list()))
|
||||||
|
|||||||
Reference in New Issue
Block a user