MetricsGrimoire / Bicho

Bicho is a command line based tool used to parse bug/issue tracking systems
http://metricsgrimoire.github.com/Bicho/
GNU General Public License v2.0
68 stars 30 forks source link

Ported Config.py from optparse to argparse #101

Closed brainwane closed 10 years ago

brainwane commented 10 years ago

In this change, I've ported Config.py from using optparse (which is now deprecated) to using argparse.

An OptionParser object used methods:

An OptionGroup object used:

Both of these are replaced by ArgumentParser, which uses:

Additional cleanup in this change:

brainwane commented 10 years ago

OK, just tested this and saw:

./bicho --db-user-out=root --db-password-out=[password] --db-database-out=bicho_test -d 15 -b bg -u "https://bugzilla.libresoft.es/buglist.cgi?product=bicho" Traceback (most recent call last): File "./bicho", line 8, in <module> retval = Bicho.main.main() File "/home/sumanah/test/Bicho/Bicho/main.py", line 45, in main Config.set_config_options(usage) File "/home/sumanah/test/Bicho/Bicho/Config.py", line 150, in set_config_options default='5') File "/usr/lib/python2.7/argparse.py", line 1286, in add_argument raise ValueError('%r is not callable' % (type_func,)) ValueError: 'int' is not callable

So this still needs a little work.

brainwane commented 10 years ago

Relevant mailing list thread.

brainwane commented 10 years ago

OK, I now believe that this pull request is ready to merge. :-)

canasdiaz commented 10 years ago

We're reviewing this change on Monday. Thank you for your contribution.

canasdiaz commented 10 years ago

Successfully tested, thank you for your contribution