From 175b7e29e2e1076add453e1d1dd758ddfcc23811 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 17 Mar 2015 11:10:46 +0100 Subject: tango: map enums to UShort Not nice but will do the trick. --- tango/Uca | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tango/Uca b/tango/Uca index 47f4021..f08ef20 100755 --- a/tango/Uca +++ b/tango/Uca @@ -16,7 +16,7 @@ except ImportError: HAVE_TIFFFILE = False -def get_tango_type(prop): +def get_tango_type(obj_type): mapping = { GObject.TYPE_BOOLEAN: PyTango.CmdArgType.DevBoolean, GObject.TYPE_CHAR: PyTango.CmdArgType.DevUChar, @@ -27,9 +27,16 @@ def get_tango_type(prop): GObject.TYPE_LONG: PyTango.CmdArgType.DevLong, GObject.TYPE_DOUBLE: PyTango.CmdArgType.DevDouble, GObject.TYPE_STRING: PyTango.CmdArgType.DevString, + GObject.TYPE_ENUM: PyTango.CmdArgType.DevShort, } - return mapping.get(prop, None) + tango_type = mapping.get(obj_type, None) + + if tango_type is not None: + return tango_type + + if obj_type.is_a(GObject.TYPE_ENUM): + return PyTango.CmdArgType.DevUShort def get_tango_write_type(prop): -- cgit v1.2.3