chriscz / pysorter

A command line utility for organizing files and directories according to regex patterns.
Mozilla Public License 2.0
44 stars 17 forks source link

Add more common filetypes #9

Open chriscz opened 8 years ago

chriscz commented 8 years ago

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

KayvanMazaheri commented 8 years ago

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

chriscz commented 8 years ago

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

sseemayer commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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.