[Python-modules-commits] r33798 - in packages/pdfminer/trunk/debian (3 files)

eriol-guest at users.alioth.debian.org eriol-guest at users.alioth.debian.org
Mon Aug 17 00:18:47 UTC 2015


    Date: Monday, August 17, 2015 @ 00:18:46
  Author: eriol-guest
Revision: 33798

Avoid timestamps in gzip-compressed file and use compressionlevel=9 to reduce data size

Added:
  packages/pdfminer/trunk/debian/patches/avoid-timestamped-gzip.patch
Modified:
  packages/pdfminer/trunk/debian/changelog
  packages/pdfminer/trunk/debian/patches/series

Modified: packages/pdfminer/trunk/debian/changelog
===================================================================
--- packages/pdfminer/trunk/debian/changelog	2015-08-16 20:55:00 UTC (rev 33797)
+++ packages/pdfminer/trunk/debian/changelog	2015-08-17 00:18:46 UTC (rev 33798)
@@ -23,6 +23,9 @@
     - Add manpage for latin2ascii.
   * debian/patches/pickle-protocol2.diff
     - Refresh.
+  * debian/patches/avoid-timestamped-gzip.patch
+    - Avoid timestamps in gzip-compressed file and use compressionlevel=9 to
+      reduce data size.
   * debian/python-pdfminer.docs
     - Remove README.txt since not shipped anymore.
   * debian/python-pdfminer.install
@@ -37,7 +40,7 @@
   * debian/watch
     - Use pypi.debian.net redirector.
 
- -- Daniele Tricoli <eriol at mornie.org>  Sun, 16 Aug 2015 17:39:47 +0200
+ -- Daniele Tricoli <eriol at mornie.org>  Mon, 17 Aug 2015 02:14:54 +0200
 
 pdfminer (20110515+dfsg-1) unstable; urgency=low
 

Added: packages/pdfminer/trunk/debian/patches/avoid-timestamped-gzip.patch
===================================================================
--- packages/pdfminer/trunk/debian/patches/avoid-timestamped-gzip.patch	                        (rev 0)
+++ packages/pdfminer/trunk/debian/patches/avoid-timestamped-gzip.patch	2015-08-17 00:18:46 UTC (rev 33798)
@@ -0,0 +1,37 @@
+Description: Avoid timestamps in gzip-compressed file and use 
+ compressionlevel=9 to reduce data size.
+Author: Daniele Tricoli <eriol at mornie.org>
+Forwarded: https://github.com/euske/pdfminer/pull/119
+Last-Update: 2015-08-17
+
+--- a/tools/conv_cmap.py
++++ b/tools/conv_cmap.py
+@@ -180,16 +180,22 @@
+         fname = '%s.pickle.gz' % enc
+         path = os.path.join(outdir, fname)
+         print >>sys.stderr, 'writing: %r...' % path
+-        fp = gzip.open(path, 'wb')
+-        converter.dump_cmap(fp, enc)
+-        fp.close()
++        with open(path, 'wb') as fp:
++            # with statement support for GzipFile is available only from Python
++            # 2.7
++            fgz = gzip.GzipFile('', 'wb', 9, fp, 0.)
++            converter.dump_cmap(fgz, enc)
++            fgz.close()
+ 
+     fname = 'to-unicode-%s.pickle.gz' % regname
+     path = os.path.join(outdir, fname)
+     print >>sys.stderr, 'writing: %r...' % path
+-    fp = gzip.open(path, 'wb')
+-    converter.dump_unicodemap(fp)
+-    fp.close()
++    with open(path, 'wb') as fp:
++        # with statement support for GzipFile is available only from Python
++        # 2.7
++        fgz = gzip.GzipFile('', 'wb', 9, fp, 0.)
++        converter.dump_unicodemap(fgz)
++        fgz.close()
+     return
+ 
+ if __name__ == '__main__': sys.exit(main(sys.argv))

Modified: packages/pdfminer/trunk/debian/patches/series
===================================================================
--- packages/pdfminer/trunk/debian/patches/series	2015-08-16 20:55:00 UTC (rev 33797)
+++ packages/pdfminer/trunk/debian/patches/series	2015-08-17 00:18:46 UTC (rev 33798)
@@ -1,2 +1,3 @@
 python2.diff
 pickle-protocol-2.diff
+avoid-timestamped-gzip.patch




More information about the Python-modules-commits mailing list