Base Class for Importers

Base class for all importers

EXAMPLES:

>>> sample_importer  
<quill.importer.quill_importer.QuillImporter object at 0x...>
class quill.importer.base.ImporterBase[source]

Bases: object

ctime_millis()[source]

Return the creation time in milliseconds.

Return type:integer

You should overriding this method in derived classes. Otherwise the current time will be used.

EXAMPLES:

>>> sample_importer.ctime_millis()
1355064642000
get_book()[source]

Create a Book object from the importer.

Return type:a Book object

You should not override this method. All it does is takes the metadata and creates the corresponding book object.

EXAMPLES:

>>> sample_importer.get_book()  
Book title: Example Notebook
Uuid: 1fd6a485-33ed-4a45-a5a1-e06e55fdca57
Created ...
Last modified ...
get_page(n)[source]

Return the n-th page.

Return type:a Page object

Must be implemented in derived classes.

EXAMPLES:

>>> sample_importer.n_pages()
3
mtime_millis()[source]

Return the last modification time in milliseconds.

Return type:integer

You should overriding this method in derived classes. Otherwise the current time will be used.

EXAMPLES:

>>> sample_importer.mtime_millis()
1355065045000
n_pages()[source]

Return the number of pages.

Return type:integer

Must be implemented in derived classes.

EXAMPLES:

>>> sample_importer.n_pages()
3
title()[source]

Return the title of the book.

Return type:string

You should overriding this method in derived classes. Otherwise a default title will be used.

EXAMPLES:

>>> sample_importer.title()
'Example Notebook'
uuid()[source]

Return the UUID of the book.

Return type:string

You should overriding this method in derived classes. Otherwise a random UUID will be generated.

EXAMPLES:

>>> sample_importer.uuid()
'1fd6a485-33ed-4a45-a5a1-e06e55fdca57'
exception quill.importer.base.QuillImporterError[source]

Bases: exceptions.Exception

Previous topic

Straight Line

Next topic

Importer for Quill Archives

This Page