[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:48 UTC 2009
The following commit has been merged in the master branch:
commit 6d7f51b5189a00a07d9b88100a565f46fcb62644
Author: Jan Luebbe <jluebbe at debian.org>
Date: Wed Jul 8 12:40:49 2009 +0200
Revert "mdbus: improve object path conversion"
This reverts commit 5d6585d76d91eb20c5f49a02c8bc03d0e9c56247.
diff --git a/mickeydbus/mdbus b/mickeydbus/mdbus
index 728b0c5..00feee0 100755
--- a/mickeydbus/mdbus
+++ b/mickeydbus/mdbus
@@ -166,6 +166,13 @@ def process_introspection_data(data):
#----------------------------------------------------------------------------#
def dbus_to_python(v):
#----------------------------------------------------------------------------#
+ 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.UInt64) \
@@ -177,7 +184,7 @@ def dbus_to_python(v):
return int(v)
elif isinstance(v, dbus.Double) or type(v) == types.FloatType:
return float(v)
- elif isinstance(v, dbus.String) or isinstance(v, dbus.ObjectPath) or type(v) == types.StringType:
+ elif isinstance(v, dbus.String) or type(v) == types.StringType:
return str(v)
elif isinstance(v, dbus.Dictionary) or type(v) == types.DictType:
return dict( (dbus_to_python(k), dbus_to_python(v)) for k,v in v.iteritems() )
@@ -187,6 +194,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