Remove py2 support
Change-Id: Ieeaeb3b8efcae004e94aea6c1d2703c9782a8650 Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/21320 Tested-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de> Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
This commit is contained in:
@ -20,7 +20,6 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from __future__ import print_function
|
||||
from os import path, listdir
|
||||
import sys
|
||||
import inspect
|
||||
|
@ -20,7 +20,6 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from __future__ import division, print_function
|
||||
|
||||
import sys
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
# *****************************************************************************
|
||||
|
||||
|
||||
from __future__ import division, print_function
|
||||
|
||||
from os import path
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from __future__ import division, print_function
|
||||
|
||||
from secop.gui.params import ParameterView
|
||||
from secop.gui.qt import QCheckBox, QDialog, QLabel, \
|
||||
@ -30,20 +29,6 @@ from secop.gui.qt import QCheckBox, QDialog, QLabel, \
|
||||
from secop.gui.util import loadUi
|
||||
from secop.gui.valuewidgets import get_widget
|
||||
|
||||
try:
|
||||
# py2
|
||||
unicode(u'')
|
||||
except NameError:
|
||||
# py3
|
||||
unicode = str # pylint: disable=redefined-builtin
|
||||
|
||||
|
||||
|
||||
#from secop.datatypes import ...
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class CommandDialog(QDialog):
|
||||
def __init__(self, cmdname, argument, parent=None):
|
||||
@ -104,7 +89,7 @@ class ParameterGroup(QWidget):
|
||||
self._row = 0
|
||||
self._widgets = []
|
||||
|
||||
self.paramGroupBox.setTitle('Group: ' + unicode(groupname))
|
||||
self.paramGroupBox.setTitle('Group: ' + str(groupname))
|
||||
self.paramGroupBox.toggled.connect(self.on_toggle_clicked)
|
||||
self.paramGroupBox.setChecked(False)
|
||||
|
||||
@ -293,7 +278,7 @@ class ModuleCtrl(QWidget):
|
||||
label.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
|
||||
|
||||
# make 'display' label
|
||||
view = QLabel(unicode(props[prop]))
|
||||
view = QLabel(str(props[prop]))
|
||||
view.setFont(self.font())
|
||||
view.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
|
||||
view.setWordWrap(True)
|
||||
@ -369,7 +354,7 @@ class ModuleCtrl(QWidget):
|
||||
try:
|
||||
self._node.setParameter(module, parameter, target)
|
||||
except Exception as e:
|
||||
QMessageBox.warning(self.parent(), 'Operation failed', unicode(e))
|
||||
QMessageBox.warning(self.parent(), 'Operation failed', str(e))
|
||||
|
||||
def _updateValue(self, module, parameter, value):
|
||||
if module != self._module:
|
||||
|
@ -21,7 +21,6 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from __future__ import division, print_function
|
||||
|
||||
import json
|
||||
import pprint
|
||||
@ -33,15 +32,6 @@ from secop.gui.qt import QFont, QFontMetrics, QLabel, \
|
||||
QMessageBox, QTextCursor, QWidget, pyqtSlot, toHtmlEscaped
|
||||
from secop.gui.util import loadUi
|
||||
|
||||
try:
|
||||
# py2
|
||||
unicode(u'')
|
||||
except NameError:
|
||||
unicode = str # pylint: disable=redefined-builtin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class NodeCtrl(QWidget):
|
||||
|
||||
@ -334,6 +324,6 @@ class DrivableWidget(ReadableWidget):
|
||||
def on_targetLineEdit_returnPressed(self):
|
||||
self.target_go(self.targetLineEdit.text())
|
||||
|
||||
@pyqtSlot(unicode)
|
||||
@pyqtSlot(str)
|
||||
def on_targetComboBox_activated(self, selection):
|
||||
self.target_go(selection)
|
||||
|
@ -21,7 +21,6 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from secop.datatypes import EnumType, FloatRange, IntRange
|
||||
from secop.gui.qt import QPushButton as QButton
|
||||
@ -30,14 +29,6 @@ from secop.gui.qt import QCheckBox, QLabel, QLineEdit, \
|
||||
from secop.gui.util import loadUi
|
||||
from secop.lib import formatExtendedStack
|
||||
|
||||
try:
|
||||
# py2
|
||||
unicode(u'')
|
||||
except NameError:
|
||||
unicode = str # pylint: disable=redefined-builtin
|
||||
|
||||
|
||||
|
||||
|
||||
class ParameterWidget(QWidget):
|
||||
setRequested = pyqtSignal(str, str, object) # module, parameter, target
|
||||
|
@ -21,19 +21,10 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from __future__ import division, print_function
|
||||
|
||||
from secop.gui.qt import QLabel, QSizePolicy, QWidget
|
||||
from secop.gui.util import loadUi
|
||||
|
||||
try:
|
||||
# py2
|
||||
unicode(u'')
|
||||
except NameError:
|
||||
# py3
|
||||
unicode = str # pylint: disable=redefined-builtin
|
||||
|
||||
|
||||
|
||||
class ParameterView(QWidget):
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
"""Import needed stuff from PyQt4/PyQt5"""
|
||||
|
||||
# pylint: disable=unused-import
|
||||
from __future__ import division, print_function
|
||||
|
||||
import sys
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from __future__ import division, print_function
|
||||
|
||||
from os import path
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from __future__ import division, print_function
|
||||
|
||||
from secop.datatypes import ArrayOf, BLOBType, BoolType, EnumType, \
|
||||
FloatRange, IntRange, StringType, StructOf, TupleOf, TextType
|
||||
|
Reference in New Issue
Block a user