refactored cli
This commit is contained in:
@@ -4,7 +4,20 @@ from .connection import CONNECTION_SECTION
|
||||
from .misc import MISC_SECTION
|
||||
from .paths import PATHS_SECTION
|
||||
|
||||
from .config import read, write, config
|
||||
from .paths import LOCATIONS
|
||||
from .config import Config
|
||||
|
||||
|
||||
read()
|
||||
config = Config()
|
||||
|
||||
|
||||
def read_config():
|
||||
if not LOCATIONS.CONFIG_FILE.is_file():
|
||||
write_config()
|
||||
config.read_from_config_file(LOCATIONS.CONFIG_FILE)
|
||||
|
||||
|
||||
def write_config():
|
||||
config.write_to_config_file(LOCATIONS.CONFIG_FILE)
|
||||
|
||||
set_name_to_value = config.set_name_to_value
|
||||
|
@@ -125,16 +125,3 @@ class Config:
|
||||
for section in self._section_list:
|
||||
for name, attribute in section.name_attribute_map.items():
|
||||
yield attribute
|
||||
|
||||
|
||||
config = Config()
|
||||
|
||||
|
||||
def read():
|
||||
if not LOCATIONS.CONFIG_FILE.is_file():
|
||||
write()
|
||||
config.read_from_config_file(LOCATIONS.CONFIG_FILE)
|
||||
|
||||
|
||||
def write():
|
||||
config.write_to_config_file(LOCATIONS.CONFIG_FILE)
|
||||
|
Reference in New Issue
Block a user