Updated configs

This commit is contained in:
Dimitris Zlatanidis 2022-06-19 22:18:54 +03:00
parent d86716183c
commit cf0a0f1e5f
2 changed files with 38 additions and 30 deletions

View file

@ -2,7 +2,9 @@
# -*- coding: utf-8 -*-
import os
import json
from dataclasses import dataclass
@ -47,7 +49,10 @@ class Configs:
wget_options = '-c -N'
''' Overwrite with user configuration. '''
with open(f'{etc_path}/{prog_name}.json', 'r') as conf:
config_file: str = f'{etc_path}/{prog_name}.json'
if os.path.isfile(config_file):
with open(config_file, 'r') as conf:
config = json.load(conf)
# OS architecture by default
@ -90,6 +95,7 @@ class Configs:
'GREEN': '',
'YELLOW': '',
'CYAN': '',
'BLUE': '',
'GREY': '',
'ENDC': ''
}

View file

@ -4,10 +4,12 @@
from dataclasses import dataclass
from slpkg.configs import Configs
@dataclass
class Version:
prog_name: str = 'slpkg'
prog_name: str = Configs.prog_name
version_info: tuple = (4, 1, 0)
version: str = '{0}.{1}.{2}'.format(*version_info)
license: str = 'MIT License'