[Python-modules-commits] r13332 - in packages/pdfminer/trunk/debian (4 files)
jwilk at users.alioth.debian.org
jwilk at users.alioth.debian.org
Tue Jun 8 16:31:33 UTC 2010
Date: Tuesday, June 8, 2010 @ 16:31:27
Author: jwilk
Revision: 13332
Reuse CMaps provided by the poppler-data package.
Added:
packages/pdfminer/trunk/debian/patches/poppler-data.diff
Modified:
packages/pdfminer/trunk/debian/changelog
packages/pdfminer/trunk/debian/control
packages/pdfminer/trunk/debian/patches/series
Modified: packages/pdfminer/trunk/debian/changelog
===================================================================
--- packages/pdfminer/trunk/debian/changelog 2010-06-08 15:23:23 UTC (rev 13331)
+++ packages/pdfminer/trunk/debian/changelog 2010-06-08 16:31:27 UTC (rev 13332)
@@ -6,5 +6,7 @@
[dfsg-testsuite.diff]
* Disable test suite for psparser.py, as it is currently broken.
[psparser-testsuite.diff]
+ * Reuse CMaps provided by the poppler-data package.
+ [poppler-data.diff]
- -- Jakub Wilk <jwilk at debian.org> Tue, 08 Jun 2010 16:21:38 +0200
+ -- Jakub Wilk <jwilk at debian.org> Tue, 08 Jun 2010 18:23:54 +0200
Modified: packages/pdfminer/trunk/debian/control
===================================================================
--- packages/pdfminer/trunk/debian/control 2010-06-08 15:23:23 UTC (rev 13331)
+++ packages/pdfminer/trunk/debian/control 2010-06-08 16:31:27 UTC (rev 13332)
@@ -15,7 +15,7 @@
Package: python-pdfminer
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}
-Suggests: python-pdfminer-cmap
+Suggests: poppler-data
Description: PDF parser and analyser
PDFMiner is a tool for extracting information from PDF documents, which
focuses entirely on getting and analyzing text data. It allows to obtain the
@@ -26,13 +26,3 @@
.
This package provides the Python module and the command-line tools: pdf2txt
and dumppdf.
-
-Package: python-pdfminer-cmap
-Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, python-pdfminer
-Description: PDF parser and analyser (CMaps)
- PDFMiner is a tool for extracting information from PDF documents, which
- focuses entirely on getting and analyzing text data.
- .
- This package contains the encoding data needed to read some PDF documents in
- CJK (Chinese, Japanese, Korean) languages.
Added: packages/pdfminer/trunk/debian/patches/poppler-data.diff
===================================================================
--- packages/pdfminer/trunk/debian/patches/poppler-data.diff (rev 0)
+++ packages/pdfminer/trunk/debian/patches/poppler-data.diff 2010-06-08 16:31:27 UTC (rev 13332)
@@ -0,0 +1,61 @@
+Description:
+ Reuse CMaps provided by the poppler-data package. This way we don't need to
+ ship pdfminer.cmap.* modules in the Debian package.
+Author: Jakub Wilk <jwilk at debian.org>
+Bug-Debian: http://bugs.debian.org/584555
+Forwarded: not-needed
+Last-Update: 2010-06-08
+
+--- pdfminer-20100424+dfsg.orig/pdfminer/cmapdb.py
++++ pdfminer-20100424+dfsg/pdfminer/cmapdb.py
+@@ -15,6 +15,7 @@ import sys
+ import re
+ import os
+ import os.path
++import glob
+ from struct import pack, unpack
+ from psparser import PSStackParser
+ from psparser import PSException, PSSyntaxError, PSTypeError, PSEOF
+@@ -225,8 +226,20 @@ class CMapDB(object):
+ try:
+ module = __import__(modname, fromlist=['pdfminer.cmap'])
+ except ImportError:
++ for directory in glob.glob('/usr/share/poppler/cMap/*/'):
++ if not os.path.exists(directory + name):
++ continue
++ cmap = FileCMap()
++ fp = file(directory + name, 'rb')
++ try:
++ CMapParser(cmap, fp).run()
++ finally:
++ fp.close()
++ return cmap
++ raise ValueError(name)
+ raise CMapDB.CMapNotFound(name)
+- return PyCMap(name, module)
++ else:
++ return PyCMap(name, module)
+
+ @classmethod
+ def get_unicode_map(klass, name, vertical=False):
+@@ -236,8 +249,19 @@ class CMapDB(object):
+ try:
+ module = __import__(modname, fromlist=['pdfminer.cmap'])
+ except ImportError:
++ directory = '/usr/share/poppler/cidToUnicode/'
++ if os.path.exists(directory + name):
++ cmap = FileUnicodeMap()
++ fp = file(directory + name, 'rb')
++ try:
++ CMapParser(cmap, fp).run()
++ finally:
++ fp.close()
++ return cmap
++ raise ValueError(name)
+ raise CMapDB.CMapNotFound(name)
+- return PyUnicodeMap(name, module, vertical)
++ else:
++ return PyUnicodeMap(name, module, vertical)
+
+
+ ## CMapParser
Modified: packages/pdfminer/trunk/debian/patches/series
===================================================================
--- packages/pdfminer/trunk/debian/patches/series 2010-06-08 15:23:23 UTC (rev 13331)
+++ packages/pdfminer/trunk/debian/patches/series 2010-06-08 16:31:27 UTC (rev 13332)
@@ -1,2 +1,3 @@
pdf-testsuite.diff
psparser-testsuite.diff
+poppler-data.diff
More information about the Python-modules-commits
mailing list