Project-Archiver icon indicating copy to clipboard operation
Project-Archiver copied to clipboard

Update ExportCommand.py with file name sanitisation

Open gsokoll opened this issue 3 years ago • 4 comments

Add "slugify" method to sanitise filenames (removing haracters that aren't alphanumerics, underscores, or hyphens, and strip leading and trailing whitespace, dashes, and underscores).

Addresses issues #19 and #20

gsokoll avatar Jan 01 '22 04:01 gsokoll

Just tried this, and it solved issues I was having with tapnair's original script. However, I had to add: import unicodedata import re

Am I missing something here, or did you forget to import the unicodedata and re libraries?

drewnotdrew avatar Jan 11 '22 11:01 drewnotdrew

Sorry, yes I forgot to add those. I originally made changes to the local installation on my PC, and only created the fork and pull request afterwards from memory of what I changed. I will see if I can fix in the pull request.

gsokoll avatar Jan 12 '22 02:01 gsokoll

I would also change so that the folder name is sanitized too.

ciscoski avatar Jul 01 '22 15:07 ciscoski

integrated the closing change and the file name issue here https://github.com/o-gent/Project-Archiver

o-gent avatar Aug 09 '22 16:08 o-gent