From 29f901f92a641182372c25a7f6aab4ed1dc912d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Sat, 28 Dec 2013 08:30:37 +0100 Subject: [PATCH] Fixed PDF queue (close #73) --- kcc/pdfjpgextract.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kcc/pdfjpgextract.py b/kcc/pdfjpgextract.py index d9dad09..34ea74d 100644 --- a/kcc/pdfjpgextract.py +++ b/kcc/pdfjpgextract.py @@ -24,13 +24,16 @@ __copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jas __docformat__ = 'restructuredtext en' import os +from random import choice +from string import ascii_uppercase, digits class PdfJpgExtract: def __init__(self, origFileName): self.origFileName = origFileName self.filename = os.path.splitext(origFileName) - self.path = self.filename[0] + "-KCC-TMP" + # noinspection PyUnusedLocal + self.path = self.filename[0] + "-KCC-TMP-" + ''.join(choice(ascii_uppercase + digits) for x in range(3)) def getPath(self): return self.path @@ -63,7 +66,6 @@ class PdfJpgExtract: istart += startfix iend += endfix - print "JPG %d from %d to %d" % (njpg, istart, iend) jpg = pdf[istart:iend] jpgfile = file(self.path + "/jpg%d.jpg" % njpg, "wb") jpgfile.write(jpg)