[pkg-fso-commits] [SCM] Various useful tools for an FSO installation branch, master, updated. debian/0.git20080812.2-32-gb5a13bb
Jan Luebbe
jluebbe at debian.org
Sun Sep 27 16:11:42 UTC 2009
The following commit has been merged in the master branch:
commit f3262b4cf1b50c73f71c6f0e6774cac434ca326b
Author: Jan Luebbe <jluebbe at debian.org>
Date: Thu Jan 29 13:48:23 2009 +0100
mdbus: add some more dbus types
diff --git a/mickeydbus/mdbus b/mickeydbus/mdbus
index f86517b..3ff9793 100755
--- a/mickeydbus/mdbus
+++ b/mickeydbus/mdbus
@@ -163,10 +163,22 @@ def process_introspection_data(data):
raise IntrospectionParserException('%s: %s' % (e.__class__, e))
import types
+
#----------------------------------------------------------------------------#
def dbus_to_python(v):
#----------------------------------------------------------------------------#
- if isinstance(v, dbus.Int64) or isinstance(v, dbus.Int32) or type(v) == types.IntType:
+ class ObjectPath( object ):
+ def __init__( self, path ):
+ self.path = str( path )
+
+ def __repr__( self ):
+ return "op%s" % repr(self.path)
+
+ if isinstance(v, dbus.Byte) \
+ or isinstance(v, dbus.Int64) \
+ or isinstance(v, dbus.UInt32) \
+ or isinstance(v, dbus.Int32) \
+ or type(v) == types.IntType:
return int(v)
elif isinstance(v, dbus.Double) or type(v) == types.FloatType:
return float(v)
@@ -180,6 +192,8 @@ def dbus_to_python(v):
return tuple(dbus_to_python(x) for x in v)
elif isinstance(v, dbus.Boolean) or type(v) == types.BooleanType:
return bool(v)
+ elif isinstance(v, dbus.ObjectPath) or type(v) == ObjectPath:
+ return ObjectPath(v)
else:
raise TypeError("Can't convert type %s to python object" % type(v))
--
Various useful tools for an FSO installation
More information about the pkg-fso-commits
mailing list