aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmkbinder.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/mkbinder.py b/mkbinder.py
index ffd0440..c588fc1 100755
--- a/mkbinder.py
+++ b/mkbinder.py
@@ -17,7 +17,7 @@ args = parser.parse_args()
for category in os.listdir('Links'):
- print('Examining: ' + category)
+ print('🔍 Examining: ' + category)
os.makedirs(category, exist_ok=True)
section = ''
@@ -29,8 +29,8 @@ for category in os.listdir('Links'):
name = os.path.join(category, section + ' - ' + re.sub(r'(?u)[^-\w.]', '', link[5:]) + '.pdf')
if not os.path.exists(name) or args.force:
- print('Downloading: ' + link[:-1])
- print('Destination: ' + name)
+ print('📲 Downloading: ' + link[:-1])
+ print('💾 Destination: ' + name)
# Time to print!
try:
@@ -39,5 +39,7 @@ for category in os.listdir('Links'):
else:
pdf = weasyprint.HTML(link).write_pdf()
open(name, 'wb').write(pdf)
+ except KeyboardInterrupt:
+ print('😭 Exiting')
except:
- print('Error when printing 😱')
+ print('😱 Error when printing')