projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a header parse function stub
[bertos.git]
/
wizard
/
qvariant_converter_old.py
diff --git
a/wizard/qvariant_converter_old.py
b/wizard/qvariant_converter_old.py
index dbdeb4b4fb245a41922296fd517891aba29083af..33bc6887cfa2ab3e2f0286af11f9bfe8e1eb1237 100644
(file)
--- a/
wizard/qvariant_converter_old.py
+++ b/
wizard/qvariant_converter_old.py
@@
-9,11
+9,18
@@
# Author: Lorenzo Berni <duplo@develer.com>
#
# Author: Lorenzo Berni <duplo@develer.com>
#
+"""
+Awful module for the conversion from python types to qvariant, for make the wizard compatible with older version of pyqt (<= 4.4.3)
+"""
+
from PyQt4.QtCore import *
import pickle
def getString(qvariant):
from PyQt4.QtCore import *
import pickle
def getString(qvariant):
- string = unicode(qvariant.toString())
+ if type(qvariant) == str or type(qvariant) == unicode:
+ string = qvariant
+ else:
+ string = unicode(qvariant.toString())
return string
def convertString(string):
return string
def convertString(string):
@@
-35,11
+42,12
@@
def convertStringList(string_list):
return QVariant(QStringList(result))
def getStringDict(qvariant):
return QVariant(QStringList(result))
def getStringDict(qvariant):
+ a = str(qvariant.toByteArray())
if len(a) == 0:
if len(a) == 0:
- dict_str_
bool
= {}
+ dict_str_
str
= {}
else:
else:
- dict_str_
bool
= pickle.loads(a)
- return dict_str_
bool
+ dict_str_
str
= pickle.loads(a)
+ return dict_str_
str
def convertStringDict(string_dict):
a = pickle.dumps(dict_str_str)
def convertStringDict(string_dict):
a = pickle.dumps(dict_str_str)