core: replaced sat shell script by a python script:
the backend is now launched by `sat.core.launcher`, and the script is generated during installation with a new entry point in `setup.py`.
This commit is contained in:
parent
c0a3f8d141
commit
a1eb68c1e7
1 changed files with 240 additions and 149 deletions
|
|
@ -34,8 +34,10 @@ log = getLogger(__name__)
|
|||
|
||||
|
||||
def fixConfigOption(section, option, value, silent=True):
|
||||
"""Force a configuration option value, writing it in the first found user
|
||||
config file, eventually creating a new user config file if none is found.
|
||||
"""Force a configuration option value
|
||||
|
||||
the option will be written in the first found user config file, a new user
|
||||
config will be created if none is found.
|
||||
|
||||
@param section (str): the config section
|
||||
@param option (str): the config option
|
||||
|
|
@ -70,35 +72,6 @@ def fixConfigOption(section, option, value, silent=True):
|
|||
config_file=target_file))
|
||||
|
||||
|
||||
# XXX: tmp update code, will be removed in the future
|
||||
# When you remove this, please add the default value for
|
||||
# 'local_dir' in sat.core.constants.Const.DEFAULT_CONFIG
|
||||
def fixLocalDir(silent=True):
|
||||
"""Retro-compatibility with the previous local_dir default value.
|
||||
|
||||
@param silent (boolean): toggle logging output (must be True when called from sat.sh)
|
||||
"""
|
||||
user_config = ConfigParser()
|
||||
try:
|
||||
user_config.read(C.CONFIG_FILES)
|
||||
except:
|
||||
pass # file is readable but its structure if wrong
|
||||
try:
|
||||
current_value = user_config.get("DEFAULT", "local_dir")
|
||||
except (NoOptionError, NoSectionError):
|
||||
current_value = ""
|
||||
if current_value:
|
||||
return # nothing to do
|
||||
old_default = "~/.sat"
|
||||
if os.path.isfile(os.path.expanduser(old_default) + "/" + C.SAVEFILE_DATABASE):
|
||||
if not silent:
|
||||
log.warning(_(
|
||||
"A database has been found in the default local_dir for previous "
|
||||
"versions (< 0.5)"
|
||||
))
|
||||
fixConfigOption("", "local_dir", old_default, silent)
|
||||
|
||||
|
||||
def parseMainConf(log_filenames=False):
|
||||
"""Look for main .ini configuration file, and parse it
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue