Final Refactoring before alpha release

This commit is contained in:
Mike Young
2019-11-20 00:55:16 -05:00
parent 5593235212
commit 600ae55766
168 changed files with 11 additions and 43 deletions

View File

@@ -1,34 +0,0 @@
# Generated by Django 2.2.7 on 2019-11-10 03:56
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="books",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("title", models.CharField(max_length=255)),
("author", models.CharField(blank=True, max_length=255)),
("categories", models.CharField(blank=True, max_length=255)),
("cover", models.BinaryField(blank=True, editable=True)),
("pages", models.IntegerField(blank=True)),
("progress", models.IntegerField(blank=True)),
("file_name", models.CharField(max_length=255)),
],
),
]

1
src/backend/data/shelf.json Executable file

File diff suppressed because one or more lines are too long

View File

@@ -11,7 +11,7 @@ class Config:
_fp = "config.json"
print(os.path)
def __init__(self, root=os.path.abspath("../")):
def __init__(self, root=os.path.abspath("../../")):
_data = self.open_file(root)
self.book_path = _data["BOOKPATH"]
self.TITLE = _data["TITLE"]
@@ -24,6 +24,7 @@ class Config:
self.book_shelf,
self.catalogue_db,
]
self.root = root
self.auto_scan = True
def open_file(self, root):

View File

@@ -19,15 +19,14 @@ class Catalogue:
"""Step One: filter_books"""
def __init__(self, root):
def __init__(self, config):
self.file_list = []
self.opf_regx = re.compile(r"\.opf")
self.cover_regx = re.compile(r"\.jpg|\.jpeg|\.png|\.bmp|\.gif")
self.html_regx = re.compile(r"\.html")
self.root_dir = root
_config = Config(root)
self.book_folder = _config.book_path
self.book_shelf = _config.book_shelf
self.root_dir = config.root
self.book_folder = config.book_path
self.book_shelf = config.book_shelf
self._book_list_expanded = None
self.books = None

View File

@@ -6,9 +6,9 @@ from lib.config import Config
from lib.library import Catalogue
from lib.pyShelf import InitFiles
ROOT_DIR = os.path.abspath("../")
ROOT_DIR = os.path.abspath("../..")
sys.path.append(ROOT_DIR)
config = Config(ROOT_DIR) # Get configuration settings
InitFiles(config.file_array) # Initialize file system
Catalogue = Catalogue(ROOT_DIR) # Open the Catalogue
Catalogue = Catalogue(config) # Open the Catalogue
Catalogue.import_books() # Filter Your books

0
frontend/frontend/__init__.py → src/data/shelf.json Executable file → Normal file
View File

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

View File

Before

Width:  |  Height:  |  Size: 504 B

After

Width:  |  Height:  |  Size: 504 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 380 B

View File

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 677 B

View File

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 392 B

View File

Before

Width:  |  Height:  |  Size: 560 B

After

Width:  |  Height:  |  Size: 560 B

View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

View File

Before

Width:  |  Height:  |  Size: 581 B

After

Width:  |  Height:  |  Size: 581 B

View File

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 436 B

View File

Before

Width:  |  Height:  |  Size: 560 B

After

Width:  |  Height:  |  Size: 560 B

View File

Before

Width:  |  Height:  |  Size: 458 B

After

Width:  |  Height:  |  Size: 458 B

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

View File

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 280 B

Some files were not shown because too many files have changed in this diff Show More