mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Finished checking for new books
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
raelon@golumnsec.33289:1571093667
|
|
||||||
1
lib/.#library.py
Symbolic link
1
lib/.#library.py
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
raelon@golumnsec.6371:1572529288
|
||||||
@@ -7,9 +7,9 @@ import zipfile
|
|||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
from api_hooks import DuckDuckGo
|
|
||||||
from config import Config
|
from config import Config
|
||||||
from storage import Storage
|
from lib.api_hooks import DuckDuckGo
|
||||||
|
from lib.storage import Storage
|
||||||
|
|
||||||
config = Config()
|
config = Config()
|
||||||
|
|
||||||
@@ -17,6 +17,7 @@ config = Config()
|
|||||||
class Catalogue:
|
class Catalogue:
|
||||||
"""Decodes and stores book information"""
|
"""Decodes and stores book information"""
|
||||||
"""Step One: filter_books"""
|
"""Step One: filter_books"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.file_list = []
|
self.file_list = []
|
||||||
self.opf_regx = re.compile(r'\.opf')
|
self.opf_regx = re.compile(r'\.opf')
|
||||||
@@ -143,6 +144,8 @@ class Catalogue:
|
|||||||
extracted = self.extract_metadata(book)
|
extracted = self.extract_metadata(book)
|
||||||
db.insert_book(extracted)
|
db.insert_book(extracted)
|
||||||
inserted = db.commit()
|
inserted = db.commit()
|
||||||
if inserted != True:
|
if inserted is not True:
|
||||||
print(inserted)
|
print(inserted)
|
||||||
db.close()
|
if input('Continue ? y/n') == 'y':
|
||||||
|
pass
|
||||||
|
db.close()
|
||||||
|
|||||||
10
main.py
10
main.py
@@ -1,16 +1,18 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import sys
|
import sys
|
||||||
sys.path.insert(1, 'lib/')
|
|
||||||
from pyShelf import InitFiles
|
|
||||||
from config import Config
|
from config import Config
|
||||||
from library import Catalogue
|
from lib.library import Catalogue
|
||||||
|
from lib.pyShelf import InitFiles
|
||||||
|
|
||||||
|
sys.path.insert(1, 'lib/')
|
||||||
|
|
||||||
config = Config() # Get configuration settings
|
config = Config() # Get configuration settings
|
||||||
InitFiles(config.file_array) # Initialize file system
|
InitFiles(config.file_array) # Initialize file system
|
||||||
Catalogue = Catalogue() # Open the Catalogue
|
Catalogue = Catalogue() # Open the Catalogue
|
||||||
|
|
||||||
# new_books = Catalogue.new_files()
|
# new_books = Catalogue.new_files()
|
||||||
Catalogue.import_books() # Filter Your books
|
Catalogue.import_books() # Filter Your books
|
||||||
# TODO Resolve database locking after querying for book list
|
|
||||||
# TODO Figure out a system to get books page count
|
# TODO Figure out a system to get books page count
|
||||||
# TODO Update Documentation
|
# TODO Update Documentation
|
||||||
# TODO Requirements.txt
|
# TODO Requirements.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user