This commit is contained in:
Vinícius Moreira
2020-04-13 11:49:28 -03:00
parent 83aab1ff55
commit 01a60ea686
165 changed files with 12778 additions and 6171 deletions

View File

@@ -1,6 +1,3 @@
import logging
import os
import traceback
from pathlib import Path
import yaml
@@ -21,17 +18,12 @@ def read_config(update_file: bool = False) -> dict:
},
'locale': None,
'updates': {
'check_interval': 30,
'sort_packages': True,
"pre_dependency_checking": True
'check_interval': 30
},
'system': {
'notifications': True,
'single_dependency_checking': False
},
'disk_cache': {
'enabled': True
},
'suggestions': {
'enabled': True,
'by_type': 10
@@ -52,7 +44,20 @@ def read_config(update_file: bool = False) -> dict:
'download': {
'multithreaded': True,
'icons': True
},
'store_root_password': True,
'disk': {
'trim_after_update': False
},
'backup': {
'enabled': True,
'install': None,
'uninstall': None,
'downgrade': None,
'upgrade': None,
'mode': 'incremental'
}
}
return read(FILE_PATH, default, update_file=update_file, update_async=True)
@@ -62,14 +67,3 @@ def save(config: dict):
with open(FILE_PATH, 'w+') as f:
f.write(yaml.safe_dump(config))
def remove_old_config(logger: logging.Logger):
old_file = FILE_PATH.replace('.yml', '.json')
if os.path.exists(old_file):
try:
os.remove(old_file)
logger.info('Old configuration file {} deleted'.format(old_file))
except:
logger.error('Could not delete the old configuration file {}'.format(old_file))
traceback.print_exc()