1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
Document files
==============
.. currentmodule:: djvu.decode
.. class:: DocumentFiles
Component files of a document.
Use :attr:`Document.files` to obtain instances of this class.
File indexing is zero-based, i.e. :attr:`~Document.files`\ ``[0]`` stands for the first file.
``len(files)`` might raise :exc:`NotAvailable` when called before receiving
a :class:`DocInfoMessage`.
.. currentmodule:: djvu.decode
.. class:: File
Component file of a document.
Use :attr:`Document.files`\ ``[N]`` to obtain instances of this class.
.. attribute:: document
:rtype: :class:`Document`
.. attribute:: n
:return: the component file number.
File indexing is zero-based, i.e. 0 stands for the very first file.
.. method:: get_info([wait=1])
Attempt to obtain information about the component file.
If `wait` is true, wait until the information is available.
:raise NotAvailable: if the information is not available.
:raise JobFailed: on failure.
.. attribute:: type
:return: the type of the compound file.
The following types are possible:
.. data:: FILE_TYPE_PAGE
.. data:: FILE_TYPE_THUMBNAILS
.. data:: FILE_TYPE_INCLUDE
:raise NotAvailable: see :meth:`~File.get_info`.
:raise JobFailed: on failure.
.. attribute:: n_page
:return: the page number, or ``None`` when not applicable.
Page indexing is zero-based, i.e. 0 stands for the very first page.
:raise NotAvailable: see :meth:`~File.get_info`.
:raise JobFailed: on failure.
.. attribute:: page
:return: the page, or ``None`` when not applicable.
:raise NotAvailable: see :meth:`~File.get_info`.
:raise JobFailed: on failure.
.. attribute:: size
:return: the compound file size, or ``None`` when unknown.
:raise NotAvailable: see :meth:`~File.get_info`.
:raise JobFailed: on failure.
.. attribute:: id
:return: the compound file identifier, or ``None``.
:raise NotAvailable: see :meth:`~File.get_info`.
:raise JobFailed: on failure.
.. attribute:: name
:return: the compound file name, or ``None``.
:raise NotAvailable: see :meth:`~File.get_info`.
:raise JobFailed: on failure.
.. attribute:: title
:return: the compound file title, or ``None``.
:raise NotAvailable: see :meth:`~File.get_info`.
:raise JobFailed: on failure.
.. attribute:: dump
:return:
a text describing the contents of the file using the same format as
the ``djvudump`` command.
If the information is not available, raise :exc:`NotAvailable` exception.
Then, :exc:`PageInfoMessage` messages with empty
:attr:`~Message.page_job` may be emitted.
:raise NotAvailable: see above.
|