Skip to content

Commit

Permalink
run 2to3 on source
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 21, 2016
1 parent 8069154 commit 31df84a
Show file tree
Hide file tree
Showing 464 changed files with 2,399 additions and 1,671 deletions.
8 changes: 4 additions & 4 deletions INSTALL
@@ -1,10 +1,10 @@
QGIS
Building QGIS from source - step by step
Thursday June 09, 2016
Wednesday September 21, 2016


Last Updated: Thursday June 09, 2016
Last Change : Thursday June 09, 2016
Last Updated: Wednesday September 21, 2016
Last Change : Wednesday July 27, 2016


1. Introduction
Expand Down Expand Up @@ -356,7 +356,7 @@ If you want to use `ccmake` or other interactive tools, run the following
command in the empty build directory once before starting to use the
interactive tools.

cmake -DENABLE_QT5=ON -DPORT_PLUGINS=ON
cmake

If everything went ok you can finally start to compile. (As usual append a -jX where X is the number of available cores option to make to speed up your build process)

Expand Down
1 change: 0 additions & 1 deletion ci/travis/linux/qt5/install.sh
Expand Up @@ -52,6 +52,5 @@ cmake \
-DWITH_SERVER=ON \
-DWITH_INTERNAL_YAML=OFF \
-DDISABLE_DEPRECATED=ON \
-DPORT_PLUGINS=ON \
-DCXX_EXTRA_FLAGS="$CLANG_WARNINGS" \
..
12 changes: 6 additions & 6 deletions doc/INSTALL.html
Expand Up @@ -5,7 +5,7 @@
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>QGIS</TITLE>

<!-- Included /home/fischer/src/qgis/doc/style.css -->
<!-- Included /home/fischer/src/qgis3/doc/style.css -->
<STYLE TYPE="text/css">
body{ background: white;
color: black;
Expand Down Expand Up @@ -77,13 +77,13 @@
<DIV CLASS="header" ID="header">
<H1>QGIS</H1>
<H2>Building QGIS from source - step by step</H2>
<H3>Thursday June 09, 2016</H3>
<H3>Wednesday September 21, 2016</H3>
</DIV>

<DIV CLASS="body" ID="body">
<P>
Last Updated: Thursday June 09, 2016
Last Change : Thursday June 09, 2016
Last Updated: Wednesday September 21, 2016
Last Change : Wednesday July 27, 2016
</P>
<DIV CLASS="toc">

Expand Down Expand Up @@ -577,7 +577,7 @@ <H3>3.10.1. Install build dependencies</H3>
</P>

<div class="code"><PRE>
cmake -DENABLE_QT5=ON -DPORT_PLUGINS=ON
cmake
</PRE></div>

<P>
Expand Down Expand Up @@ -3016,5 +3016,5 @@ <H1>9. Authors and Acknowledgments</H1>

</DIV>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -\-encoding=utf-8 -o/home/fischer/src/qgis/debian/build-master-pyqtwrapper-qt4/doc/INSTALL.html -t html /home/fischer/src/qgis/doc/INSTALL.t2t -->
<!-- cmdline: txt2tags -\-encoding=utf-8 -o/home/fischer/src/qgis3/debian/build-master-qt5/doc/INSTALL.html -t html /home/fischer/src/qgis3/doc/INSTALL.t2t -->
</BODY></HTML>
2 changes: 1 addition & 1 deletion doc/linux.t2t
Expand Up @@ -235,7 +235,7 @@ command in the empty build directory once before starting to use the
interactive tools.

```
cmake -DENABLE_QT5=ON -DPORT_PLUGINS=ON
cmake
```

If everything went ok you can finally start to compile. (As usual append a -jX where X is the number of available cores option to make to speed up your build process)
Expand Down
3 changes: 2 additions & 1 deletion python/__init__.py
Expand Up @@ -16,6 +16,7 @@
* *
***************************************************************************
"""
from builtins import zip

__author__ = 'Martin Dobias'
__date__ = 'January 2007'
Expand All @@ -31,7 +32,7 @@ def mapping_feature(feature):
geom = feature.geometry()
properties = {}
fields = [field.name() for field in feature.fields()]
properties = dict(zip(fields, feature.attributes()))
properties = dict(list(zip(fields, feature.attributes())))
return {'type': 'Feature',
'properties': properties,
'geometry': geom.__geo_interface__}
Expand Down
4 changes: 3 additions & 1 deletion python/console/console.py
Expand Up @@ -18,6 +18,8 @@
***************************************************************************/
Some portions of code were taken from https://code.google.com/p/pydee/
"""
from builtins import str
from builtins import range
import os

from qgis.PyQt.QtCore import Qt, QTimer, QSettings, QCoreApplication, QSize, QByteArray, QFileInfo, QUrl, QDir
Expand Down Expand Up @@ -410,7 +412,7 @@ def __init__(self, parent=None):
}

