[Python-modules-commits] r14265 - in packages/pdfminer/trunk/debian (8 files)
jwilk at users.alioth.debian.org
jwilk at users.alioth.debian.org
Wed Aug 25 23:33:47 UTC 2010
Date: Wednesday, August 25, 2010 @ 23:33:46
Author: jwilk
Revision: 14265
* New upstream release.
+ Drop all patches: either applied upstream or not needed anymore.
* Relax debian/watch and debian/rules to allow versions with pN suffix.
Modified:
packages/pdfminer/trunk/debian/changelog
packages/pdfminer/trunk/debian/patches/series
packages/pdfminer/trunk/debian/rules
Deleted:
packages/pdfminer/trunk/debian/patches/encoding-data.diff
packages/pdfminer/trunk/debian/patches/layout.diff
packages/pdfminer/trunk/debian/patches/nested-tags.diff
packages/pdfminer/trunk/debian/patches/pdf-testsuite.diff
packages/pdfminer/trunk/debian/patches/psparser-testsuite.diff
Modified: packages/pdfminer/trunk/debian/changelog
===================================================================
--- packages/pdfminer/trunk/debian/changelog 2010-08-25 23:21:14 UTC (rev 14264)
+++ packages/pdfminer/trunk/debian/changelog 2010-08-25 23:33:46 UTC (rev 14265)
@@ -1,8 +1,10 @@
-pdfminer (20100424+dfsg-2) UNRELEASED; urgency=low
+pdfminer (20100619p1+dfsg-2) UNRELEASED; urgency=low
- * Relax the watch file to allow versions with pN suffix.
+ * New upstream release.
+ + Drop all patches: either applied upstream or not needed anymore.
+ * Relax debian/watch and debian/rules to allow versions with pN suffix.
- -- Jakub Wilk <jwilk at debian.org> Thu, 26 Aug 2010 01:20:41 +0200
+ -- Jakub Wilk <jwilk at debian.org> Thu, 26 Aug 2010 01:30:44 +0200
pdfminer (20100424+dfsg-1) experimental; urgency=low
Deleted: packages/pdfminer/trunk/debian/patches/encoding-data.diff
===================================================================
--- packages/pdfminer/trunk/debian/patches/encoding-data.diff 2010-08-25 23:21:14 UTC (rev 14264)
+++ packages/pdfminer/trunk/debian/patches/encoding-data.diff 2010-08-25 23:33:46 UTC (rev 14265)
@@ -1,193 +0,0 @@
-Description:
- Store encoding data in gzipped pickles rather than in Python modules.
- This way we can save lots of disk space.
-Author: Jakub Wilk <jwilk at debian.org>
-Forwarded: yes
-Last-Update: 2010-06-12
-
---- a/setup.py
-+++ b/setup.py
-@@ -22,6 +22,9 @@
- 'pdfminer',
- 'pdfminer.cmap'
- ],
-+ package_data={
-+ 'pdfminer.cmap': ['*.pickle.gz'],
-+ },
- scripts=[
- 'tools/pdf2txt.py',
- 'tools/dumppdf.py'
---- a/Makefile
-+++ b/Makefile
-@@ -36,17 +36,17 @@
- CONV_CMAP=$(PYTHON) tools/conv_cmap.py
- CMAPSRC=cmaprsrc
- CMAPDST=pdfminer/cmap
--cmap: $(CMAPDST)/TO_UNICODE_Adobe_CNS1.py $(CMAPDST)/TO_UNICODE_Adobe_GB1.py \
-- $(CMAPDST)/TO_UNICODE_Adobe_Japan1.py $(CMAPDST)/TO_UNICODE_Adobe_Korea1.py
-+cmap: $(CMAPDST)/to-unicode-Adobe-CNS1.pickle.gz $(CMAPDST)/to-unicode-Adobe-GB1.pickle.gz \
-+ $(CMAPDST)/to-unicode-Adobe-Japan1.pickle.gz $(CMAPDST)/to-unicode-Adobe-Korea1.pickle.gz
- cmap_clean:
- cd $(CMAPDST) && make cmap_clean
--$(CMAPDST)/TO_UNICODE_Adobe_CNS1.py:
-+$(CMAPDST)/to-unicode-Adobe-CNS1.pickle.gz:
- $(CONV_CMAP) $(CMAPDST) Adobe-CNS1 $(CMAPSRC)/cid2code_Adobe_CNS1.txt cp950 big5
--$(CMAPDST)/TO_UNICODE_Adobe_GB1.py:
-+$(CMAPDST)/to-unicode-Adobe-GB1.pickle.gz:
- $(CONV_CMAP) $(CMAPDST) Adobe-GB1 $(CMAPSRC)/cid2code_Adobe_GB1.txt cp936 gb2312
--$(CMAPDST)/TO_UNICODE_Adobe_Japan1.py:
-+$(CMAPDST)/to-unicode-Adobe-Japan1.pickle.gz:
- $(CONV_CMAP) $(CMAPDST) Adobe-Japan1 $(CMAPSRC)/cid2code_Adobe_Japan1.txt cp932 euc-jp
--$(CMAPDST)/TO_UNICODE_Adobe_Korea1.py:
-+$(CMAPDST)/to-unicode-Adobe-Korea1.pickle.gz:
- $(CONV_CMAP) $(CMAPDST) Adobe-Korea1 $(CMAPSRC)/cid2code_Adobe_Korea1.txt cp949 euc-kr
-
- test: cmap
---- a/pdfminer/cmapdb.py
-+++ b/pdfminer/cmapdb.py
-@@ -15,6 +15,9 @@
- import re
- import os
- import os.path
-+import gzip
-+import cPickle as pickle
-+import cmap
- from struct import pack, unpack
- from psparser import PSStackParser
- from psparser import PSException, PSSyntaxError, PSTypeError, PSEOF
-@@ -210,34 +213,50 @@
- class CMapDB(object):
-
- debug = 0
-+ _cmap_cache = {}
-+ _umap_cache = {}
-
- class CMapNotFound(CMapError): pass
-
- @classmethod
-+ def _load_data(klass, name):
-+ filename = '%s.pickle.gz' % name
-+ if klass.debug:
-+ print >>sys.stderr, 'loading:', name
-+ for directory in os.path.dirname(cmap.__file__), '/usr/share/pdfminer/':
-+ path = os.path.join(directory, filename)
-+ if os.path.exists(path):
-+ gzfile = gzip.open(path)
-+ try:
-+ return type(name, (), pickle.loads(gzfile.read()))
-+ finally:
-+ gzfile.close()
-+ else:
-+ raise CMapDB.CMapNotFound(name)
-+
-+ @classmethod
- def get_cmap(klass, name):
- if name == 'Identity-H':
- return IdentityCMap(False)
- elif name == 'Identity-V':
- return IdentityCMap(True)
-- modname = 'pdfminer.cmap.%s' % name.replace('-','_')
-- if klass.debug:
-- print >>sys.stderr, 'loading:', modname
- try:
-- module = __import__(modname, fromlist=['pdfminer.cmap'])
-- except ImportError:
-- raise CMapDB.CMapNotFound(name)
-- return PyCMap(name, module)
-+ return klass._cmap_cache[name]
-+ except KeyError:
-+ pass
-+ data = klass._load_data(name)
-+ klass._cmap_cache[name] = cmap = PyCMap(name, data)
-+ return cmap
-
- @classmethod
- def get_unicode_map(klass, name, vertical=False):
-- modname = 'pdfminer.cmap.TO_UNICODE_%s' % name.replace('-','_')
-- if klass.debug:
-- print >>sys.stderr, 'loading:', modname, vertical
- try:
-- module = __import__(modname, fromlist=['pdfminer.cmap'])
-- except ImportError:
-- raise CMapDB.CMapNotFound(name)
-- return PyUnicodeMap(name, module, vertical)
-+ return klass._umap_cache[name][vertical]
-+ except KeyError:
-+ pass
-+ data = klass._load_data('to-unicode-%s' % name)
-+ klass._umap_cache[name] = umaps = [PyUnicodeMap(name, data, v) for v in (False, True)]
-+ return umaps[vertical]
-
-
- ## CMapParser
---- a/pdfminer/cmap/Makefile
-+++ b/pdfminer/cmap/Makefile
-@@ -6,5 +6,4 @@
- -rm *.pyc *.pyo
-
- cmap_clean:
-- -rm *.py
-- touch __init__.py
-+ rm -f *.pickle.gz
---- a/tools/conv_cmap.py
-+++ b/tools/conv_cmap.py
-@@ -1,6 +1,8 @@
- #!/usr/bin/env python
- import sys
- import os.path
-+import gzip
-+import cPickle as pickle
-
- def process_cid2code(fp, check_codecs=[]):
-
-@@ -118,9 +120,6 @@
- print 'usage: %s output_dir regname cid2code.txt codecs ...' % argv[0]
- return 100
-
-- def pyname(name):
-- return name.replace('-','_')+'.py'
--
- args = argv[1:]
- if len(args) < 3: return usage()
- (outdir, regname, src) = args[:3]
-@@ -132,22 +131,24 @@
- fp.close()
-
- for (name, cmap) in code2cid.iteritems():
-- fname = pyname(name)
-+ fname = '%s.pickle.gz' % name
- print >>sys.stderr, 'writing %r...' % fname
-- fp = file(os.path.join(outdir, fname), 'w')
-- print >>fp, '#!/usr/bin/env python'
-- print >>fp, '#', fname
-- print >>fp, 'IS_VERTICAL = %r' % is_vertical.get(name, False)
-- print >>fp, 'CODE2CID = %r' % cmap
-+ fp = gzip.open(os.path.join(outdir, fname), 'wb')
-+ data = dict(
-+ IS_VERTICAL=is_vertical.get(name, False),
-+ CODE2CID=cmap,
-+ )
-+ fp.write(pickle.dumps(data))
- fp.close()
-
-- fname = 'TO_UNICODE_'+pyname(regname)
-+ fname = 'to-unicode-%s.pickle.gz' % regname
- print >>sys.stderr, 'writing %r...' % fname
-- fp = file(os.path.join(outdir, fname), 'w')
-- print >>fp, '#!/usr/bin/env python'
-- print >>fp, '#', fname
-- print >>fp, 'CID2UNICHR_H = %r' % cid2unichr_h
-- print >>fp, 'CID2UNICHR_V = %r' % cid2unichr_v
-+ fp = gzip.open(os.path.join(outdir, fname), 'wb')
-+ data = dict(
-+ CID2UNICHR_H=cid2unichr_h,
-+ CID2UNICHR_V=cid2unichr_v,
-+ )
-+ fp.write(pickle.dumps(data))
- fp.close()
-
- return 0
---- /dev/null
-+++ b/pdfminer/cmap/__init__.py
-@@ -0,0 +1 @@
-+#
Deleted: packages/pdfminer/trunk/debian/patches/layout.diff
===================================================================
--- packages/pdfminer/trunk/debian/patches/layout.diff 2010-08-25 23:21:14 UTC (rev 14264)
+++ packages/pdfminer/trunk/debian/patches/layout.diff 2010-08-25 23:33:46 UTC (rev 14265)
@@ -1,18 +0,0 @@
-Description: Fix a bug in layout analysis.
-Origin: backport, http://code.google.com/p/pdfminerr/source/detail?r=226
-Last-Update: 2010-06-13
-
---- a/pdfminer/layout.py
-+++ b/pdfminer/layout.py
-@@ -527,8 +527,9 @@
-
- ## group_boxes
- ##
--def group_boxes(groupfunc, objs, distfunc, debug=0):
-- assert objs
-+def group_boxes(groupfunc, objs0, distfunc, debug=0):
-+ assert objs0
-+ objs = objs0[:]
- while 2 <= len(objs):
- mindist = INF
- minpair = None
Deleted: packages/pdfminer/trunk/debian/patches/nested-tags.diff
===================================================================
--- packages/pdfminer/trunk/debian/patches/nested-tags.diff 2010-08-25 23:21:14 UTC (rev 14264)
+++ packages/pdfminer/trunk/debian/patches/nested-tags.diff 2010-08-25 23:33:46 UTC (rev 14265)
@@ -1,46 +0,0 @@
-Description: Allow extraction of nested tags.
-Origin: backport, http://code.google.com/p/pdfminerr/source/detail?r=226
-Last-Update: 2010-06-13
-
---- a/pdfminer/converter.py
-+++ b/pdfminer/converter.py
-@@ -6,7 +6,7 @@
- from pdfcolor import LITERAL_DEVICE_GRAY, LITERAL_DEVICE_RGB
- from layout import LTContainer, LTPage, LTText, LTLine, LTRect, LTPolygon
- from layout import LTFigure, LTImage, LTChar, LTTextLine, LTTextBox, LTTextGroup
--from utils import apply_matrix_pt, mult_matrix
-+from utils import apply_matrix_pt, mult_matrix, translate_matrix
- from utils import enc, bbox2str, create_bmp
-
-
-@@ -354,7 +354,7 @@
- self.outfp = outfp
- self.codec = codec
- self.pageno = 0
-- self.tag = None
-+ self.stack = []
- return
-
- def render_string(self, textstate, seq):
-@@ -388,16 +388,16 @@
- s = ''.join( ' %s="%s"' % (enc(k), enc(str(v))) for (k,v)
- in sorted(props.iteritems()) )
- self.outfp.write('<%s%s>' % (enc(tag.name), s))
-- self.tag = tag
-+ self.stack.append(tag)
- return
-
- def end_tag(self):
-- assert self.tag
-- self.outfp.write('</%s>' % enc(self.tag.name))
-- self.tag = None
-+ assert self.stack
-+ tag = self.stack.pop(-1)
-+ self.outfp.write('</%s>' % enc(tag.name))
- return
-
- def do_tag(self, tag, props=None):
- self.begin_tag(tag, props)
-- self.tag = None
-+ self.stack.pop(-1)
- return
Deleted: packages/pdfminer/trunk/debian/patches/pdf-testsuite.diff
===================================================================
--- packages/pdfminer/trunk/debian/patches/pdf-testsuite.diff 2010-08-25 23:21:14 UTC (rev 14264)
+++ packages/pdfminer/trunk/debian/patches/pdf-testsuite.diff 2010-08-25 23:33:46 UTC (rev 14265)
@@ -1,53 +0,0 @@
-Description:
- Run tests only on those files that are actually present in the tarball.
- This patch is required because several test documents were removed from the
- Debian source package.
-Author: Jakub Wilk <jwilk at debian.org>
-Forwarded: yes
-Last-Update: 2010-06-08
-
---- a/samples/Makefile
-+++ b/samples/Makefile
-@@ -6,38 +6,10 @@
- PYTHON=python
- PDF2TXT=PYTHONPATH=.. $(PYTHON) ../tools/pdf2txt.py -Dx -p1
-
--HTMLS= \
-- simple1.html \
-- simple2.html \
-- dmca.html \
-- f1040nr.html \
-- i1040nr.html \
-- jo.html \
-- kampo.html \
-- naacl06-shinyama.html \
-- nlp2004slides.html
--
--TEXTS= \
-- simple1.txt \
-- simple2.txt \
-- dmca.txt \
-- f1040nr.txt \
-- i1040nr.txt \
-- jo.txt \
-- kampo.txt \
-- naacl06-shinyama.txt \
-- nlp2004slides.txt
--
--XMLS= \
-- simple1.xml \
-- simple2.xml \
-- dmca.xml \
-- f1040nr.xml \
-- i1040nr.xml \
-- jo.xml \
-- kampo.xml \
-- naacl06-shinyama.xml \
-- nlp2004slides.xml
-+PDFS = $(wildcard *.pdf)
-+HTMLS = $(PDFS:.pdf=.html)
-+TEXTS = $(PDFS:.pdf=.txt)
-+XMLS= $(PDFS:.pdf=.xml)
-
- test: htmls texts xmls
-
Deleted: packages/pdfminer/trunk/debian/patches/psparser-testsuite.diff
===================================================================
--- packages/pdfminer/trunk/debian/patches/psparser-testsuite.diff 2010-08-25 23:21:14 UTC (rev 14264)
+++ packages/pdfminer/trunk/debian/patches/psparser-testsuite.diff 2010-08-25 23:33:46 UTC (rev 14265)
@@ -1,14 +0,0 @@
-Description: Disable test suite for psparser.py, as it is currently broken.
-Author: Jakub Wilk <jwilk at debian.org>
-Forwarded: not-needed
-Last-Update: 2010-06-08
-
---- a/pdfminer/psparser.py
-+++ b/pdfminer/psparser.py
-@@ -648,4 +648,6 @@
- self.assertEqual(objs, self.OBJS)
- return
-
-+ del test_1, test_2
-+
- if __name__ == '__main__': unittest.main()
Modified: packages/pdfminer/trunk/debian/patches/series
===================================================================
--- packages/pdfminer/trunk/debian/patches/series 2010-08-25 23:21:14 UTC (rev 14264)
+++ packages/pdfminer/trunk/debian/patches/series 2010-08-25 23:33:46 UTC (rev 14265)
@@ -1,5 +0,0 @@
-layout.diff
-nested-tags.diff
-pdf-testsuite.diff
-psparser-testsuite.diff
-encoding-data.diff
Modified: packages/pdfminer/trunk/debian/rules
===================================================================
--- packages/pdfminer/trunk/debian/rules 2010-08-25 23:21:14 UTC (rev 14264)
+++ packages/pdfminer/trunk/debian/rules 2010-08-25 23:33:46 UTC (rev 14265)
@@ -1,7 +1,7 @@
#!/usr/bin/make -f
SOURCE_DIR = $(dir $(firstword $(MAKEFILE_LIST)))/..
-UPSTREAM_VERSION = $(shell cd $(SOURCE_DIR) && dpkg-parsechangelog | sed -n -r -e '/^Version: ([0-9.]+)([+]dfsg).*/ { s//\1/; p; q; }')
+UPSTREAM_VERSION = $(shell cd $(SOURCE_DIR) && dpkg-parsechangelog | sed -n -r -e '/^Version: (.+)([+]dfsg).*/ { s//\1/; p; q; }')
.PHONY: override_dh_auto_build
override_dh_auto_build:
More information about the Python-modules-commits
mailing list