Anomareh/mynt — pull request #28 by justinvanwinkle (2012-09-06 18:33:04+00:00)
Title: Awesome tool, here are some fixups.

Would you be interested in adding me as a committer? I intend to continue development of this as a fork, but there is no reason we can't share improvements.

These commits do 3 things:
1. Bring code more in line with pep8. I'll make it fully pep8 in the next pass.
2. Fix string interpolation when using the logging module. The best practice is to do:
logger.debug('here is a thing %s', thing)
rather than doing the interpolation beforehand. I think this is so any interpolation errors are trapped in the module rather than being a potential new source of issues.
3. Fix the use of mutable default values.

It is very dangerous to do:
def function(x={}):
...

The reason is that the dictionary created there is part of the function definition.

Here is an example:

In [1]: def printandreturn(d={}):
...: print d
...: return d
...:

In [2]: x = printandreturn()
{}

In [3]: x['ohno'] = 'oh my'

In [4]: printandreturn()
{'ohno': 'oh my'}
Out[4]: {'ohno': 'oh my'}

Otherwise, I chose this static blog generator because it was so well thought out and implemented. Thanks for open sourcing this!