Skip to content

Comments

Update ExportCommand.py with file name sanitisation#29

Open
gsokoll wants to merge 4 commits intotapnair:masterfrom
gsokoll:master
Open

Update ExportCommand.py with file name sanitisation#29
gsokoll wants to merge 4 commits intotapnair:masterfrom
gsokoll:master

Conversation

@gsokoll
Copy link

@gsokoll gsokoll commented Jan 1, 2022

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

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

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?

@gsokoll
Copy link
Author

gsokoll commented Jan 12, 2022

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.

@ciscoski
Copy link

ciscoski commented Jul 1, 2022

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

@o-gent
Copy link

o-gent commented Aug 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants