src.backend.lib.library.Catalogue(3)

NAME
src.backend.lib.library.Catalogue

SYNOPSIS

Inherited by src.backend.lib.overide.ACatalogue, and src.backend.tests.library_test.Test_Catalogue.

  Public Member Functions
def __init__ (self, config)
def scan_folder (self, _path=None)
def filter_books (self)
def process_by_filetype (self, book)
def extract_metadata_epub (self, book)
def extract_metadata_pdf (self, book)
def extract_metadata_mobi (self, book)
def extract_content (self, book_zip, book)
def extract_cover_html (self, book_zip, book)
def extract_cover_image (self, book_zip, book)
def compare_shelf_current (self)
def import_books (self, list=None, **kwargs)

  Static Public Member Functions
def process_epub (book)
def stripTags (source)

  Public Attributes
file_list
opf_regx
cover_regx
html_regx
title_sanitization_regx
title_sanitization_lvl2_regx
title_sanitization_dirs_regx
root_dir
book_folder
books
db_pointer
config

Detailed Description

Decodes book metadata for storage

Constructor & Destructor Documentation

  def src.backend.lib.library.Catalogue.__init__ ( self, config)

Member Function Documentation

  def src.backend.lib.library.Catalogue.compare_shelf_current ( self)

Calls storage system, gets list of books stored and compares against files on disk

  def src.backend.lib.library.Catalogue.extract_content ( self, book_zip, book)

Opens epub as zip file filters then stores as list any files matching opf_regx

  def src.backend.lib.library.Catalogue.extract_cover_html ( self, book_zip, book)

Opens epub as zip file filters then stores as list any files matching html_regx

  def src.backend.lib.library.Catalogue.extract_cover_image ( self, book_zip, book)

Opens epub as zip file filters then stores as list any files matching cover_regx

  def src.backend.lib.library.Catalogue.extract_metadata_epub ( self, book)

Return extracted metadata and cover picture
book['path'] == Full path to ebook file
book['files'] == list of files from self.process_book(book)

  def src.backend.lib.library.Catalogue.extract_metadata_mobi ( self, book)

  def src.backend.lib.library.Catalogue.extract_metadata_pdf ( self, book)

Return extracted metadata
:NOTES: Retrieval of data has been problematic, some pdf's providing
reliable titles that corespond with the actual, and others being
nonsense.

  def src.backend.lib.library.Catalogue.filter_books ( self)

Calls scan_folder and filters out book files.
:returns self._book_list_expanded: json string containing
all book metadata

Reimplemented in src.backend.tests.library_test.Test_Catalogue.

  def src.backend.lib.library.Catalogue.import_books ( self, list = None, ** kwargs)

Main entry point for import operations.
Gets a list of new files via compare_shelf_current.
Iterates over list and inserts new books into database.

Reimplemented in src.backend.lib.overide.ACatalogue.

  def src.backend.lib.library.Catalogue.process_by_filetype ( self, book)

Determine books filetype and process.

  def src.backend.lib.library.Catalogue.process_epub ( book) [static]

Return dictionary of epub file contents

  def src.backend.lib.library.Catalogue.scan_folder ( self, _path = None)

Scan folder by _path, allows recurisive scanning

Reimplemented in src.backend.lib.overide.ACatalogue.

  def src.backend.lib.library.Catalogue.stripTags ( source) [static]

Member Data Documentation

  src.backend.lib.library.Catalogue.book_folder

  src.backend.lib.library.Catalogue.books

  src.backend.lib.library.Catalogue.config

  src.backend.lib.library.Catalogue.cover_regx

  src.backend.lib.library.Catalogue.db_pointer

  src.backend.lib.library.Catalogue.file_list

  src.backend.lib.library.Catalogue.html_regx

  src.backend.lib.library.Catalogue.opf_regx

  src.backend.lib.library.Catalogue.root_dir

  src.backend.lib.library.Catalogue.title_sanitization_dirs_regx

  src.backend.lib.library.Catalogue.title_sanitization_lvl2_regx

  src.backend.lib.library.Catalogue.title_sanitization_regx

Author

Generated automatically by Doxygen for pyShelf Open Source Ebook Server from the source code.