proof of concept

This commit is contained in:
Bryan Bailey
2019-11-07 10:21:56 -05:00
commit fbcf6769ce
25 changed files with 258 additions and 0 deletions

15
app/panelrip/zipper.py Normal file
View File

@@ -0,0 +1,15 @@
import os
import shutil
import zipfile
basedir = os.path.dirname(__file__)
def create_comic_archive(title, folder):
print('Creating comic archive: {}.cbr'.format(title))
output = shutil.make_archive(title, 'zip', folder)
os.rename(output, os.path.join(folder, title +'.cbr'))
print('Performing folder cleanup...')
for img in os.listdir(folder):
if not img.endswith('.cbr'):
os.remove(os.path.join(folder, img))