Add some fun emojis to mkbinder.py

This commit is contained in:
Anthony Wang 2022-01-22 22:36:43 -06:00
parent 81c7f39614
commit 53b7908df5
Signed by: a
GPG key ID: BC96B00AEC5F2D76

View file

@ -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')