fn_composers submodule

This module holds few functions used to dynamically construct filenames for files in SIP package.

API

Filenames are generated dynamically. Here is set of constructors for those filanames.

ltp.fn_composers._get_suffix(path)[source]

Return suffix from path.

/home/xex/somefile.txt –> txt.

Parameters:path (str) – Full file path.
Returns:str – Suffix.
Raises:UserWarning – When / is detected in suffix.
ltp.fn_composers.original_fn(book_id, ebook_fn)[source]

Construct original filename from book_id and ebook_fn.

Parameters:
  • book_id (int/str) – ID of the book, without special characters.
  • ebook_fn (str) – Original name of the ebook. Used to get suffix.
Returns:

str – Filename in format oc_nk-BOOKID.suffix.

ltp.fn_composers.metadata_fn(book_id)[source]

Construct filename for metadata file.

Parameters:book_id (int/str) – ID of the book, without special characters.
Returns:str – Filename in format meds_nk-BOOKID.xml.
ltp.fn_composers.checksum_fn(book_id)[source]

Construct filename for checksum file.

Parameters:book_id (int/str) – ID of the book, without special characters.
Returns:str – Filename in format MD5_BOOKID.md5.
ltp.fn_composers.info_fn(book_id)[source]

Construct filename for info.xml file.

Parameters:book_id (int/str) – ID of the book, without special characters.
Returns:str – Filename in format info_BOOKID.xml.

Table Of Contents

Previous topic

ltp.py

Next topic

xslt_transformer submodule

This Page