self.classMenu = QMenu()
for (title, icon), commands in default_command.items():
for (title, icon), commands in list(default_command.items()):
action = self.classMenu.addAction(icon, title)
action.triggered.connect(partial(self.shell.commandConsole, commands))

Expand Down
7 changes: 5 additions & 2 deletions python/console/console_editor.py
Expand Up @@ -18,6 +18,9 @@
***************************************************************************/
Some portions of code were taken from https://code.google.com/p/pydee/
"""
from __future__ import print_function
from builtins import str
from builtins import range
from qgis.PyQt.QtCore import Qt, QObject, QEvent, QSettings, QCoreApplication, QFileInfo, QSize
from qgis.PyQt.QtGui import QFont, QFontMetrics, QColor, QKeySequence, QCursor
from qgis.PyQt.QtWidgets import QShortcut, QMenu, QApplication, QWidget, QGridLayout, QSpacerItem, QSizePolicy, QFileDialog, QTabWidget, QTreeWidgetItem, QFrame, QLabel, QToolButton, QMessageBox
Expand Down Expand Up @@ -47,7 +50,7 @@ def __init__(self, window, tab, *args):
self.window = window
self.tab = tab
self._handlers = {}
for shortcut, handler in KeyFilter.SHORTCUTS.items():
for shortcut, handler in list(KeyFilter.SHORTCUTS.items()):
modifiers = shortcut[0]
if not isinstance(modifiers, list):
modifiers = [modifiers]
Expand Down Expand Up @@ -1190,7 +1193,7 @@ def listObject(self, tab):
for superClass in class_data.super:
if superClass == 'object':
continue
if isinstance(superClass, basestring):
if isinstance(superClass, str):
superClassName.append(superClass)
else:
superClassName.append(superClass.name)
Expand Down
2 changes: 2 additions & 0 deletions python/console/console_output.py
Expand Up @@ -18,6 +18,8 @@
***************************************************************************/
Some portions of code were taken from https://code.google.com/p/pydee/
"""
from builtins import range
from builtins import object

from qgis.PyQt.QtCore import Qt, QCoreApplication, QSettings
from qgis.PyQt.QtGui import QColor, QFont, QKeySequence
Expand Down
2 changes: 2 additions & 0 deletions python/console/console_sci.py
Expand Up @@ -18,6 +18,8 @@
***************************************************************************/
Some portions of code were taken from https://code.google.com/p/pydee/
"""
from builtins import bytes
from builtins import range

from qgis.PyQt.QtCore import Qt, QSettings, QByteArray, QCoreApplication, QFile, QSize
from qgis.PyQt.QtWidgets import QDialog, QMenu, QShortcut, QApplication
Expand Down
1 change: 1 addition & 0 deletions python/console/console_settings.py
Expand Up @@ -18,6 +18,7 @@
***************************************************************************/
Some portions of code were taken from https://code.google.com/p/pydee/
"""
from builtins import range

