Skip to content

Commit a3e717e

Browse files
committed
update pyside to pyside6
1 parent d32ce6a commit a3e717e

File tree

5 files changed

+38
-39
lines changed

5 files changed

+38
-39
lines changed

README.md

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Basic management of keys in the Linux kernel keyring in Python. Also comes with
2121
* [License](#license)
2222

2323

24+
2425
# Description
2526

2627
This is a small library to make use of some functions of the kernel keyring in Python.
@@ -41,56 +42,46 @@ Available functions:
4142

4243
There are many more functions with keys in the kernel keyring (e.g. permissions)
4344
that is needed for proper keymanagement. But for my usecase I just needed the
44-
given simple functionality.
45+
given simple functionality.
46+
47+
:warning: You might need to link your keyrings (e.g. for the testcases using the default keyring)
48+
to have proper permissions.
49+
E.g.:
50+
```sh
51+
$ keyctl link @u @s
52+
```
4553

4654

4755
# Requirements
4856

4957
Python 3.9
50-
```
58+
```sh
5159
$ sudo apt install python3.9
5260
$ python --version
53-
Python 3.9.12
61+
Python 3.9.18
5462
```
5563

5664
pip
57-
```
65+
```sh
5866
$ sudo apt install python3-pip
5967
$ pip --version
60-
pip 22.3.1 from .... (python 3.9)
68+
pip 23.3.2 from .... (python 3.9)
6169
```
6270

6371
The 'keyctl' command
64-
```
72+
```sh
6573
$ sudo apt install keyutils
6674
$ dpkg -s keyutils | grep Version
67-
Version: 1.5.9
75+
Version: 1.6.1
6876
```
6977

70-
For the GUI you also need:
71-
72-
Qt4
78+
If you want to use the GUI, you also need PySide6
7379
```
74-
$ sudo apt install qt4-qmake libqt4-core libqt4-dev
75-
$ qmake-qt4 --version
76-
QMake version 2.01a
77-
Using Qt version 4.8.1 in /usr/lib/x86_64-linux-gnu
80+
$ pip install pyside6
81+
$ python3 -c "import PySide6; print(PySide6.__version__)"
82+
6.6.1
7883
```
7984

80-
PySide
81-
```
82-
$ sudo apt install python-qt4 python3-pyside
83-
$ python3 -c "import PySide; print(PySide.__version__)"
84-
Version: 1.2.2
85-
```
86-
87-
Virtualenv:
88-
If you want to use gui part of this module in a virtualenv you either have to
89-
`(venv)$ pip install pyside` (which takes up to 40min to compile)
90-
or you can link your pyside distro package into your virtualenv like this:
91-
```
92-
$ ln -s /usr/lib/python3/dist-packages/PySide venv/lib/python3.9/site-packages/
93-
```
9485

9586

9687
# Installation
@@ -102,6 +93,7 @@ $ pip install keyctl
10293
Ready to use.
10394

10495

96+
10597
# Usage
10698

10799
## Module
@@ -169,6 +161,7 @@ If you run the integrated tests, your user keyring will be cleared.
169161
Don't do this when you have active keys e.g. for encryption.
170162

171163

164+
172165
# Similar projects
173166

174167
Similar projects you might want to check out:
@@ -177,6 +170,7 @@ Similar projects you might want to check out:
177170
* https://github.com/jdukes/pykeyctl (more complete, direct library wrapper)
178171

179172

173+
180174
# License
181175

182176
GPL-3.0
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# -*- coding: utf-8 -*-
33

44
import os
5-
from PySide.QtUiTools import QUiLoader
6-
from PySide.QtGui import QMainWindow, QDesktopWidget, QTableWidgetItem, QDialog
5+
from PySide6.QtUiTools import QUiLoader
6+
from PySide6.QtWidgets import QMainWindow, QTableWidgetItem, QDialog
7+
from PySide6.QtGui import QGuiApplication
78

89
from keyctl import Key
910

@@ -42,7 +43,7 @@ def __init__(self):
4243
self._refresh_table()
4344

4445
def center_window(self):
45-
coords = QDesktopWidget().availableGeometry().center()
46+
coords = QGuiApplication.primaryScreen().availableGeometry().center()
4647
fg = self.ui.frameGeometry()
4748
fg.moveCenter(coords)
4849
self.ui.move(fg.topLeft())
@@ -67,7 +68,7 @@ def _open_add_dialog(self):
6768
name, content = dialog.get_input()
6869
Key.add(name, content)
6970
else:
70-
print 'ERROR'
71+
print('ERROR')
7172

7273
self._refresh_table()
7374

keyctl/gui/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@
22
# -*- coding: utf-8 -*-
33

44
import sys
5-
from PySide.QtGui import QApplication
5+
from PySide6.QtCore import Qt, QCoreApplication
6+
from PySide6.QtWidgets import QApplication
67

7-
from gui import KeyringApp
8+
from keyctl.gui._gui import KeyringApp
89

910

1011
# -------------------------------------------------------------------
1112

1213

1314
def main():
15+
QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts)
16+
1417
app = QApplication(sys.argv)
1518

1619
window = KeyringApp()
1720
window.ui.show()
1821
window.center_window()
1922
window.activateWindow()
2023

21-
ret = app.exec_()
24+
ret = app.exec()
2225
sys.exit(ret)
2326

2427

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
requires = ["setuptools>=61.0"]
33
build-backend = "setuptools.build_meta"
44

5+
[tool.setuptools.package-data]
6+
keyctl = ["gui/*.ui"]
7+
58
[project]
69
name = "keyctl"
710
version = "0.5rc1"
@@ -22,7 +25,7 @@ classifiers = [
2225
]
2326

2427
[project.optional-dependencies]
25-
gui = ["PyQt4"]
28+
gui = ["PySide6"]
2629

2730
[project.gui-scripts]
2831
keyctlgui = "keyctl.gui:main"

requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
pytest==7.2.1
2-
build==0.10.0
3-
twine==4.0.2
1+
PySide6==6.6.1

0 commit comments

Comments
 (0)