2019-07-14 22:43:57 +00:00
|
|
|
import pathlib
|
2019-09-20 15:40:56 +00:00
|
|
|
from collections import namedtuple
|
2019-09-28 13:38:33 +00:00
|
|
|
import profig
|
2019-07-14 22:43:57 +00:00
|
|
|
import appdirs
|
2019-09-28 13:38:33 +00:00
|
|
|
import os
|
2019-07-14 22:43:57 +00:00
|
|
|
|
2019-09-28 13:38:33 +00:00
|
|
|
config_dir = pathlib.Path(appdirs.user_config_dir("ED_LRR", ""))
|
2019-07-14 22:43:57 +00:00
|
|
|
config_dir.mkdir(parents=True, exist_ok=True)
|
2019-09-28 13:38:33 +00:00
|
|
|
config_file = config_dir / "config.ini"
|
2019-07-14 22:43:57 +00:00
|
|
|
config_file.touch()
|
|
|
|
|
2019-09-28 13:38:33 +00:00
|
|
|
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_path",
|
|
|
|
[],
|
|
|
|
"path_list",
|
|
|
|
comment="history of bodies.json download paths",
|
|
|
|
)
|
|
|
|
cfg.init(
|
|
|
|
"history.systems_path",
|
|
|
|
[],
|
|
|
|
"path_list",
|
|
|
|
comment="history of systems.json download paths",
|
|
|
|
)
|
|
|
|
cfg.init(
|
2019-09-28 19:23:19 +00:00
|
|
|
"history.stars_csv_path", [], "path_list", comment="history of paths for stars.csv"
|
2019-09-28 13:38:33 +00:00
|
|
|
)
|
|
|
|
cfg.init("route.range", 7.56, comment="jump range")
|
|
|
|
cfg.init("route.primary", False, comment="only route through primary stars")
|
|
|
|
cfg.init("route.mode", "bfs", comment="routing mode")
|
|
|
|
cfg.init(
|
|
|
|
"route.prune.min_improvement",
|
|
|
|
10.0,
|
|
|
|
comment="path needs to improve by at least (jump_range*min_improvement) in route.prune.steps",
|
|
|
|
)
|
|
|
|
cfg.init("route.prune.steps", 5, comment="number of steps before path gets pruned")
|
|
|
|
cfg.init("route.greediness", 0.5, comment="A* greediness")
|
|
|
|
cfg.init("folders.data_dir", os.path.join(config_dir, "data"), comment="Data directory")
|
|
|
|
|
|
|
|
cfg.sync()
|