Add some fun emojis to mkbinder.py
This commit is contained in:
parent
81c7f39614
commit
53b7908df5
10
mkbinder.py
10
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')
|
||||
|
|
Loading…
Reference in a new issue