From 30dbd24bf423aebe4a0f683798bdc2ba7268294b Mon Sep 17 00:00:00 2001 From: Daniel Seiller Date: Wed, 23 Oct 2019 11:28:32 +0200 Subject: [PATCH] fix(config): Add missing defaults --- ed_lrr_gui/__main__.py | 2 +- ed_lrr_gui/config.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ed_lrr_gui/__main__.py b/ed_lrr_gui/__main__.py index 15da2e3..3512700 100644 --- a/ed_lrr_gui/__main__.py +++ b/ed_lrr_gui/__main__.py @@ -16,7 +16,7 @@ from _ed_lrr import find_sys CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) stars_path = os.path.join(cfg["folders.data_dir"], "stars.csv") -for folder in cfg["history.out_path"]: +for folder in cfg["history.stars_csv_path"]: file = os.path.join(folder, "stars.csv") if os.path.isfile(file): stars_path = file diff --git a/ed_lrr_gui/config.py b/ed_lrr_gui/config.py index a67992a..605d3e6 100644 --- a/ed_lrr_gui/config.py +++ b/ed_lrr_gui/config.py @@ -11,22 +11,22 @@ config_file.touch() cfg = profig.Config(str(config_file), strict=True) -cfg.init("history.bodies_url", [], "path_list", comment="history of bodies.json urls") -cfg.init("history.systems_url", [], "path_list", comment="history of systems.json urls") +cfg.init("history.bodies_url", ["https://www.edsm.net/dump/bodies.json"], "path_list", comment="history of bodies.json urls") +cfg.init("history.systems_url", ["https://www.edsm.net/dump/systemsWithCoordinates.json"], "path_list", comment="history of systems.json urls") cfg.init( "history.bodies_path", - [], + [os.path.join(config_dir, "data","bodies.json")], "path_list", comment="history of bodies.json download paths", ) cfg.init( "history.systems_path", - [], + [os.path.join(config_dir, "data","systemsWithCoordinates.json")], "path_list", comment="history of systems.json download paths", ) cfg.init( - "history.stars_csv_path", [], "path_list", comment="history of paths for stars.csv" + "history.stars_csv_path", [os.path.join(config_dir, "data","stars.csv")], "path_list", comment="history of paths for stars.csv" ) cfg.init("route.range", 7.56, comment="jump range") cfg.init("route.primary", False, comment="only route through primary stars") @@ -40,4 +40,7 @@ cfg.init("route.prune.steps", 5, comment="number of steps before path gets prune cfg.init("route.greediness", 0.5, comment="A* greediness") cfg.init("folders.data_dir", os.path.join(config_dir, "data"), comment="Data directory") +cfg.init("GUI.theme", 'dark', comment="GUI theme to use") + + cfg.sync()