An abstract base for all messages.
Inheritance diagram:
An ErrorMessage is generated whenever the decoder or the DDJVU API encounters an error condition. All errors are reported as error messages because they can occur asynchronously.
Returns: | the actual error message, as text. |
---|
Returns: | a (function, filename, line_no) tuple indicating where the error was detected. |
---|
A InfoMessage provides informational text indicating the progress of the decoding process. This might be displayed in the browser status bar.
Returns: | the actual error message, as text. |
---|
A NewStreamMessage is generated whenever the decoder needs to access raw DjVu data. The caller must then provide the requested data using the stream file-like object.
In the case of indirect documents, a single decoder might simultaneously request several streams of data.
The first NewStreamMessage message always has name set to None. It indicates that the decoder needs to access the data in the main DjVu file.
Further NewStreamMessage messages messages are generated to access the auxiliary files of indirect or indexed DjVu documents. name then provides the base name of the auxiliary file.
Returns: | the requrested URI. |
---|
URI is is set according to the uri argument provided to function Context.new_document(). The first NewStreamMessage message always contain the URI passed to Context.new_document(). Subsequent NewStreamMessage messages contain the URI of the auxiliary files for indirect or indexed DjVu documents.
Returns: | a data stream. |
---|
Do nothing.
(This method is provided solely to implement Python’s file-like interface.)
Raises exceptions.IOError: | |
---|---|
always. |
(This method is provided solely to implement Python’s file-like interface.)
Provide raw data to the DjVu decoder.
This method should be called as soon as the data is available, for instance when receiving DjVu data from a network connection.
A DocInfoMessage indicates that basic information about the document has been obtained and decoded. Not much can be done before this happens.
Check the document’s decoding_status to determine whether the operation was successful.
The page decoding process generates a PageInfoMessage:
You can distinguish both cases using the page job’s status.
A PageInfoMessage may be also generated as a consequence of reading Page.get_info() or Page.dump.
A ThumbnailMessage is sent when additional thumbnails are available.
Return type: | Thumbnail |
---|---|
Raises NotAvailable: | |
if the Document has been garbage-collected. |
A ProgressMessage is generated to indicate progress towards the completion of a print or save job.
Returns: | the percent of the job done. |
---|
Returns: | a JobException subclass indicating the current job status. |
---|