# HG changeset patch # User Richard Taylor # Date 1272971335 -3600 # Node ID 54a88b895bcda3df25051d545027f60717ece845 # Parent efe4a967495a0fd12ddf3094aa64d46d781b34c0 apply review comments diff -r efe4a967495a -r 54a88b895bcd sbsv2/raptor/lib/config/winscw.xml --- a/sbsv2/raptor/lib/config/winscw.xml Fri Apr 30 16:52:27 2010 +0100 +++ b/sbsv2/raptor/lib/config/winscw.xml Tue May 04 12:08:55 2010 +0100 @@ -127,7 +127,7 @@ - + @@ -135,16 +135,16 @@ - + - + - + diff -r efe4a967495a -r 54a88b895bcd sbsv2/raptor/python/raptor_api.py --- a/sbsv2/raptor/python/raptor_api.py Fri Apr 30 16:52:27 2010 +0100 +++ b/sbsv2/raptor/python/raptor_api.py Tue May 04 12:08:55 2010 +0100 @@ -19,6 +19,11 @@ # module only, as it is the only programatic interface considered public. The # command line --query option is also implemented using this module. +# constants +ALL = 1 + +# objects + class Reply(object): """object to return values from API calls. """ @@ -103,7 +108,7 @@ This is a convenience method for "lazy" callers. - The return value is also converted into a string. + The return value is also converted into a well-formed XML string. """ if query == "aliases": @@ -128,12 +133,12 @@ """extract all aliases of a given type. the default type is "". - to get all aliases pass type=None + to get all aliases pass type=ALL """ aliases = [] for a in self.__raptor.cache.aliases.values(): - if a.type == type or type == None: + if type == ALL or a.type == type: # copy the members we want to expose aliases.append( Alias(a.name, a.meaning) ) diff -r efe4a967495a -r 54a88b895bcd sbsv2/raptor/test/unit_suite/raptor_api_unit.py --- a/sbsv2/raptor/test/unit_suite/raptor_api_unit.py Fri Apr 30 16:52:27 2010 +0100 +++ b/sbsv2/raptor/test/unit_suite/raptor_api_unit.py Tue May 04 12:08:55 2010 +0100 @@ -39,7 +39,7 @@ self.failUnlessEqual(set(["alias_A","alias_B","s1","s2"]), set(a.name for a in aliases)) - aliases = api.getaliases(None) # ignore type + aliases = api.getaliases(raptor_api.ALL) # ignore type self.failUnlessEqual(len(aliases), 6) aliases = api.getaliases("X") # type == "X"