diff --git a/__pycache__/config.cpython-37.pyc b/__pycache__/config.cpython-37.pyc index c7d7e72..e408d83 100644 Binary files a/__pycache__/config.cpython-37.pyc and b/__pycache__/config.cpython-37.pyc differ diff --git a/config.py b/config.py index 11f517b..01ae613 100755 --- a/config.py +++ b/config.py @@ -1,7 +1,7 @@ class Config: """Main System Configuration""" def __init__(self): - self.book_path = "/home/raelon/Books/" + self.book_path = "books/" self.book_shelf = "data/shelf.json" self.catalogue_db = "data/catalogue.db" self.file_array = [ diff --git a/data/shelf.json b/data/shelf.json index 4c4bc29..5efa207 100644 --- a/data/shelf.json +++ b/data/shelf.json @@ -1 +1 @@ -{"/home/raelon/Books/All Dune books + short stories + extras ePUB/Dune Chronicles (Dune 7)/Dune Chronicles 1 - Hunters of Dune.epub": {"files": ["OPS/xhtml/cover.html", "OPS/9780765312921.opf"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Dune Chronicles (Dune 7)/Dune Chronicles 1 - Hunters of Dune.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Dune Chronicles (Dune 7)/Dune Chronicles 2 - The Sandworms of Dune.epub": {"files": ["OPS/package.opf", "OPS/xhtml/cover.html"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Dune Chronicles (Dune 7)/Dune Chronicles 2 - The Sandworms of Dune.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 1 - Sisterhood of Dune.epub": {"files": ["OEBPS/content.opf", "OEBPS/Text/cover.xml"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 1 - Sisterhood of Dune.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 2 - Mentats of Dune.epub": {"files": ["OEBPS/content.opf", "OEBPS/Images/cover.jpeg"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 2 - Mentats of Dune.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 2.5 - Red Plague.epub": {"files": ["OEBPS/content.opf", "OEBPS/Text/cover.xhtml"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 2.5 - Red Plague.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 3 - Navigators of Dune.epub": {"files": ["OEBPS/content.opf", "OEBPS/Text/cover.xhtml"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 3 - Navigators of Dune.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Heroes of Dune/Heroes of Dune 1 - Paul of Dune.epub": {"files": ["OPS/package.opf", "OPS/xhtml/cover.xml"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Heroes of Dune/Heroes of Dune 1 - Paul of Dune.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Heroes of Dune/Heroes of Dune 2 - The Winds of Dune.epub": {"files": ["OPS/package.opf", "OPS/xhtml/cover.xml"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Heroes of Dune/Heroes of Dune 2 - The Winds of Dune.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/1 - Dune - Frank Herbert (1965).epub": {"files": ["OEBPS/package.opf", "OEBPS/cover.xml"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/1 - Dune - Frank Herbert (1965).epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/2 - Dune Messiah - Frank Herbert (1969).epub": {"files": ["OEBPS/9780575104426_oeb_opf_r1.opf", "OEBPS/9780575104426_oeb_cover_r1.html"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/2 - Dune Messiah - Frank Herbert (1969).epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/3 - Children of Dune - Frank Herbert (1976).epub": {"files": ["OEBPS/9780575104402_oeb_cover_r1.html", "OEBPS/9780575104402_oeb_opf_r1.opf"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/3 - Children of Dune - Frank Herbert (1976).epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/4 - God Emperor Of Dune - Frank Herbert (1981).epub": {"files": ["OEBPS/9780575104440_oeb_opf_r1.opf", "OEBPS/9780575104440_oeb_cover_r1.html"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/4 - God Emperor Of Dune - Frank Herbert (1981).epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/5 - Heretics of Dune - Frank Herbert (1984).epub": {"files": ["OEBPS/9780575104457_oeb_cover_r1.html", "OEBPS/9780575104457_oeb_opf_r1.opf"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/5 - Heretics of Dune - Frank Herbert (1984).epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/6 - Chapter House Dune - Frank Herbert (1985).epub": {"files": ["OEBPS/9780575104396_oeb_opf_r1.opf", "OEBPS/9780575104396_oeb_cover_r1.html"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Original Dune series/6 - Chapter House Dune - Frank Herbert (1985).epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 1 - House Atreides.epub": {"files": ["OEBPS/content.opf"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 1 - House Atreides.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 2 - House Harkonnen.epub": {"files": ["Herb_9780553897838_epub_opf_r1.opf"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 2 - House Harkonnen.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 3 - House Corrino.epub": {"files": ["OPS/content.opf"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 3 - House Corrino.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Short story collections and extras/CliffsNotes on Herbert's Dune & Other Works - L. David Allen.epub": {"files": ["OPS/images/cover.jpg", "OPS/content.opf"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Short story collections and extras/CliffsNotes on Herbert's Dune & Other Works - L. David Allen.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Short story collections and extras/Dreamer of Dune- The Biography of Frank Herbert by Brian Herbert.epub": {"files": ["OEBPS/content.opf", "OEBPS/Images/cover.jpg"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Short story collections and extras/Dreamer of Dune- The Biography of Frank Herbert by Brian Herbert.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Short story collections and extras/Eye (Short stories) - Frank Herbert.epub": {"files": ["OEBPS/content.opf", "OEBPS/Text/cover.xhtml"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Short story collections and extras/Eye (Short stories) - Frank Herbert.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Short story collections and extras/Tales of Dune (Short stories) - Brian Herbert and Kevin J. Anderson.epub": {"files": ["OEBPS/content.opf"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Short story collections and extras/Tales of Dune (Short stories) - Brian Herbert and Kevin J. Anderson.epub"}, "/home/raelon/Books/All Dune books + short stories + extras ePUB/Short story collections and extras/The Road to Dune (Companion book) - Frank Herbert et al.epub": {"files": ["OEBPS/e9781429924917_cover.jpg", "OEBPS/e9781429924917_content.opf"], "path": "/home/raelon/Books/All Dune books + short stories + extras ePUB/Short story collections and extras/The Road to Dune (Companion book) - Frank Herbert et al.epub"}, "/home/raelon/Books/Clancy/Clancy, Tom/Against All Enemies/Against All Enemies - Tom Clancy.epub": {"files": ["content.opf", "cover.jpeg"], "path": "/home/raelon/Books/Clancy/Clancy, Tom/Against All Enemies/Against All Enemies - Tom Clancy.epub"}, "/home/raelon/Books/Clancy/Clancy, Tom/Archimedes Effect, The/Archimedes Effect, The - Tom Clancy.epub": {"files": ["content.opf", "cover.jpeg"], "path": "/home/raelon/Books/Clancy/Clancy, Tom/Archimedes Effect, The/Archimedes Effect, The - Tom Clancy.epub"}, "/home/raelon/Books/Clancy/Clancy, Tom/Cardinal of the Kremlin, The/Cardinal of the Kremlin, The - Tom Clancy.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Clancy/Clancy, Tom/Cardinal of the Kremlin, The/Cardinal of the Kremlin, The - Tom Clancy.epub"}, "/home/raelon/Books/Clancy/Clancy, Tom/Dead or Alive/Dead or Alive - Tom Clancy.epub": {"files": ["content.opf", "cover.jpeg"], "path": "/home/raelon/Books/Clancy/Clancy, Tom/Dead or Alive/Dead or Alive - Tom Clancy.epub"}, "/home/raelon/Books/Clancy/Clancy, Tom/Debt of Honor/Debt of Honor - Tom Clancy.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Clancy/Clancy, Tom/Debt of Honor/Debt of Honor - Tom Clancy.epub"}, "/home/raelon/Books/Clancy/Clancy, Tom/Rainbow Six/Rainbow Six - Tom Clancy.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Clancy/Clancy, Tom/Rainbow Six/Rainbow Six - Tom Clancy.epub"}, "/home/raelon/Books/Clancy/Clancy, Tom/Red Storm Rising/Red Storm Rising - Tom Clancy.epub": {"files": ["content.opf", "cover.jpeg"], "path": "/home/raelon/Books/Clancy/Clancy, Tom/Red Storm Rising/Red Storm Rising - Tom Clancy.epub"}, "/home/raelon/Books/Clancy/Clancy, Tom/Springboard/Springboard - Tom Clancy.epub": {"files": ["content.opf", "cover.jpeg"], "path": "/home/raelon/Books/Clancy/Clancy, Tom/Springboard/Springboard - Tom Clancy.epub"}, "/home/raelon/Books/Clancy/Clancy, Tom/State of War/State of War - Tom Clancy.epub": {"files": ["content.opf", "cover.jpeg"], "path": "/home/raelon/Books/Clancy/Clancy, Tom/State of War/State of War - Tom Clancy.epub"}, "/home/raelon/Books/Coding The Bible 2 Manuscripts - Python and Raspberry PI/Coding The Bible 2 Manuscripts - Python and Raspberry PI.epub": {"files": ["OEBPS/content.opf"], "path": "/home/raelon/Books/Coding The Bible 2 Manuscripts - Python and Raspberry PI/Coding The Bible 2 Manuscripts - Python and Raspberry PI.epub"}, "/home/raelon/Books/Automate the Boring Stuff with Python - Practical Programming for Total Beginners - 1st Edition (2015) (Pdf, Epub & Mobi) Gooner/Automate the Boring Stuff with Python (2015).epub": {"files": ["OEBPS/content.opf", "OEBPS/Images/cover00710.jpeg", "OEBPS/Text/cover_page.xhtml"], "path": "/home/raelon/Books/Automate the Boring Stuff with Python - Practical Programming for Total Beginners - 1st Edition (2015) (Pdf, Epub & Mobi) Gooner/Automate the Boring Stuff with Python (2015).epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Commodore, The - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Commodore, The - C. S. Forester.epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Flying Colours - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Flying Colours - C. S. Forester.epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Happy Return, The - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Happy Return, The - C. S. Forester.epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Hornblower and the Atropos - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Hornblower and the Atropos - C. S. Forester.epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Hornblower and the Crisis - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Hornblower and the Crisis - C. S. Forester.epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Hornblower and the Hotspur - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Hornblower and the Hotspur - C. S. Forester.epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Hornblower in the West Indies - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Hornblower in the West Indies - C. S. Forester.epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Lieutenant Hornblower - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Lieutenant Hornblower - C. S. Forester.epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Lord Hornblower - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Lord Hornblower - C. S. Forester.epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Ship of the Line, A - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Ship of the Line, A - C. S. Forester.epub"}, "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Mr. Midshipman Hornblower - C. S. Forester.epub": {"files": ["content.opf", "cover1.jpeg"], "path": "/home/raelon/Books/Horatio Hornblower series by C. S. Forester/Mr. Midshipman Hornblower - C. S. Forester.epub"}} \ No newline at end of file +{"/home/raelon/Projects/pyShelf/books/Python Tricks by Dan Bader.epub": {"files": ["content.opf", "media/cover-6x9.png", "cover.xhtml"], "path": "/home/raelon/Projects/pyShelf/books/Python Tricks by Dan Bader.epub"}, "/home/raelon/Projects/pyShelf/books/Automate the Boring Stuff with Python - Practical Programming for Total Beginners - 1st Edition (2015) (Pdf, Epub & Mobi) Gooner/Automate the Boring Stuff with Python (2015).epub": {"files": ["OEBPS/content.opf", "OEBPS/Images/cover00710.jpeg", "OEBPS/Text/cover_page.xhtml"], "path": "/home/raelon/Projects/pyShelf/books/Automate the Boring Stuff with Python - Practical Programming for Total Beginners - 1st Edition (2015) (Pdf, Epub & Mobi) Gooner/Automate the Boring Stuff with Python (2015).epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Dune Chronicles (Dune 7)/Dune Chronicles 1 - Hunters of Dune.epub": {"files": ["OPS/xhtml/cover.html", "OPS/9780765312921.opf"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Dune Chronicles (Dune 7)/Dune Chronicles 1 - Hunters of Dune.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Dune Chronicles (Dune 7)/Dune Chronicles 2 - The Sandworms of Dune.epub": {"files": ["OPS/package.opf", "OPS/xhtml/cover.html"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Dune Chronicles (Dune 7)/Dune Chronicles 2 - The Sandworms of Dune.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 1 - Sisterhood of Dune.epub": {"files": ["OEBPS/content.opf", "OEBPS/Text/cover.xml"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 1 - Sisterhood of Dune.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 2 - Mentats of Dune.epub": {"files": ["OEBPS/content.opf", "OEBPS/Images/cover.jpeg"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 2 - Mentats of Dune.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 2.5 - Red Plague.epub": {"files": ["OEBPS/content.opf", "OEBPS/Text/cover.xhtml"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 2.5 - Red Plague.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 3 - Navigators of Dune.epub": {"files": ["OEBPS/content.opf", "OEBPS/Text/cover.xhtml"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Great Schools of Dune/Great Schools of Dune 3 - Navigators of Dune.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Heroes of Dune/Heroes of Dune 1 - Paul of Dune.epub": {"files": ["OPS/package.opf", "OPS/xhtml/cover.xml"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Heroes of Dune/Heroes of Dune 1 - Paul of Dune.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Heroes of Dune/Heroes of Dune 2 - The Winds of Dune.epub": {"files": ["OPS/package.opf", "OPS/xhtml/cover.xml"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Heroes of Dune/Heroes of Dune 2 - The Winds of Dune.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/1 - Dune - Frank Herbert (1965).epub": {"files": ["OEBPS/package.opf", "OEBPS/cover.xml"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/1 - Dune - Frank Herbert (1965).epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/2 - Dune Messiah - Frank Herbert (1969).epub": {"files": ["OEBPS/9780575104426_oeb_opf_r1.opf", "OEBPS/9780575104426_oeb_cover_r1.html"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/2 - Dune Messiah - Frank Herbert (1969).epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/3 - Children of Dune - Frank Herbert (1976).epub": {"files": ["OEBPS/9780575104402_oeb_cover_r1.html", "OEBPS/9780575104402_oeb_opf_r1.opf"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/3 - Children of Dune - Frank Herbert (1976).epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/4 - God Emperor Of Dune - Frank Herbert (1981).epub": {"files": ["OEBPS/9780575104440_oeb_opf_r1.opf", "OEBPS/9780575104440_oeb_cover_r1.html"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/4 - God Emperor Of Dune - Frank Herbert (1981).epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/5 - Heretics of Dune - Frank Herbert (1984).epub": {"files": ["OEBPS/9780575104457_oeb_cover_r1.html", "OEBPS/9780575104457_oeb_opf_r1.opf"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/5 - Heretics of Dune - Frank Herbert (1984).epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/6 - Chapter House Dune - Frank Herbert (1985).epub": {"files": ["OEBPS/9780575104396_oeb_opf_r1.opf", "OEBPS/9780575104396_oeb_cover_r1.html"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Original Dune series/6 - Chapter House Dune - Frank Herbert (1985).epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 1 - House Atreides.epub": {"files": ["OEBPS/content.opf"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 1 - House Atreides.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 2 - House Harkonnen.epub": {"files": ["Herb_9780553897838_epub_opf_r1.opf"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 2 - House Harkonnen.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 3 - House Corrino.epub": {"files": ["OPS/content.opf"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Prelude to Dune/Prelude to Dune 3 - House Corrino.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Short story collections and extras/CliffsNotes on Herbert's Dune & Other Works - L. David Allen.epub": {"files": ["OPS/images/cover.jpg", "OPS/content.opf"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Short story collections and extras/CliffsNotes on Herbert's Dune & Other Works - L. David Allen.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Short story collections and extras/Dreamer of Dune- The Biography of Frank Herbert by Brian Herbert.epub": {"files": ["OEBPS/content.opf", "OEBPS/Images/cover.jpg"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Short story collections and extras/Dreamer of Dune- The Biography of Frank Herbert by Brian Herbert.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Short story collections and extras/Eye (Short stories) - Frank Herbert.epub": {"files": ["OEBPS/content.opf", "OEBPS/Text/cover.xhtml"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Short story collections and extras/Eye (Short stories) - Frank Herbert.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Short story collections and extras/Tales of Dune (Short stories) - Brian Herbert and Kevin J. Anderson.epub": {"files": ["OEBPS/content.opf"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Short story collections and extras/Tales of Dune (Short stories) - Brian Herbert and Kevin J. Anderson.epub"}, "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Short story collections and extras/The Road to Dune (Companion book) - Frank Herbert et al.epub": {"files": ["OEBPS/e9781429924917_cover.jpg", "OEBPS/e9781429924917_content.opf"], "path": "/home/raelon/Projects/pyShelf/books/All Dune books + short stories + extras ePUB/Short story collections and extras/The Road to Dune (Companion book) - Frank Herbert et al.epub"}} \ No newline at end of file diff --git a/lib/.#library.py b/lib/.#library.py deleted file mode 120000 index 9aad06b..0000000 --- a/lib/.#library.py +++ /dev/null @@ -1 +0,0 @@ -raelon@golumnsec.6371:1572529288 \ No newline at end of file diff --git a/lib/pyShelf.py b/lib/pyShelf.py index 8ed4d39..a147302 100755 --- a/lib/pyShelf.py +++ b/lib/pyShelf.py @@ -1,10 +1,12 @@ #!/usr/bin/python import os import zipfile -from http.server import HTTPServer, BaseHTTPRequestHandler +from http.server import BaseHTTPRequestHandler, HTTPServer + from config import Config from lib.library import Catalogue from lib.storage import Storage + config = Config() Storage = Storage() @@ -16,6 +18,7 @@ class InitFiles: for _pointer in file_array: if not os.path.isfile(_pointer): self.CreateFile(_pointer) + print("Concluded file creation") def CreateFile(self, _pointer): """Create the file""" @@ -28,14 +31,21 @@ class InitFiles: class RequestHandler(BaseHTTPRequestHandler): """Request Handler""" def do_GET(self): + # TODO determine how to include stylesheets self.send_response(200) self.end_headers() - self.wfile.write(b'Welcome To pyShelf!') - + if self.path == '/': + self.path = '../static/index.html' + serve_file = open(self.path[1:]).read() + else: + self.send_response(404) + serve_file = "File Not Found" + self.wfile.write(bytes(serve_file, 'utf-8')) class BookServer: """HTTP Frontend""" def __init__(self): + # TODO Get server Ip Address self.server_address = ('', 8000) self.handler = RequestHandler @@ -52,13 +62,13 @@ class BookServer: """Start HTTP Server""" self.httpd = HTTPServer(self.server_address, self.handler) try: + print("Server running @ http://127.0.0.1:8000") self.httpd.serve_forever() self.httpd.handle_request() - if self.close_prompt() == True: - pass except KeyboardInterrupt: - print(KeyboardInterrupt, " Closing Server") + print("Interrupt received, Closing Server") self.close() + print("Server shutdown, Goodbye!") return False def close(self): @@ -68,4 +78,3 @@ class BookServer: return True except Exception: return False - diff --git a/static/css/main.css b/static/css/main.css new file mode 100644 index 0000000..20e1364 --- /dev/null +++ b/static/css/main.css @@ -0,0 +1,3 @@ +body{ + background-color: #f1f1 +} diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..0e10aad --- /dev/null +++ b/static/index.html @@ -0,0 +1,16 @@ + + + + + + + +pyShelf E-Book Server + + +
+

Welcome to pyShelf

+

An Open Source E-book Server!

+
+ +