From: duplo Date: Mon, 12 Jan 2009 09:51:06 +0000 (+0000) Subject: Renamed qvariant_converter.py in qvariant_converter_new.py X-Git-Tag: 2.1.0~525 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=d21a4bc706f56430c541f1a6908691dd30b3229d;p=bertos.git Renamed qvariant_converter.py in qvariant_converter_new.py git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2157 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/qvariant_converter.py b/wizard/qvariant_converter.py deleted file mode 100644 index b23bb47d..00000000 --- a/wizard/qvariant_converter.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python -# encoding: utf-8 -# -# Copyright 2009 Develer S.r.l. (http://www.develer.com/) -# All rights reserved. -# -# $Id:$ -# -# Author: Lorenzo Berni -# - -from PyQt4.QtCore import * - -def getString(qvariant): - string = unicode(qvariant.toString()) - return string - -def convertString(string): - return QVariant(string) - -def getStringList(qvariant): - string_list = [unicode(string) for string in qvariant.toStringList()] - return string_list - -def convertStringList(string_list): - return QVariant(QStringList(string_list)) - -def getStringDict(qvariant): - dict_str_str = {} - for key, value in qvariant.toMap().items(): - dict_str_str[unicode(key)] = unicode(value.toString()) - return dict_str_str - -def convertStringDict(string_dict): - result_dict = {} - for key, value in string_dict.items(): - result_dict[QString(key)] = QString(value) - return QVariant(result_dict) - -def getBool(qvariant): - return qvariant.toBool() - -def convertBool(boolean): - return QVariant(boolean) - -def getBoolDict(qvariant): - dict_str_bool = {} - for key, value in qvariant.toMap().items(): - dict_str_bool[unicode(key)] = value.toBool() - return dict_str_bool - -def convertBoolDict(dict_str_bool): - result_dict = {} - for key, value in dict_str_bool.items(): - result_dict[QString(key)] = value - return QVariant(result_dict) - -def getDict(qvariant): - dict_str_variant = {} - for key, value in qvariant.toMap().items(): - dict_str_variant[unicode(key)] = value - return dict_str_variant - -def convertDict(dict_str_variant): - result_dict = {} - for key, value in dict_str_variant.items(): - result_dict[QString(key)] = value - return QVariant(result_dict) diff --git a/wizard/qvariant_converter_new.py b/wizard/qvariant_converter_new.py new file mode 100644 index 00000000..b23bb47d --- /dev/null +++ b/wizard/qvariant_converter_new.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python +# encoding: utf-8 +# +# Copyright 2009 Develer S.r.l. (http://www.develer.com/) +# All rights reserved. +# +# $Id:$ +# +# Author: Lorenzo Berni +# + +from PyQt4.QtCore import * + +def getString(qvariant): + string = unicode(qvariant.toString()) + return string + +def convertString(string): + return QVariant(string) + +def getStringList(qvariant): + string_list = [unicode(string) for string in qvariant.toStringList()] + return string_list + +def convertStringList(string_list): + return QVariant(QStringList(string_list)) + +def getStringDict(qvariant): + dict_str_str = {} + for key, value in qvariant.toMap().items(): + dict_str_str[unicode(key)] = unicode(value.toString()) + return dict_str_str + +def convertStringDict(string_dict): + result_dict = {} + for key, value in string_dict.items(): + result_dict[QString(key)] = QString(value) + return QVariant(result_dict) + +def getBool(qvariant): + return qvariant.toBool() + +def convertBool(boolean): + return QVariant(boolean) + +def getBoolDict(qvariant): + dict_str_bool = {} + for key, value in qvariant.toMap().items(): + dict_str_bool[unicode(key)] = value.toBool() + return dict_str_bool + +def convertBoolDict(dict_str_bool): + result_dict = {} + for key, value in dict_str_bool.items(): + result_dict[QString(key)] = value + return QVariant(result_dict) + +def getDict(qvariant): + dict_str_variant = {} + for key, value in qvariant.toMap().items(): + dict_str_variant[unicode(key)] = value + return dict_str_variant + +def convertDict(dict_str_variant): + result_dict = {} + for key, value in dict_str_variant.items(): + result_dict[QString(key)] = value + return QVariant(result_dict)