gurgeh/selfspy — pull request #111 by grandchild (2014-10-17 03:48:47+00:00)
Title: Fix config file loading.

There were several problems with loading the config file.

If the file given with `-c` doesn't exist, the ConfigParser would (wrongfully) throw an exception for not finding a section, when in fact the whole file was missing. This is fixed in b3840ded5196618777100d0e6212c30c304fc375 in *\__init.py\__* as well as in *stats.py*. It now prints the correct error message and `exit(1)`s.

The other bug occurred when loading string list arguments (i.e. periods and dates) from the config file. It would load them as strings with spaces, different from the string lists that the argparse would hand out.
So I in bf6e6d11616c7731fefef4a786f98a1d35dadce2 and b748e44b1e74f7db8a4f43eceecd34a9a3bf8cf0 I changed `make_period()` and `make_time_string()` to take a closer look at the arguments given to them, change them into a single representation and then let them go about their respective businesses.
This has the added benifit (afaic) that you can now declare periods without spaces! (On the command line as well as in the config.) `--back 2h` is now the same and just as valid as `--back 2 h`. Neat :)