Skip to content
Permalink
Browse files

2to3:

* add fixes
* pyqt fixer: include some QtSql symbols and remove imports
  which only symbol was removed (eg. SIGNAL)
  • Loading branch information
jef-n committed Mar 21, 2016
1 parent d161612 commit d25c253d87441658ee702a2292db768a8b9cc1ad
Showing with 14 additions and 0 deletions.
  1. +14 −0 scripts/qgis_fixes/fix_pyqt.py
@@ -344,6 +344,18 @@
"QSvgGenerator"
]),
],
"PyQt4.QtSql": [
("PyQt.QtSql", [
"QSqlDatabase",
"QSqlQuery",
"QSqlField"
]),
],
"PyQt4.uic": [
("PyQt.uic", [
"loadUiType",
]),
],
"PyQt4": [
("PyQt", [
"QtCore",
@@ -451,6 +463,8 @@ def transform_member(self, node, results):
mod_member.replace(Name(new_name, prefix=pref))
elif new_name == '':
self.cannot_convert(node, "This is an invalid module element")
else:
node.remove()

# Multiple members being imported
else:

1 comment on commit d25c253

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn commented on d25c253 Mar 22, 2016

@jef-n testing this on my machine. I get an error in utils.py importing the configparser library:

ImportError: No module named 'ConfigParser'

Looking at python's documentation (here: https://docs.python.org/2/library/configparser.html), it mentions that the library was renamed from camel case to lowercase (i.e. from ConfigParser to configparser).

If I manually edit utils.py to modify the import to use lower case, it fixes that issue, but then I stumble on another error:

Traceback (most recent call last): File "", line 1, in File "/home/webmaster/dev/cpp/QGIS/bm-qt5/output/python/qgis/utils.py", line 577, in import __builtin__ ImportError: No module named '__builtin__'

Hope this is of help. Keep on the amazing work, and I'll keep trying to help out in the ways I can 😄

Please sign in to comment.
You can’t perform that action at this time.