from qgis.PyQt.QtCore import QCoreApplication, QSize, QSettings, QFileInfo, Qt
from qgis.PyQt.QtWidgets import QDialog, QFileDialog, QMessageBox, QTableWidgetItem
Expand Down
4 changes: 3 additions & 1 deletion python/core/__init__.py
Expand Up @@ -16,6 +16,8 @@
* *
***************************************************************************
"""
from builtins import str
from builtins import object

__author__ = 'Nathan Woodrow'
__date__ = 'May 2014'
Expand Down Expand Up @@ -156,7 +158,7 @@ def __str__(self):
# Define a `with edit(layer)` statement


class edit:
class edit(object):

def __init__(self, layer):
self.layer = layer
Expand Down
16 changes: 0 additions & 16 deletions python/plugins/CMakeLists.txt
Expand Up @@ -8,17 +8,6 @@

FILE(WRITE ${CMAKE_BINARY_DIR}/stagecount 0)

# The target port-plugins acts as a container for all port-plugin-XXX targets
# Each port-plugin-XXX target will run scripts/2to3 on a plugin and migrate
# Python 3 and Qt 5 code.
SET (PORT_PLUGINS FALSE CACHE BOOL "Determines whether python plugins in staged or installed locations should be migrated to Python 3 and Qt 5")
IF(PORT_PLUGINS)
ADD_CUSTOM_TARGET(port-plugins ALL)
ELSE(PORT_PLUGINS)
ADD_CUSTOM_TARGET(port-plugins)
ENDIF(PORT_PLUGINS)


MACRO (PLUGIN_INSTALL plugin subdir )
FILE(READ ${CMAKE_BINARY_DIR}/stagecount n)
MATH(EXPR n "${n}+1")
Expand All @@ -45,11 +34,6 @@ MACRO (PLUGIN_INSTALL plugin subdir )
ADD_DEPENDENCIES(staged-plugins zzz-${plugin}-stageinstall)
ADD_CUSTOM_TARGET(staged-${plugin} DEPENDS zzz-${plugin}-stageinstall)
FILE(WRITE ${_cmake} "")

ADD_CUSTOM_TARGET(port-plugin-${plugin})
PY_2TO3(port-plugin-${plugin} ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin})
ADD_DEPENDENCIES(port-plugins port-plugin-${plugin})
ADD_DEPENDENCIES(port-plugin-${plugin} staged-${plugin})
ENDIF(NOT TARGET zzz-${plugin}-stageinstall)

ADD_CUSTOM_TARGET(zzz-${plugin}-${n}-depend DEPENDS ${ARGN})
Expand Down
10 changes: 6 additions & 4 deletions python/plugins/GdalTools/GdalTools.py
Expand Up @@ -17,6 +17,8 @@
* *
***************************************************************************/
"""
from builtins import str
from builtins import object
# Import the PyQt and QGIS libraries
from qgis.PyQt.QtCore import QCoreApplication, QSettings, QLocale, QFileInfo, QTranslator
from qgis.PyQt.QtWidgets import QMessageBox, QMenu, QAction
Expand Down Expand Up @@ -53,7 +55,7 @@
raise ImportError(error_str)


class GdalTools:
class GdalTools(object):

def __init__(self, iface):
if not valid:
Expand All @@ -62,9 +64,9 @@ def __init__(self, iface):
# Save reference to the QGIS interface
self.iface = iface
try:
self.QgisVersion = unicode(Qgis.QGIS_VERSION_INT)
self.QgisVersion = str(Qgis.QGIS_VERSION_INT)
except:
self.QgisVersion = unicode(Qgis.qgisVersion)[0]
self.QgisVersion = str(Qgis.qgisVersion)[0]

if Qgis.QGIS_VERSION[0:3] < "1.5":
# For i18n support
Expand Down Expand Up @@ -97,7 +99,7 @@ def initGui(self):
if int(self.QgisVersion) < 1:
QMessageBox.warning(
self.iface.getMainWindow(), "Gdal Tools",
QCoreApplication.translate("GdalTools", "QGIS version detected: ") + unicode(self.QgisVersion) + ".xx\n"
QCoreApplication.translate("GdalTools", "QGIS version detected: ") + str(self.QgisVersion) + ".xx\n"
+ QCoreApplication.translate("GdalTools", "This version of Gdal Tools requires at least QGIS version 1.0.0\nPlugin will not be enabled."))
return None

Expand Down

0 comments on commit 31df84a

Please sign in to comment.