Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run QtPyConvert and 2to3 on repository #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions wacom-gui/help.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/usr/bin/python

from PyQt4 import QtWebKit
from PyQt4 import QtCore, QtGui
from Qt import QtCore, QtWidgets
import sys, os, re

class Help(QtGui.QWidget):
class Help(QtWidgets.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
QtWidgets.QWidget.__init__(self, parent)
self.initUI()

def initUI(self):
Expand All @@ -15,6 +14,6 @@ def initUI(self):
local_url = QtCore.QUrl.fromLocalFile(file_path)
self.browser.load(local_url)

self.mainLayout = QtGui.QHBoxLayout()
self.mainLayout = QtWidgets.QHBoxLayout()
self.mainLayout.addWidget(self.browser)
self.setLayout(self.mainLayout)
188 changes: 94 additions & 94 deletions wacom-gui/hotkeys.py

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions wacom-gui/kde_shortcut.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@

from platform import python_version
if python_version()[0] == '2':
import ConfigParser as configparser
from StringIO import StringIO
import configparser as configparser
from io import StringIO
elif python_version()[0] == '3':
import configparser
from io import StringIO
Expand Down Expand Up @@ -260,9 +260,9 @@ def clear(self):

def read_dict(self, dictionary, source='<dict>'):
self.clear()
for section, opts in dictionary.items():
for section, opts in list(dictionary.items()):
self.add_section(section)
for option, value in opts.items():
for option, value in list(opts.items()):
self.set(section, option, value)

def write(self, fileobj):
Expand Down Expand Up @@ -475,7 +475,7 @@ def _findShortcut(data, name = None, shortcut = None, uuid = None):
False otherwise.
"""
data_pattern = re.compile('Data_\d+(_\d+)*$')
for section, kvdata in data.items():
for section, kvdata in list(data.items()):
if re.match(data_pattern, section):
ident = section.split("_", 1)[1]
shortcut_data = getShortcutData(data, ident)
Expand Down
56 changes: 28 additions & 28 deletions wacom-gui/keystroke.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,73 @@
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
from Qt import QtCore, QtCompat, QtWidgets

try:
_fromUtf8 = QtCore.QString.fromUtf8
_fromUtf8 = str
except AttributeError:
def _fromUtf8(s):
return s

try:
_encoding = QtGui.QApplication.UnicodeUTF8
_encoding = QtWidgets.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
return QtCompat.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
return QtCompat.translate(context, text, disambig)

class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(625, 139)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
Dialog.setSizePolicy(sizePolicy)
self.formLayoutWidget = QtGui.QWidget(Dialog)
self.formLayoutWidget = QtWidgets.QWidget(Dialog)
self.formLayoutWidget.setGeometry(QtCore.QRect(10, 10, 601, 121))
self.formLayoutWidget.setObjectName(_fromUtf8("formLayoutWidget"))
self.formLayout = QtGui.QFormLayout(self.formLayoutWidget)
self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout = QtWidgets.QFormLayout(self.formLayoutWidget)
self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout.setMargin(0)
self.formLayout.setObjectName(_fromUtf8("formLayout"))
self.keystrokesLabel = QtGui.QLabel(self.formLayoutWidget)
self.keystrokesLabel = QtWidgets.QLabel(self.formLayoutWidget)
self.keystrokesLabel.setObjectName(_fromUtf8("keystrokesLabel"))
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.keystrokesLabel)
self.keystrokeinput = QtGui.QLineEdit(self.formLayoutWidget)
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.keystrokesLabel)
self.keystrokeinput = QtWidgets.QLineEdit(self.formLayoutWidget)
self.keystrokeinput.setReadOnly(True)
self.keystrokeinput.setObjectName(_fromUtf8("keystrokeinput"))
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.keystrokeinput)
self.shortcutLabel = QtGui.QLabel(self.formLayoutWidget)
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.keystrokeinput)
self.shortcutLabel = QtWidgets.QLabel(self.formLayoutWidget)
self.shortcutLabel.setObjectName(_fromUtf8("shortcutLabel"))
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.shortcutLabel)
self.shortcutinput = QtGui.QLineEdit(self.formLayoutWidget)
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.shortcutLabel)
self.shortcutinput = QtWidgets.QLineEdit(self.formLayoutWidget)
self.shortcutinput.setObjectName(_fromUtf8("shortcutinput"))
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.shortcutinput)
self.runLabel = QtGui.QLabel(self.formLayoutWidget)
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.shortcutinput)
self.runLabel = QtWidgets.QLabel(self.formLayoutWidget)
self.runLabel.setObjectName(_fromUtf8("runLabel"))
self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.runLabel)
self.runinput = QtGui.QLineEdit(self.formLayoutWidget)
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.runLabel)
self.runinput = QtWidgets.QLineEdit(self.formLayoutWidget)
self.runinput.setObjectName(_fromUtf8("runinput"))
self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.runinput)
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.runinput)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.keystroke = QtGui.QPushButton(self.formLayoutWidget)
self.keystroke = QtWidgets.QPushButton(self.formLayoutWidget)
self.keystroke.setMaximumSize(QtCore.QSize(100, 16777215))
self.keystroke.setObjectName(_fromUtf8("keystroke"))
self.horizontalLayout_2.addWidget(self.keystroke)
self.buttonBox = QtGui.QDialogButtonBox(self.formLayoutWidget)
self.buttonBox = QtWidgets.QDialogButtonBox(self.formLayoutWidget)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.horizontalLayout_2.addWidget(self.buttonBox)
self.formLayout.setLayout(3, QtGui.QFormLayout.FieldRole, self.horizontalLayout_2)
self.formLayout.setLayout(3, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_2)

self.retranslateUi(Dialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject)
self.buttonBox.accepted.connect(Dialog.accept)
self.buttonBox.rejected.connect(Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):
Expand Down
38 changes: 19 additions & 19 deletions wacom-gui/options.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/python

from PyQt4 import QtCore, QtGui
from Qt import QtCore, QtWidgets
import sys
import os
import re


class otherOptions(QtGui.QWidget):
class otherOptions(QtWidgets.QWidget):
def __init__(self, deviceNames, parent=None):
QtGui.QWidget.__init__(self, parent)
QtWidgets.QWidget.__init__(self, parent)
#self.tabletName = tabletName.replace('Pad', 'Pen')
# use the detected device names
self.tabletStylus = deviceNames['stylus']
Expand All @@ -25,7 +25,7 @@ def initUI(self):
self.tabletActiveArea = ""
self.orient = ''
# layout code
self.mainLayout = QtGui.QHBoxLayout()
self.mainLayout = QtWidgets.QHBoxLayout()
self.mainLayout.setAlignment(QtCore.Qt.AlignLeft)
screens = self.screenOptions()
if screens:
Expand All @@ -36,21 +36,21 @@ def initUI(self):


def screenOptions(self):
if QtGui.QDesktopWidget().numScreens() == 1:
if QtWidgets.QDesktopWidget().numScreens() == 1:
self.screenFull = None
return None
groupBox = QtGui.QGroupBox("Screen Area")
groupBox = QtWidgets.QGroupBox("Screen Area")
groupBox.setAlignment(QtCore.Qt.AlignHCenter)
groupBox.setFixedHeight(120)
self.screenGroup = QtGui.QButtonGroup(groupBox)
self.screenGroup = QtWidgets.QButtonGroup(groupBox)
self.displays = []
for x in range(0, QtGui.QDesktopWidget().numScreens()):
self.displays.append(QtGui.QRadioButton("Monitor %d" % x))
self.screenFull = QtGui.QRadioButton("All Monitors")
for x in range(0, QtWidgets.QDesktopWidget().numScreens()):
self.displays.append(QtWidgets.QRadioButton("Monitor %d" % x))
self.screenFull = QtWidgets.QRadioButton("All Monitors")
for screen in self.displays:
self.screenGroup.addButton(screen)
self.screenGroup.addButton(self.screenFull)
screenLayout = QtGui.QVBoxLayout()
screenLayout = QtWidgets.QVBoxLayout()
for screen in self.displays:
screenLayout.addWidget(screen)
screenLayout.addWidget(self.screenFull)
Expand All @@ -61,15 +61,15 @@ def screenOptions(self):


def flipOptions(self):
groupBox = QtGui.QGroupBox("Tablet Orientation")
groupBox = QtWidgets.QGroupBox("Tablet Orientation")
groupBox.setAlignment(QtCore.Qt.AlignHCenter)
groupBox.setFixedHeight(120)
self.tabletFlipGroup = QtGui.QButtonGroup(groupBox)
self.tabletRight = QtGui.QRadioButton("Right-Handed")
self.tabletLeft = QtGui.QRadioButton("Left-Handed")
self.tabletFlipGroup = QtWidgets.QButtonGroup(groupBox)
self.tabletRight = QtWidgets.QRadioButton("Right-Handed")
self.tabletLeft = QtWidgets.QRadioButton("Left-Handed")
self.tabletFlipGroup.addButton(self.tabletRight)
self.tabletFlipGroup.addButton(self.tabletLeft)
flipLayout = QtGui.QVBoxLayout()
flipLayout = QtWidgets.QVBoxLayout()
flipLayout.addWidget(self.tabletRight)
flipLayout.addWidget(self.tabletLeft)
flipLayout.addStretch(1)
Expand Down Expand Up @@ -141,12 +141,12 @@ def getTabletArea(self):
self.screenFull.setChecked(1)
# have to build array then compare... boo
else:
for id in range(0, QtGui.QDesktopWidget().numScreens()):
screen = QtGui.QDesktopWidget().screenGeometry(id)
for id in range(0, QtWidgets.QDesktopWidget().numScreens()):
screen = QtWidgets.QDesktopWidget().screenGeometry(id)
cmd = "xdpyinfo | grep dimensions | awk '{print $2}' | awk -Fx '{print $1, $2}'"
totalResolution = os.popen(cmd).read()
totalResolution = totalResolution.split()
display = [[0 for x in xrange(3)] for x in xrange(3)]
display = [[0 for x in range(3)] for x in range(3)]
display[2][2] = 1.0
display[0][0] = float(screen.width()) / float(totalResolution[0])
# percent of screen height
Expand Down
Loading