Saturday, December 27, 2014

New Year is approaching

My family and I have tagged “the best pictures of 2014” in our photo collection. Now I noticed that shotwell2blog.py needs some more features: (1) make sure they are sorted by exposure time and (2) optional new output format as sigal_image directives.

The shotwell2blog.py script was included with atelier until now, which was rather nonsense. Now I created a separate project on GitHub for it and removed it from the atelier repo. This is my first single-script project.

And here is the result: http://luc.saffre-rumma.net/blog/2014/1227/

TODO: write some textbetween the pictures, make a separate list of the top 10 because nobody has time to watch 150 photos,…

While doing the above, I stumbled over a discussion about Python string formatting: % vs. .format, and learned about PEP 3101. I didn’t realize until now that this PEP exists. That’s why my projects are full of % string formatting. I’ll do my best to get used to the new notation. Better late than never.

Released atelier version 0.0.9

Two optimizations in atelier (thanks to Mahmoud who fell into these traps):

  • The command fab blog failed when the user had only VISUAL and not EDITOR set. But it seems that “Nowadays, you can leave EDITOR unset or set it to vi -e” (according to andcoz). So I changed atelier.fablib to handle this situation. New atelier.utils.get_visual_editor().

  • The command fab blog failed when the directory for the current year didn’t yet exist. Now it automatically wishes “Happy New Year” and creates both the directory and the default index.rst file for that year (containing the blogger_year directive).