Rev 100: Nicely format None and 'bool' object in refs_as_dict in http://bazaar.launchpad.net/~meliae-dev/meliae/trunk

John Arbash Meinel john at arbash-meinel.com
Sun Oct 18 19:37:08 BST 2009


At http://bazaar.launchpad.net/~meliae-dev/meliae/trunk

------------------------------------------------------------
revno: 100
revision-id: john at arbash-meinel.com-20091018183641-kuogpd69cibpysc1
parent: john at arbash-meinel.com-20091018183504-q5perhh3l1xfd1fd
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: trunk
timestamp: Sun 2009-10-18 13:36:41 -0500
message:
  Nicely format None and 'bool' object in refs_as_dict
-------------- next part --------------
=== modified file 'meliae/loader.py'
--- a/meliae/loader.py	2009-10-17 03:01:58 +0000
+++ b/meliae/loader.py	2009-10-18 18:36:41 +0000
@@ -385,8 +385,12 @@
                 key = key.value
             # TODO: We should consider recursing if val is a 'known' type, such
             #       a tuple/dict/etc
-            if val.value is not None:
+            if val.type_str == 'bool':
+                val = (val.value == 'True')
+            elif val.value is not None:
                 val = val.value
+            elif val.type_str == 'NoneType':
+                val = None
             as_dict[key] = val
         return as_dict
 



More information about the bazaar-commits mailing list