quentinsf/icsv2ledger — pull request #17 by afh (2012-10-13 07:37:31+00:00)
Title: Improve handling of ledger_file option

The ledger_file option can be given on the command line or be configured
in .icsv2ledgerrc. When the option is not configred in the .icsv2ledgerrc
file the icsv2ledger errs with:

Traceback (most recent call last):
File "icsv2ledger/icsv2ledger.py", line 357, in
main()
File "icsv2ledger/icsv2ledger.py", line 250, in main
options.ledger_file = config.get(options.account, 'ledger_file')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 610, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'ledger_file' in section: 'giro'

This change remedies the above error and prefers a given commandline option
over a configured option, when both are available.