An abstract base for all messages.
Inheritance diagram:
digraph inheritance271543d39c { rankdir=LR; size="8.0, 12.0"; "ChunkMessage" [style="setlinewidth(0.5)",URL="#djvu.decode.ChunkMessage",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A ChunkMessage indicates that an additional chunk of DjVu data has been",height=0.25,shape=box,fontsize=10]; "Message" -> "ChunkMessage" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DocInfoMessage" [style="setlinewidth(0.5)",URL="#djvu.decode.DocInfoMessage",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A DocInfoMessage indicates that basic information about the document has",height=0.25,shape=box,fontsize=10]; "Message" -> "DocInfoMessage" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ErrorMessage" [style="setlinewidth(0.5)",URL="#djvu.decode.ErrorMessage",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="An ErrorMessage is generated whenever the decoder or the DDJVU API",height=0.25,shape=box,fontsize=10]; "Message" -> "ErrorMessage" [arrowsize=0.5,style="setlinewidth(0.5)"]; "InfoMessage" [style="setlinewidth(0.5)",URL="#djvu.decode.InfoMessage",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A InfoMessage provides informational text indicating the progress of the",height=0.25,shape=box,fontsize=10]; "Message" -> "InfoMessage" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Message" [style="setlinewidth(0.5)",URL="#djvu.decode.Message",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="An abstract message.",height=0.25,shape=box,fontsize=10]; "NewStreamMessage" [style="setlinewidth(0.5)",URL="#djvu.decode.NewStreamMessage",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A NewStreamMessage is generated whenever the decoder needs to access raw",height=0.25,shape=box,fontsize=10]; "Message" -> "NewStreamMessage" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PageInfoMessage" [style="setlinewidth(0.5)",URL="#djvu.decode.PageInfoMessage",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="The page decoding process generates a PageInfoMessage:",height=0.25,shape=box,fontsize=10]; "Message" -> "PageInfoMessage" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ProgressMessage" [style="setlinewidth(0.5)",URL="#djvu.decode.ProgressMessage",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A ProgressMessage is generated to indicate progress towards the",height=0.25,shape=box,fontsize=10]; "Message" -> "ProgressMessage" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RedisplayMessage" [style="setlinewidth(0.5)",URL="#djvu.decode.RedisplayMessage",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A RedisplayMessage is generated when a DjVu viewer should call",height=0.25,shape=box,fontsize=10]; "ChunkMessage" -> "RedisplayMessage" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RelayoutMessage" [style="setlinewidth(0.5)",URL="#djvu.decode.RelayoutMessage",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A RelayoutMessage is generated when a DjVu viewer should recompute the",height=0.25,shape=box,fontsize=10]; "ChunkMessage" -> "RelayoutMessage" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ThumbnailMessage" [style="setlinewidth(0.5)",URL="#djvu.decode.ThumbnailMessage",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A ThumbnailMessage is sent when additional thumbnails are available.",height=0.25,shape=box,fontsize=10]; "Message" -> "ThumbnailMessage" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
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. |
---|
Indicate that no more data will be provided on the particular stream.
Indicate that no more data will be provided on the particular stream, because the user has interrupted the data transfer (for instance by pressing the stop button of a browser) and that the decoding threads should be stopped as soon as feasible.
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 ChunkMessage indicates that an additional chunk of DjVu data has been decoded.
A RelayoutMessage is generated when a DjVu viewer should recompute the layout of the page viewer because the page size and resolution information has been updated.
A RedisplayMessage is generated when a DjVu viewer should call PageJob.render() and redisplay the page. This happens, for instance, when newly decoded DjVu data provides a better image.
A ThumbnailMessage is sent when additional thumbnails are available.
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. |
---|