[pkg-fso-commits] [SCM] Various useful tools for an FSO installation branch, master, updated. debian/0.git20080812.2-32-gb5a13bb
Michael 'Mickey' Lauer
mickey at vanille-media.de
Sun Sep 27 16:11:47 UTC 2009
The following commit has been merged in the master branch:
commit 5d6585d76d91eb20c5f49a02c8bc03d0e9c56247
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date: Sat Jun 27 13:44:07 2009 +0200
mdbus: improve object path conversion
diff --git a/mickeydbus/mdbus b/mickeydbus/mdbus
index 00feee0..728b0c5 100755
--- a/mickeydbus/mdbus
+++ b/mickeydbus/mdbus
@@ -166,13 +166,6 @@ 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) \
@@ -184,7 +177,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 type(v) == types.StringType:
+ elif isinstance(v, dbus.String) or isinstance(v, dbus.ObjectPath) 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() )
@@ -194,8 +187,6 @@ 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