Book¶
-
class encyclopaedia.book.Book(number: int | None =
None
, parent: Encyclopaedia | None =None
, title: str =''
, subject: str =''
, locked: bool =False
, locked_persistent: bool | None =False
, locked_title: str ='???'
)[source]¶ Bases:
EventEmitter
,object
Container for EncEntry which have a strong relationship with each other.
A Book should be placed inside an Encyclopaedia. When sorted and/or filtered, the Book’s attributes will be used.
- Parameters:¶
- number: int | None =
None
¶ The Book’s number.
- parent: Encyclopaedia | None =
None
¶ The parent container for the Book.
- title: str =
''
¶ A name for the Book.
- subject: str =
''
¶ The subject to associate the Book with.
- locked: bool =
False
¶ The initial locked status of the Book.
- locked_persistent: bool | None =
False
¶ Use persistent data for recording locked status.
- locked_title: str =
'???'
¶ Placeholder text for the title. Shown when the Book is locked.
- number: int | None =
- property active : EncEntry¶
Get the object for the currently active page.
- Raises:¶
GetEntryError – If no active page could be found.
- property locked : bool¶
The locked status of the Book.
- property name : str¶
Alias for title, used for sorting in an Encyclopaedia.
- property percentage_unlocked : float¶
Get the percentage of the Book’s pages which are unlocked.
- set_active_page(page_number: int) None [source]¶
Set a page to be active, based on the page number.
- property title : str¶
The title of the Book.