Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more common filetypes #9

Open
chriscz opened this issue Sep 30, 2016 · 5 comments
Open

Add more common filetypes #9

chriscz opened this issue Sep 30, 2016 · 5 comments

Comments

@chriscz
Copy link
Owner

chriscz commented Sep 30, 2016

The current filetypes.txt contains some really archaic types. Consider updating it to contain
more filetype definitions.

@KayvanMazaheri
Copy link
Contributor

I'm interested.
Is there any kind of convention in naming destination directories?

@chriscz
Copy link
Owner Author

chriscz commented Oct 8, 2016

Hi Kayvan. The only preference I have right now is: lowercase, and use underscores instead of spaces.

chriscz added a commit that referenced this issue Oct 8, 2016
- Add some additional filetypes (issue #9)
@sseemayer
Copy link
Contributor

I'm considering contributing a PR that will hook up the mimetypes module to your rules. Would you be interested in such functionality, or would you prefer more manually-curated file types?

@chriscz
Copy link
Owner Author

chriscz commented Oct 13, 2016

Hi Stefan,

Thanks for your interest in the project!

Hooking up the mimetypes module will be better than the current default behaviour, which is to move
unrecognised files to the other/ directory.

Ideally I would like to group various mimetypes under a common banner, for example zip, tar.gz etc, under archives. But for now just adding mimetypes as the default behaviour would be great.

You can look in the filetypes.py file, near the end of the RULES dictionary, there are two default entries -- one for files and one for directories. Yours should be inserted right before the current default file behaviour.

sseemayer added a commit to sseemayer/pysorter that referenced this issue Oct 13, 2016
Ref chriscz#9

Adds MIME type mappings from the mimetype module as fallback rules when
no other rule can be matched. Also attempts to slightly humanize MIME
types by removing x- from types.
@sseemayer
Copy link
Contributor

Thanks for the quick reply! I hope the PR is to your liking, of course feel free to discard / edit any of my changes to make it fit into your project's vision better.

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

No branches or pull requests

3 participants