diff options
author | Paweł Jastrzębski <pawelj@iosphe.re> | 2019-03-07 11:36:56 +0100 |
---|---|---|
committer | Paweł Jastrzębski <pawelj@iosphe.re> | 2019-03-07 11:36:56 +0100 |
commit | 259800e48b8622233d0a415d7a025f087de7e3cd (patch) | |
tree | 034e08eac3211b45647c6fd3f0248478b52ded4c /kindlecomicconverter/comicarchive.py | |
parent | Merge pull request #306 from ciromattia/dev (diff) | |
download | kcc-259800e48b8622233d0a415d7a025f087de7e3cd.tar.gz kcc-259800e48b8622233d0a415d7a025f087de7e3cd.tar.bz2 kcc-259800e48b8622233d0a415d7a025f087de7e3cd.zip |
Tweaks for Windows binary
Diffstat (limited to 'kindlecomicconverter/comicarchive.py')
-rw-r--r-- | kindlecomicconverter/comicarchive.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kindlecomicconverter/comicarchive.py b/kindlecomicconverter/comicarchive.py index 435a99c..2235a42 100644 --- a/kindlecomicconverter/comicarchive.py +++ b/kindlecomicconverter/comicarchive.py @@ -32,7 +32,7 @@ class ComicArchive: self.type = None if not os.path.isfile(self.filepath): raise OSError('File not found.') - process = Popen('7z l -y -p1 "' + self.filepath + '"', stderr=STDOUT, stdout=PIPE, shell=True) + process = Popen('7z l -y -p1 "' + self.filepath + '"', stderr=STDOUT, stdout=PIPE, stdin=PIPE, shell=True) for line in process.stdout: if b'Type =' in line: self.type = line.rstrip().decode().split(' = ')[1].upper() @@ -47,7 +47,7 @@ class ComicArchive: if not os.path.isdir(targetdir): raise OSError('Target directory don\'t exist.') process = Popen('7z x -y -xr!__MACOSX -xr!.DS_Store -xr!thumbs.db -xr!Thumbs.db -o"' + targetdir + '" "' + - self.filepath + '"', stdout=PIPE, stderr=STDOUT, shell=True) + self.filepath + '"', stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True) process.communicate() if process.returncode != 0: raise OSError('Failed to extract archive.') @@ -64,14 +64,14 @@ class ComicArchive: if self.type in ['RAR', 'RAR5']: raise NotImplementedError process = Popen('7z a -y "' + self.filepath + '" "' + sourcefile + '"', - stdout=PIPE, stderr=STDOUT, shell=True) + stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True) process.communicate() if process.returncode != 0: raise OSError('Failed to add the file.') def extractMetadata(self): process = Popen('7z x -y -so "' + self.filepath + '" ComicInfo.xml', - stdout=PIPE, stderr=STDOUT, shell=True) + stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True) xml = process.communicate() if process.returncode != 0: raise OSError('Failed to extract archive.') |