Skip to content

Commit c2211ca

Browse files
Merge branch 'main' into release
2 parents 057026b + 1534a6c commit c2211ca

13 files changed

+75
-36
lines changed

setup.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
from setuptools import setup
2-
import sys,os
2+
import sys, os
33

44
setup(
5-
name = 'shm-modbus-gui',
6-
version = '1.0.1',
7-
description = 'gui for shm-modbus',
5+
name='shm-modbus-gui',
6+
version='1.0.2',
7+
description='gui for shm-modbus',
88
license='GPLv3',
9-
author = 'Nikolas Koesling',
10-
packages = ['src'],
9+
author='Nikolas Koesling',
10+
packages=[
11+
'src',
12+
'src.py_ui'
13+
],
1114
package_data={},
12-
install_requires=['pyside6'],
13-
entry_points = {
14-
'console_scripts': [
15-
'shm-modbus-gui=src.main:main']
16-
},
17-
classifiers = ['Programming Language :: Python :: 3.10',
18-
'Operating System :: POSIX',
19-
'License :: GPLv3'],
15+
install_requires=['PySide6==6.2.4'],
16+
entry_points={
17+
'console_scripts':
18+
[
19+
'shm-modbus-gui=src.main:main'
20+
]
21+
},
22+
classifiers=[
23+
'Programming Language :: Python :: 3.10',
24+
'Operating System :: POSIX',
25+
'License :: GPLv3'
26+
],
2027
)

snap/snapcraft.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: shm-modbus-gui
2+
summary: gui for shm-modbus
3+
description: |
4+
QT6 (PySide6) gui for shm-modbus
5+
version: test
6+
base: core22
7+
confinement: devmode
8+
9+
parts:
10+
shm-modbus-gui:
11+
plugin: python
12+
source: .
13+
stage-packages:
14+
- libgl1
15+
- libxkbcommon0
16+
- libegl1
17+
- libfontconfig1
18+
- libpulse0
19+
- libxcb-cursor0
20+
- qt6-base-dev
21+
22+
23+
apps:
24+
shm-modbus-gui:
25+
command: bin/shm-modbus-gui
26+
plugs:
27+
- desktop
28+
- wayland
29+
- x11
30+
environment:
31+
QT_PLUGIN_PATH: "$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/qt6/plugins"

src/MBConfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import re
22
from abc import ABC, abstractmethod
33

4-
import constants
4+
from . import constants
55

66
JSON_KEYS = (("modbus.byte_timeout", float),
77
("modbus.edit_byte_timeout", bool),

src/MBxxOutput.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from PySide6.QtGui import QFontDatabase, QTextCursor
44
from PySide6.QtWidgets import QFileDialog, QMessageBox
55

6-
from py_ui import Ui_MBxxxOutput
6+
from .py_ui import Ui_MBxxxOutput
77

88

99
class MBxxOutput(QtWidgets.QMainWindow, Ui_MBxxxOutput):

src/MainWindow.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
from PySide6.QtGui import QRegularExpressionValidator
55
from PySide6.QtWidgets import QFileDialog, QMessageBox
66

7-
import MBConfig
8-
import SHMTools
9-
from py_ui import Ui_MainWindow
10-
from mbtcp_config import MBTCPConfig
11-
from mbrtu_config import MBRTUConfig
12-
from MBxxOutput import MBxxOutput
13-
import constants
7+
from . import MBConfig
8+
from . import SHMTools
9+
from .py_ui import Ui_MainWindow
10+
from .mbtcp_config import MBTCPConfig
11+
from .mbrtu_config import MBRTUConfig
12+
from .MBxxOutput import MBxxOutput
13+
from . import constants
1414

1515

1616
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):

src/SHMHexdump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from PySide6.QtGui import QFontDatabase, QTextCursor
44
from PySide6.QtWidgets import QMessageBox, QFileDialog
55

6-
from py_ui import Ui_ShmHexdump
6+
from .py_ui import Ui_ShmHexdump
77

88

99
class SHMHexdump(QtWidgets.QMainWindow, Ui_ShmHexdump):

src/SHMRandom.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from PySide6 import QtWidgets, QtCore
22
from PySide6.QtWidgets import QMessageBox
33

4-
from py_ui import Ui_RandomizeShm
4+
from .py_ui import Ui_RandomizeShm
55

66

77
class SHMRandom(QtWidgets.QWidget, Ui_RandomizeShm):
@@ -129,7 +129,8 @@ def on_process_finished(self, exit_code) -> None:
129129
self.active = False
130130
if exit_code != 0:
131131
stderr = bytes(self.process.readAllStandardError()).decode("utf-8")
132-
QMessageBox.warning(self, "Command Failed", f"Execution of command shared-mem-random failed: {stderr}")
132+
QMessageBox.warning(self, "Command Failed",
133+
f"Execution of command shared-mem-random failed (exit code: {exit_code}):\n {stderr}")
133134

134135
def closeEvent(self, event):
135136
super(SHMRandom, self).closeEvent(event)

src/SHMTools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from PySide6.QtCore import QProcess
22

3-
from SHMHexdump import SHMHexdump
4-
from SHMRandom import SHMRandom
3+
from .SHMHexdump import SHMHexdump
4+
from .SHMRandom import SHMRandom
55

66

77
class SHMTools:

src/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.0.1'
1+
__version__ = '1.0.1'

src/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
APP_NAME = "shm-modbus-gui"
2-
VERSION = "1.0.1"
2+
VERSION = "1.0.2"
33

44
NAME_REGEX = r"^(\d|[a-z]|[A-Z]|\.|:|-|_)*$"
55
BYTE_REGEX = (r"(([0-9])|([1-9][0-9])|(1[0-9][0-9])|(2[0-4][0-9])|(25[0-5]))((,{1,2}(([0-9])|([1-9][0-9])|(1[0-9]["

src/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from PySide6 import QtWidgets
55
import argparse
66

7-
from MainWindow import MainWindow
8-
import constants
7+
from .MainWindow import MainWindow
8+
from . import constants
99

1010

1111
def main() -> None:

src/mbrtu_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import json
22
import re
33

4-
import MBConfig
5-
import constants
4+
from . import MBConfig
5+
from . import constants
66

77
JSON_KEYS = (("serial.device", str),
88
("serial.parity", int),

src/mbtcp_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import json
22
import re
33

4-
import constants
5-
import MBConfig
4+
from . import constants
5+
from . import MBConfig
66

77
JSON_KEYS = (("network.connections", int),
88
("network.host", str),

0 commit comments

Comments
 (0)