Author: juhliarik Date: Fri Jul 4 13:33:02 2008 New Revision: 48886 URL: http://svn.opensuse.org/viewcvs/yast?rev=48886&view=rev Log: added fix for dictionary Modified: branches/tmp/lslezak/workshop/scr_dbus/DBus.py Modified: branches/tmp/lslezak/workshop/scr_dbus/DBus.py URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/scr_dbus/DBus.py?rev=48886&r1=48885&r2=48886&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/scr_dbus/DBus.py (original) +++ branches/tmp/lslezak/workshop/scr_dbus/DBus.py Fri Jul 4 13:33:02 2008 @@ -4,7 +4,7 @@ ## ycp module written in python for using DBus to access to SCR ## this file should be in yast2 module dir (/usr/share/YaST2/modules) ## - +import types import ycp import dbus ## import function for converting dbus types to classical python types @@ -20,7 +20,12 @@ def ReadArg(path, var): if var != None: - return convertDbusTypeToPythonType(yast_SCR.Read(path, var, 'PyNone', dbus_interface='org.opensuse.YaST')) + if isinstance(var, types.DictionaryType): + var_dbus = dbus.types.Dictionary(var, signature='sv') + return convertDbusTypeToPythonType(yast_SCR.Read(path, var_dbus, 'PyNone', dbus_interface='org.opensuse.YaST')) + else: + return convertDbusTypeToPythonType(yast_SCR.Read(path, var, 'PyNone', dbus_interface='org.opensuse.YaST')) + else: return convertDbusTypeToPythonType(yast_SCR.Read(path, 'PyNone', 'PyNone', dbus_interface='org.opensuse.YaST')) @@ -28,10 +33,14 @@ v1 = var1 v2 = var2 if var1 == None: - v1 = 'PyNone' + v1 = 'PyNone' if var2 == None: - v2 = 'PyNone' - convertDbusTypeToPythonType(yast_SCR.Read(path, v1, v2, dbus_interface='org.opensuse.YaST')) + v2 = 'PyNone' + if isinstance(v1, types.DictionaryType): + v1 = dbus.types.Dictionary(v1, signature='sv') + if isinstance(v2, types.DictionaryType): + v2 = dbus.types.Dictionary(v2, signature='sv') + return convertDbusTypeToPythonType(yast_SCR.Read(path, v1, v2, dbus_interface='org.opensuse.YaST')) def Write(path, value): -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org