python-djvulibre-0.8.4/ 0000755 0000000 0000000 00000000000 13441503047 015027 5 ustar 00root root 0000000 0000000 python-djvulibre-0.8.4/MANIFEST.in 0000644 0000000 0000000 00000000522 13347744054 016576 0 ustar 00root root 0000000 0000000 include MANIFEST.in
include COPYING
exclude README.rst
include doc/COPYING
include doc/README
include doc/api/*.rst
include doc/api/conf.py
include doc/changelog
include doc/credits
include doc/todo
include examples/*
recursive-include djvu *.py *.pxi *.pxd *.pyx
recursive-include tests *.py Makefile *.tex *.djvu
include private/*
python-djvulibre-0.8.4/PKG-INFO 0000644 0000000 0000000 00000002004 13441503047 016120 0 ustar 00root root 0000000 0000000 Metadata-Version: 1.1
Name: python-djvulibre
Version: 0.8.4
Summary: Python support for the DjVu image format
Home-page: http://jwilk.net/software/python-djvulibre
Author: Jakub Wilk
Author-email: jwilk@jwilk.net
License: GNU GPL 2
Description: *python-djvulibre* is a set of Python bindings for
the `DjVuLibre `_ library,
an open source implementation of `DjVu `_.
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Classifier: Topic :: Text Processing
python-djvulibre-0.8.4/djvu/ 0000755 0000000 0000000 00000000000 13441503047 015777 5 ustar 00root root 0000000 0000000 python-djvulibre-0.8.4/djvu/__init__.py 0000644 0000000 0000000 00000001242 12726107516 020115 0 ustar 00root root 0000000 0000000 # encoding=UTF-8
# Copyright © 2015 Jakub Wilk
#
# This file is part of python-djvulibre.
#
# python-djvulibre is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# python-djvulibre is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
import sys
if sys.version_info < (2, 6):
raise RuntimeError('Python >= 2.6 is required')
# vim:ts=4 sts=4 sts=4 sw=4 et
python-djvulibre-0.8.4/djvu/common.pxi 0000644 0000000 0000000 00000007135 13441502050 020010 0 ustar 00root root 0000000 0000000 # Copyright © 2008-2018 Jakub Wilk
#
# This file is part of python-djvulibre.
#
# python-djvulibre is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# python-djvulibre is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
include 'config.pxi'
# C library:
from libc.stdlib cimport free
from libc.string cimport strlen
# Python memory handling:
from cpython.mem cimport PyMem_Malloc as py_malloc
from cpython.mem cimport PyMem_Free as py_free
# Python numbers:
from cpython cimport (
PyInt_Check as is_short_int,
PyLong_Check as is_long_int,
)
cdef int is_int(object o):
return is_short_int(o) or is_long_int(o)
from cpython cimport (
PyNumber_Check as is_number,
PyFloat_Check as is_float,
)
IF PY3K:
from cpython cimport PyNumber_Long as int
ELSE:
from cpython cimport PyNumber_Int as int
from cpython cimport PyNumber_Long as long
# Python strings:
from cpython cimport (
PyUnicode_Check as is_unicode,
PyString_Check as is_string,
PyBytes_Check as is_bytes,
)
from cpython cimport (
PyUnicode_AsUTF8String as encode_utf8,
PyUnicode_DecodeUTF8 as decode_utf8_ex,
PyBytes_AsStringAndSize as bytes_to_charp,
PyBytes_FromStringAndSize as charp_to_bytes,
)
IF PY3K:
cdef extern from 'Python.h':
object charp_to_string 'PyUnicode_FromString'(char *v)
ELSE:
from cpython cimport PyString_FromString as charp_to_string
cdef object decode_utf8(const char *s):
return decode_utf8_ex(s, strlen(s), NULL)
cdef extern from 'Python.h':
int buffer_to_writable_memory 'PyObject_AsWriteBuffer'(object, void **, Py_ssize_t *)
# Python booleans:
from cpython cimport PyBool_FromLong as bool
# Python pointer->integer conversion:
from cpython cimport PyLong_FromVoidPtr as voidp_to_int
# Python files:
from libc.stdio cimport FILE
# Python lists:
from cpython cimport PyList_Append as list_append
# Python rich comparison:
from cpython cimport PyObject_RichCompare as richcmp
# Python slices:
cdef extern from 'Python.h':
int is_slice 'PySlice_Check'(object)
# Python threads:
from cpython cimport (
PyThread_type_lock as Lock,
PyThread_allocate_lock as allocate_lock,
PyThread_free_lock as free_lock,
PyThread_acquire_lock as acquire_lock,
PyThread_release_lock as release_lock,
WAIT_LOCK,
NOWAIT_LOCK,
)
# Python type checks:
cdef extern from 'object.h':
ctypedef struct PyTypeObject:
const char *tp_name
from cpython cimport PyObject
from cpython cimport PyObject_TypeCheck as _typecheck
cdef object type(object o):
return