From bb514bd5784110d2435ab8f5b561450fd83925a5 Mon Sep 17 00:00:00 2001 From: Artem30801 Date: Tue, 20 Oct 2020 01:13:07 +0300 Subject: [PATCH] builder-lools: moved update_configspec --- .../builder-tools}/update_configspec.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) rename {tools => builder/builder-tools}/update_configspec.py (68%) diff --git a/tools/update_configspec.py b/builder/builder-tools/update_configspec.py similarity index 68% rename from tools/update_configspec.py rename to builder/builder-tools/update_configspec.py index db40009..22b212f 100644 --- a/tools/update_configspec.py +++ b/builder/builder-tools/update_configspec.py @@ -1,12 +1,16 @@ import os +import sys import shutil -import config -from server.copter_table_models import CopterDataModel -from config import ConfigManager, ConfigObj +current_dir = os.path.dirname(os.path.realpath(__file__)) +sys.path.insert(0, os.path.realpath(os.path.join(current_dir, os.pardir, os.pardir))) + +from lib.config import ConfigManager, ConfigObj +from server.modules.copter_table_models import CopterDataModel + config_path = 'temp_config/config' -spec_path = os.path.join(config_path,'spec') +spec_path = os.path.join(config_path, 'spec') if not os.path.exists(spec_path): try: os.makedirs(spec_path) @@ -18,7 +22,7 @@ if not os.path.exists(spec_path): shutil.copy("Server/config/spec/configspec_server.ini", spec_path) config = ConfigManager() -config.load_config_and_spec(os.path.join(config_path,'server.ini')) +config.load_config_and_spec(os.path.join(config_path,' server.ini')) preset_params = config.table_presets_default default_param = (True, 100)