Get some consistency in Controller default args
|Reported by:||atagar||Owned by:||atagar|
A major pain point of using TorCtl was that just about every method could raise an exception. This is 'proper' from a standpoint of correctness but made it a pita to use, causing folks (including me) to make wrapper libraries.
A few of our methods based on arm, like get_info() and get_conf(), have an optional 'default' argument that suppresses exceptions. This is great since it lets us have nice code like...
print "my version is %s" % controller.get_info('version', 'unknown')
... instead of...
try: my_version = controller.get_info('version') except: my_version = 'unknown' print "my version is %s" % my_version
However, as we've added more methods to the Controller class this has largely gone by the wayside. In some cases that makes sense, but we should look over our API to figure out what sort of class-wide conventions we want it to have with respect to defaults.