spillz / picty

picty helps you manage photos
57 stars 9 forks source link

custom naming scheme #9

Open eephyne opened 9 years ago

eephyne commented 9 years ago

Could it be possible to add the option of custom naming scheme ? either an option to add custom and save them or a blank form to fill everytime is good to me (save them is always better of course but much work also so…) for an examle , I use 2015/04-April/20150429_093621.IMG_20150429_113628.jpg YYYY/mm/YYYYMMDD_HMS.FILENAME (a bit overcomplicated ? nooo).

spillz commented 9 years ago

Yes, that's pretty simple to do. The relevant code is here:

https://github.com/spillz/picty/blob/master/modules/picty/collectiontypes/localstorebin.py#L78

Need to define a few more keys for hour, minute, etc. Then need to make the combobox a combobox with an entry in line 178. Then add some basic error checking on what the user types and some persistence options.

It's on my to-do list. On Jul 29, 2015 5:36 AM, "eephyne" notifications@github.com wrote:

Could it be possible to add the option of custom naming scheme ? either an option to add custom and save them or a blank form to fill everytime is good to me (save them is always better of course but much work also so…) for an examle , I use 2015/04-April/20150429_093621.IMG_20150429_113628.jpg YYYY/mm/YYYYMMDD_HMS.FILENAME (a bit overcomplicated ? nooo).

— Reply to this email directly or view it on GitHub https://github.com/spillz/picty/issues/9.

eephyne commented 9 years ago

ok I think I got it but one question

Why using <> in list to replace them after with ${} and not simply use datetime format ? (https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior).

%Y/%m/%H%M%S.filename is pretty staightforward I think and for those who are not familiar with this , a simple legend above can solve this (in fact you found this system in a lot of software)

spillz commented 9 years ago

The original idea was to support tags and other metadata in addition to dates, which aren't in any spec. So I just went with something that was readable. It can easily be changed. On Jul 29, 2015 9:25 AM, "eephyne" notifications@github.com wrote:

ok I think I got it but one question

Why using <> in list to replace them after with ${} and not simply use datetime format ? ( https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior ).

%Y/%m/%H%M%S.filename is pretty staightforward I think and for those who are not familiar with this , a simple legend above can solve this (in fact you found this system in a lot of software)

— Reply to this email directly or view it on GitHub https://github.com/spillz/picty/issues/9#issuecomment-125951484.

eephyne commented 9 years ago

I just did, its an quick and dirty update but if you want it I can make a request

here the commit https://github.com/eephyne/picty/commit/d67e9ad258827dba68f61ead7644f686f54bf2e5

(I commented the unneeded function)

spillz commented 9 years ago

This is fine as a workaround for your particular case, but doesn't address the problem of providing a flexible naming system. It's good to see you dabbling with the code though!

On Wed, Jul 29, 2015 at 9:59 AM, eephyne notifications@github.com wrote:

I just did, its an quick and dirty update but if you want it I can make a request

here the commit eephyne@d67e9ad https://github.com/eephyne/picty/commit/d67e9ad258827dba68f61ead7644f686f54bf2e5

(I commented the unneeded function)

— Reply to this email directly or view it on GitHub https://github.com/spillz/picty/issues/9#issuecomment-125960977.

eephyne commented 9 years ago

Yeah that's for sure. Where do I need to look to modify the ui (i never touch ui code) and the behavior of the ui (since adding a text field add more complexity to the reading of the naming scheme.

And also where should I look to save the custom fields into config file (I assume there is one).

spillz commented 9 years ago

The relevant UI code is here: https://github.com/spillz/picty/blob/master/modules/picty/collectiontypes/localstorebin.py#L165

On line 178 change ComboBox to ComboBoxEntry

then in get_options and set_options, get_form_data will returns a tuple (index, string value) instead of an int and set_form_data expects a tuple (index, string value) instead of an int.

There are a few ways to save this data, but the simplest is to use load_addon_prefs and save_addon_prefs defined in settings.py (https://github.com/spillz/picty/blob/master/modules/picty/settings.py) you could make those call in the get_form_data/set_form_data methods. There's a bit of logic to handle what to do when the user enters a custom name.

Anyway, I will have more time to look at this in a few days.

PS: Speaking of GUI, at some point I need to move away from Gtk2. But moving to Gtk3 is no simpler than moving to something like Qt or kivy. The Gtk devs really left Gtk2 users out in the cold on that one.

eephyne commented 9 years ago

Yeah I saw the gtk3 issue. Personally I don't care even using a gtk1 ui if its working, I even prefer cli in most case but I understand the need to update the ui with new version coming.