mirror of https://gitlab.com/pamhyr/pamhyr2
Config: Fix config dir creation for GNU/Linux.
parent
3ed1053619
commit
539dee31c9
|
|
@ -242,9 +242,11 @@ class Config(SQL):
|
|||
file = ""
|
||||
|
||||
if os.name == 'posix':
|
||||
file = os.path.expanduser('~') + config_dir + config_file
|
||||
ndir = os.path.expanduser('~') + config_dir
|
||||
else:
|
||||
ndir = os.path.expanduser('~') + config_dir.replace("/", "\\")
|
||||
ndir = os.path.expanduser('~') + config_dir
|
||||
ndir = ndir.replace("/", "\\")
|
||||
|
||||
os.makedirs(ndir, exist_ok = True)
|
||||
file = ndir + config_file
|
||||
|
||||
|
|
|
|||
|
|
@ -184,6 +184,11 @@ class SQL(object):
|
|||
def _init_db_file(self, db):
|
||||
exists = Path(db).exists()
|
||||
|
||||
os.makedirs(
|
||||
os.path.dirname(db),
|
||||
exist_ok = True
|
||||
)
|
||||
|
||||
self._db = sqlite3.connect(db)
|
||||
self._cur = self._db.cursor()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue