From e40cd86d810518b13b511fee568a02539ed6b46c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 1 Jun 2016 18:11:53 +0300 Subject: [PATCH] Change database pathname handling Recognize pathnames by absence of '://'. --- m_librarian/db.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/m_librarian/db.py b/m_librarian/db.py index 56b194d..8786a46 100755 --- a/m_librarian/db.py +++ b/m_librarian/db.py @@ -142,12 +142,7 @@ def open_db(db_uri=None): except: db_uri = find_sqlite_dburi() - if db_uri.startswith(os.sep) \ - or os.altsep and db_uri.startswith(os.altsep) \ - or db_uri.startswith(os.pardir + os.sep) \ - or os.altsep and db_uri.startswith(os.pardir + os.altsep) \ - or db_uri.startswith(os.curdir + os.sep) \ - or os.altsep and db_uri.startswith(os.curdir + os.altsep): + if '://' not in db_uri: db_uri = 'sqlite://' + os.path.abspath(db_uri).replace(os.sep, '/') sqlhub.processConnection = connection = connectionForURI(db_uri) -- 2.39.2