about summary refs log tree commit diff
path: root/kindlecomicconverter/pdfjpgextract.py
diff options
context:
space:
mode:
authorPaweł Jastrzębski <pawelj@iosphe.re>2017-11-02 10:28:43 +0100
committerPaweł Jastrzębski <pawelj@iosphe.re>2017-11-02 10:28:43 +0100
commita695a4c151765e983126a6037c589aa91452e554 (patch)
tree80303dc7c4f601f2bef69157f711ec8394ce9a80 /kindlecomicconverter/pdfjpgextract.py
parentUpdated build enviroment (diff)
downloadkcc-a695a4c151765e983126a6037c589aa91452e554.tar.gz
kcc-a695a4c151765e983126a6037c589aa91452e554.tar.bz2
kcc-a695a4c151765e983126a6037c589aa91452e554.zip
Code cleanup
Diffstat (limited to 'kindlecomicconverter/pdfjpgextract.py')
-rw-r--r--kindlecomicconverter/pdfjpgextract.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/kindlecomicconverter/pdfjpgextract.py b/kindlecomicconverter/pdfjpgextract.py
index 90d0643..0889eda 100644
--- a/kindlecomicconverter/pdfjpgextract.py
+++ b/kindlecomicconverter/pdfjpgextract.py
@@ -25,17 +25,16 @@ from string import ascii_uppercase, digits
 
 
 class PdfJpgExtract:
-    def __init__(self, origFileName):
-        self.origFileName = origFileName
-        self.filename = os.path.splitext(origFileName)
-        # noinspection PyUnusedLocal
-        self.path = self.filename[0] + "-KCC-" + ''.join(choice(ascii_uppercase + digits) for x in range(3))
+    def __init__(self, fname):
+        self.fname = fname
+        self.filename = os.path.splitext(fname)
+        self.path = self.filename[0] + "-KCC-" + ''.join(choice(ascii_uppercase + digits) for _ in range(3))
 
     def getPath(self):
         return self.path
 
     def extract(self):
-        pdf = open(self.origFileName, "rb").read()
+        pdf = open(self.fname, "rb").read()
         startmark = b"\xff\xd8"
         startfix = 0
         endmark = b"\xff\xd9"