From 53b7908df5fc664264a0265e76408cef91dc77aa Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sat, 22 Jan 2022 22:36:43 -0600 Subject: Add some fun emojis to mkbinder.py --- mkbinder.py | 10 ++++++---- 1 file 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') -- cgit v1.2.3-70-g09d2