Skip to content

Commit

Permalink
Py3/Qt5 for EL8
Browse files Browse the repository at this point in the history
  • Loading branch information
helge000 committed Apr 22, 2022
1 parent 54b7631 commit 913b4ba
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ These instructions will help you get a copy of the project up and running on yor

### Prerequisites
You will require a few packages to get this working on your system:
- PyQt4
- PyQt5

### Installing
- Running from source
Expand Down
21 changes: 10 additions & 11 deletions rpmbuild/wacom-gui.spec
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
%global libwacom_ver 0.32
%global libwacom_ver 2.2.0

Name: wacom-gui
Version: 0.3.0
Release: rc13
Summary: Wacom PyQt4 GUI
Version: 0.4.0
Release: rc1
Summary: Wacom PyQt5 GUI
License: GPLv3
BuildArch: noarch
URL: https://github.com/tb2097/wacom-gui
Requires: PyQt4
Requires: PyQt4-webkit
Requires: qtwebkit
Requires: PyQt5
Requires: libwacom
Requires: xorg-x11-server-utils
Requires: xorg-x11-drv-wacom
Requires: xorg-x11-xkb-utils
Requires: xorg-x11-utils
Requires: dconf
Requires: usbutils
Requires: python
Requires: python3
Requires: systemd
BuildRequires: python
BuildRequires: python3
Source0: %{name}-%{version}-%{release}.tar.gz
# latest libwacom source can be downloaded from https://github.com/linuxwacom/libwacom/releases/latest
# this is just to get the .tablet and svg data
Source1: libwacom-%{libwacom_ver}.tar.bz2
Source1: libwacom-%{libwacom_ver}.tar.xz
Source2: wacom.desktop

%description
Wacom PyQt4 GUI
Wacom PyQt5 GUI

%prep
%setup -q -n wacom-gui-master
Expand Down
4 changes: 2 additions & 2 deletions wacom-gui/hotkeys.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-

from PyQt5.QtCore import *
Expand Down Expand Up @@ -204,7 +204,7 @@ def get_keystroke(self, runcmd):
json.dump(self.keymap_custom, fout, sort_keys=True, indent=4, separators=(',', ": "))

def xsetcmd_gen(self, cmdstring):
strokes = filter(None, re.split('{|}| ', str(cmdstring)))
strokes = [i for i in re.split('{|}| ', str(cmdstring)) if i]
self.cmd = ' '.join(strokes)
xsetcmd = ''
button = False
Expand Down
4 changes: 2 additions & 2 deletions wacom-gui/options.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3

from PyQt5 import QtCore, QtGui
import sys
Expand Down Expand Up @@ -146,7 +146,7 @@ def getTabletArea(self):
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
2 changes: 1 addition & 1 deletion wacom-gui/pad.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TODO: mapping to specific


#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-

from PyQt5.QtCore import *
Expand Down
2 changes: 1 addition & 1 deletion wacom-gui/pressure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3

#from PyQt5.QtGui import QWidget, QPolygonF, QPainter, QPen, QBrush, QColor, \
# QApplication, QIcon, QVBoxLayout, QHBoxLayout, QPushButton, QPainterPath,\
Expand Down
4 changes: 2 additions & 2 deletions wacom-gui/stylus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-

from PyQt5.QtCore import *
Expand Down Expand Up @@ -582,7 +582,7 @@ def update_forced(self):
os.popen(cmd)
cmd = "xsetwacom --get %s area" % (self.sid)
p = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
output = p.communicate()[0].rstrip()
output = str(p.communicate()[0].rstrip())
self.settings['area'] = output
if self.forced.isChecked():
self.settings['forcedproportion'] = 'True'
Expand Down
2 changes: 1 addition & 1 deletion wacom-gui/touch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3

from PyQt5 import QtCore, QtGui
import sys, os, re
Expand Down
6 changes: 3 additions & 3 deletions wacom-gui/wacom-gui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-

from PyQt5.QtCore import *
Expand Down Expand Up @@ -373,7 +373,7 @@ def updateConfigs(self):
write = False
if not self.toolButtons.buttons[(0, 0)].isHidden():
pad = self.pad.get_config()
if pad != self.configs[self.dev][self.config]['pad']['buttons']:
if pad != self.configs[self.dev][self.config]['pad'].get('buttons'):
write = True
self.configs[self.dev][self.config]['pad']['buttons'] = pad
if not self.toolButtons.buttons[(1, 0)].isHidden():
Expand Down Expand Up @@ -504,7 +504,7 @@ def initUI(self):

def addButton(self, label, wid=0, dev=0, dev_id=0, icon=None, isize=48, hide=False):
select = False
idx = self.buttons.__len__() / 4
idx = int(self.buttons.__len__() / 4)
self.buttons[(idx, 0)] = QToolButton()
self.btn_grp.addButton(self.buttons[(idx, 0)], idx)
self.buttons[(idx, 1)] = dev
Expand Down
2 changes: 1 addition & 1 deletion wacom-gui/wacom_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-

############################################
Expand Down

0 comments on commit 913b4ba

Please sign in to comment.