remove Path.str() calls

This commit is contained in:
Izalia Mae 2021-06-07 20:51:00 -04:00
parent b728df4bc0
commit 95cc5c7103
3 changed files with 6 additions and 4 deletions

View file

@ -36,7 +36,7 @@ class Path(str):
def append(self, text): def append(self, text):
return Path(str(self.__path) + text) return Path(self + text)
def backup(self, ext='backup', overwrite=False): def backup(self, ext='backup', overwrite=False):

View file

@ -46,10 +46,12 @@ class SqlDatabase:
engine_string = dbtype + '://' engine_string = dbtype + '://'
if dbtype == 'sqlite': if dbtype == 'sqlite':
if nfs_check(kwargs.get('database')): database = kwargs.get('database')
if nfs_check(database):
izzylog.error('Database file is on an NFS share which does not support locking. Any writes to the database will fail') izzylog.error('Database file is on an NFS share which does not support locking. Any writes to the database will fail')
engine_string += '/' + str(kwargs.get('database')) engine_string += f'/{database}'
engine_kwargs['connect_args'] = {'check_same_thread': False} engine_kwargs['connect_args'] = {'check_same_thread': False}
else: else:

View file

@ -176,7 +176,7 @@ class SqliteServer(misc.DotDict):
self.setup_metadata() self.setup_metadata()
for path in self.path.listdir(False): for path in self.path.listdir(False):
if path.str().endswith('.sqlite3') and path.stem != 'metadata': if path.endswith('.sqlite3') and path.stem != 'metadata':
self.open(path.stem) self.open(path.stem)