mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Implemented the return of unique files for storage
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import sqlite3
|
||||
sys.path.insert(1,'../')
|
||||
# sys.path.insert(1, '../')
|
||||
from config import Config
|
||||
db_pointer = Config().catalogue_db
|
||||
|
||||
@@ -55,6 +55,13 @@ class Storage:
|
||||
print(e)
|
||||
return False
|
||||
|
||||
def book_paths_list(self):
|
||||
q = '''SELECT file_name FROM books'''
|
||||
x = self.cursor.execute(q)
|
||||
try: x = x.fetchall()
|
||||
except Exception: x = []
|
||||
return x
|
||||
|
||||
def commit(self):
|
||||
try: self.db.commit(); return True
|
||||
except Exception as e: return False
|
||||
except Exception as e: return False
|
||||
|
||||
Reference in New Issue
Block a user