aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-09-20 11:40:48 +0200
committerEike Ziller <eike.ziller@qt.io>2018-09-20 10:06:01 +0000
commit2ab5bc0a257bd36f8abc39002d531ec6b15ba196 (patch)
treed615730ac78ac4c8960a29df653233ab80f9c58c
parente7851e24ee7718df74a71a850a6f853e3c3e0e7a (diff)
Fix example extensions for Python 3
Implicit relative imports are no longer allowed and need to be made explicit. Change-Id: Ic4de2d98229149b4d2920057974f895d9600368b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--examples/projects/__init__.py2
-rw-r--r--examples/smallmenu/__init__.py2
-rw-r--r--examples/transform/__init__.py4
-rw-r--r--examples/transform/actions.py3
-rw-r--r--python/extensionmanager/__init__.py3
-rw-r--r--python/extensionmanager/list.py3
6 files changed, 10 insertions, 7 deletions
diff --git a/examples/projects/__init__.py b/examples/projects/__init__.py
index c7919fc..7a17d77 100644
--- a/examples/projects/__init__.py
+++ b/examples/projects/__init__.py
@@ -42,8 +42,8 @@
# project. It also includes a dependency on a plugin
# that can be disabled.
+from . import view
import examples_common
-import view
from PythonExtension import QtCreator
from PySide2.QtCore import QObject, SIGNAL
diff --git a/examples/smallmenu/__init__.py b/examples/smallmenu/__init__.py
index 5dcfef9..f01a8b0 100644
--- a/examples/smallmenu/__init__.py
+++ b/examples/smallmenu/__init__.py
@@ -41,7 +41,7 @@
# This example illustrates the use of action
# containers to create new menus
-from actions import hello, goodbye
+from .actions import hello, goodbye
import examples_common
from PythonExtension import QtCreator
diff --git a/examples/transform/__init__.py b/examples/transform/__init__.py
index c58f4e6..4934e72 100644
--- a/examples/transform/__init__.py
+++ b/examples/transform/__init__.py
@@ -42,9 +42,9 @@
# user supplied function that executes on
# a set of files specified by the user
-import actions
+from . import actions
+from . import ui
import examples_common
-import ui
from PythonExtension import QtCreator
from PySide2.QtCore import QObject, SIGNAL
diff --git a/examples/transform/actions.py b/examples/transform/actions.py
index de54d94..da65b21 100644
--- a/examples/transform/actions.py
+++ b/examples/transform/actions.py
@@ -38,8 +38,9 @@
##
#############################################################################
+from . import ui
+
from PythonExtension import QtCreator
-import ui
# Apply a function to each file
def run(code):
diff --git a/python/extensionmanager/__init__.py b/python/extensionmanager/__init__.py
index 7932118..8588796 100644
--- a/python/extensionmanager/__init__.py
+++ b/python/extensionmanager/__init__.py
@@ -40,10 +40,11 @@
# Entry point of the Python extension
+from .list import *
+
from PythonExtension import QtCreator
from PySide2.QtCore import *
from PySide2.QtWidgets import *
-from list import *
# Actions
def showExtensionList():
diff --git a/python/extensionmanager/list.py b/python/extensionmanager/list.py
index 2996be3..d213c35 100644
--- a/python/extensionmanager/list.py
+++ b/python/extensionmanager/list.py
@@ -40,9 +40,10 @@
# Ui for extension list view
+from . import actions
+
from PySide2 import QtCore, QtWidgets, QtGui
from PythonExtension import PluginInstance as instance
-import actions
class ExtensionList(QtWidgets.QListWidget):
def __init__(self):