Author: juhliarik Date: Fri Jul 4 13:17:24 2008 New Revision: 48883 URL: http://svn.opensuse.org/viewcvs/yast?rev=48883&view=rev Log: added fix for dictionary Modified: branches/tmp/lslezak/workshop/scr_dbus/yast_service.py Modified: branches/tmp/lslezak/workshop/scr_dbus/yast_service.py URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/scr_dbus/yast_service.py?rev=48883&r1=48882&r2=48883&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/scr_dbus/yast_service.py (original) +++ branches/tmp/lslezak/workshop/scr_dbus/yast_service.py Fri Jul 4 13:17:24 2008 @@ -7,6 +7,7 @@ import dbus import dbus.service import _dbus_bindings +import types ## import function for converting dbus types to classical python types ## it is necessary for python-bindings in yast @@ -53,13 +54,16 @@ value2 = convertDbusTypeToPythonType(var2) if value2 != None and value1 != None: ret = ycp.SCR.Read(ycp.Path(my_path), value1, value2) - elif value1 != None: - ret = ycp.SCR.Read(ycp.Path(my_path), value1) - else: + elif value1 != None and value2 == None: + ret = ycp.SCR.Read(ycp.Path(my_path), value1) + else: ret = ycp.SCR.Read(ycp.Path(my_path)) if ret == None: ret = 'PyNone' - return ret + if isinstance(ret, types.DictionaryType): + return dbus.types.Dictionary(ret, signature='sv') + else: + return ret @dbus.service.method(dbus_interface='org.opensuse.YaST', in_signature='sv', out_signature='v', sender_keyword='caller') @@ -68,7 +72,7 @@ ycp.SCR.DBusCaller(caller) value = convertDbusTypeToPythonType(var) if value != None: - ret = ycp.SCR.Dir(ycp.Path(my_path), value) + ret = ycp.SCR.Dir(ycp.Path(my_path), value) else: ret = ycp.SCR.Dir(ycp.Path(my_path)) if ret == None: -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org