diff --git a/functions.py b/functions.py index 4c6b438..5414223 100644 --- a/functions.py +++ b/functions.py @@ -3,6 +3,12 @@ import subprocess from datetime import datetime +def remove_nonwords(imgname): + filename, ext = os.path.splitext(imgname) # split into filename & extension + filename = re.sub(r'\W', '', filename) # remove nonwoders from filename + return f'{filename}{ext}' # join filename & ext' + + def pandoc(pwd, content, format_in, format_out): # print('HTML content file:', wiki_content_f.name) @@ -95,6 +101,7 @@ def clean_dir(dirfullpath): os.remove(f) def print_colormsg(msg, level): + color_cmd = '' if level == 'fail': color_cmd = Colors.FAIL elif level == 'warning':