diff options
author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-25 23:47:55 +0000 |
---|---|---|
committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-25 23:47:55 +0000 |
commit | c3c44c2371101c9664a4b61e816c3096d9005c80 (patch) | |
tree | b6911cb3305385ec240ded98db056cd9302f0c8c /bindings/utils.py | |
parent | 928246ba4fedeedea0152939ca981d5fd2145829 (diff) | |
download | lasso-c3c44c2371101c9664a4b61e816c3096d9005c80.tar.gz lasso-c3c44c2371101c9664a4b61e816c3096d9005c80.tar.xz lasso-c3c44c2371101c9664a4b61e816c3096d9005c80.zip |
Bindings: in utils.py, fix is_glist and is_hashtable, make arg_type accept simple string as input instead of triples
Diffstat (limited to 'bindings/utils.py')
-rw-r--r-- | bindings/utils.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bindings/utils.py b/bindings/utils.py index 36c3385a..ea5378ca 100644 --- a/bindings/utils.py +++ b/bindings/utils.py @@ -132,10 +132,10 @@ def is_out(arg): def is_glist(arg): - return re.match('GList\>', var_type(arg)) + return re.match('GList', var_type(arg)) def is_hashtable(arg): - return re.match('GHashTable\>', var_type(arg)) + return re.match('GHashTable', var_type(arg)) def var_type(arg): '''Return the type of variable to store content''' @@ -154,7 +154,10 @@ def ref_name(arg): return arg[1] def arg_type(arg): - return arg[0] + if isinstance(arg, str): + return arg + else: + return arg[0] def arg_name(arg): return arg[1] @@ -179,8 +182,7 @@ def is_const(arg): return bool(re.search(r'\bconst\b', arg_type(arg))) def is_cstring(arg): - if isinstance(arg, tuple): - arg = arg_type(arg) + arg = arg_type(arg) return unconstify(arg) in ('char*','gchar*','guchar*','string','utf8') def is_xml_node(arg): |