Skip to content

Commit

Permalink
Merge branch 'py2gtk-dual' into 'py3qt5-dual' to deliver both UI apps
Browse files Browse the repository at this point in the history
  • Loading branch information
jimklimov committed Apr 1, 2022
2 parents e14d1d6 + 9d89327 commit 3130273
Show file tree
Hide file tree
Showing 13 changed files with 2,087 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
path_classifiers:
template:
- exclude: "**/*.py.in"
- exclude: "**/NUT-Monitor.in"
- exclude: "**/NUT-Monitor*.in"

queries:
- exclude: cpp/fixme-comment
Expand All @@ -17,4 +17,4 @@ extraction:
index:
filters:
- include: "**/*.py.in"
- include: "**/NUT-Monitor.in"
- include: "**/NUT-Monitor*.in"
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ refer to this change set (too long in the making) as NUT 2.7.5.

- Added Russian translation for NUT-Monitor GUI client [PR #806]

- Separated NUT-Monitor UI into two applications, NUT-Monitor-py2gtk2 and
NUT-Monitor-py3qt5, suitable for two generations of Python ecosystem
with their great differences [PR #1310]

- Various USB driver families: expanded device-matching with "device" in
addition to "bus" and generic USB fields. This is needed to support
multiple attached devices that seem identical by other fields (e.g.
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2895,6 +2895,7 @@ AC_MSG_NOTICE([Generating templated script files that should be marked executabl
m4_foreach_w([SCRIPTFILE], [
scripts/Aix/nut.init
scripts/HP-UX/postinstall
scripts/python/app/NUT-Monitor-py2gtk2
scripts/python/app/NUT-Monitor-py3qt5
scripts/augeas/gen-nutupsconf-aug.py
scripts/python/module/test_nutclient.py
Expand Down
3 changes: 2 additions & 1 deletion docs/new-clients.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ Python

The PyNUT module, contributed by David Goncalves, can be used for connecting a
Python script to `upsd`. Note that this code (and the accompanying NUT-Monitor
application) is licensed under the GPL v3.
application, later separated into NUT-Monitor-py2gtk2 and NUT-Monitor-py3qt5,
suitable for two generations of Python ecosystem) is licensed under the GPL v3.

The `PyNUTClient` class abstracts the connection to the server. In order to
list the status variables for `ups1` on the local `upsd`, the following
Expand Down
3 changes: 2 additions & 1 deletion docs/nut.dict
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
personal_ws-1.1 en 2869 utf-8
personal_ws-1.1 en 2870 utf-8
AAS
ACFAIL
ACFREQ
Expand Down Expand Up @@ -1831,6 +1831,7 @@ gpg
graphviz
groupadd
groupname
gtk
guardpend
guardpstart
guestimate
Expand Down
4 changes: 2 additions & 2 deletions m4/nut_check_python.m4
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ AC_DEFUN([NUT_CHECK_PYTHON2],
PYTHON2=""
AS_CASE([${nut_with_python2}],
[auto|yes|""], [AC_CHECK_PROGS([PYTHON2], [python2 python], [_python2_runtime])],
[auto|yes|""], [AC_CHECK_PROGS([PYTHON2], [python2 python2.7 python-2.7 python], [_python2_runtime])],
[no], [PYTHON2="no"],
[PYTHON2="${nut_with_python2}"]
)
Expand Down Expand Up @@ -92,7 +92,7 @@ AC_DEFUN([NUT_CHECK_PYTHON3],
PYTHON3=""
AS_CASE([${nut_with_python3}],
[auto|yes|""], [AC_CHECK_PROGS([PYTHON3], [python3 python], [_python3_runtime])],
[auto|yes|""], [AC_CHECK_PROGS([PYTHON3], [python3 python3.9 python-3.9 python3.7 python-3.7 python3.5 python-3.5 python], [_python3_runtime])],
[no], [PYTHON3="no"],
[PYTHON3="${nut_with_python3}"]
)
Expand Down
15 changes: 13 additions & 2 deletions scripts/python/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# Network UPS Tools: data/html

EXTRA_DIST = README \
EXTRA_DIST_PY2GTK2 = \
app/ui/gui-1.3.glade \
app/NUT-Monitor-py2gtk2.in \
app/nut-monitor-py2gtk2.desktop

EXTRA_DIST_PY3QT5 = \
app/ui/aboutdialog1.ui \
app/ui/dialog1.ui \
app/ui/dialog2.ui \
app/ui/window1.ui \
app/NUT-Monitor-py3qt5.in \
app/nut-monitor-py3qt5.desktop

EXTRA_DIST = README \
app/nut-monitor.appdata.xml \
app/nut-monitor-py3qt5.desktop \
app/icons/48x48/nut-monitor.png \
app/icons/64x64/nut-monitor.png \
app/icons/256x256/nut-monitor.png \
Expand All @@ -23,4 +30,8 @@ EXTRA_DIST = README \
module/PyNUT.py.in \
module/test_nutclient.py.in

# TODO: Make py2/py3-only builds, delivered preferred symlinks, etc. optional:
EXTRA_DIST += $(EXTRA_DIST_PY2GTK2)
EXTRA_DIST += $(EXTRA_DIST_PY3QT5)

MAINTAINERCLEANFILES = Makefile.in .dirstamp
14 changes: 11 additions & 3 deletions scripts/python/README
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ David Goncalves, and released under GPL v3.
* "module": this directory contains PyNUT.py, which is a Python abstraction
class to access NUT server(s). You can use it in Python programs to access NUT's
upsd data server in a simple way, without having to know the NUT protocol.
The same module should work for Python 2 and Python 3.

To import it on Python programs you have to use the following (case sensitive) :
'import PyNUT'
Expand All @@ -17,6 +18,9 @@ data from an upsd data server.
To install the PyNUT module on Debian/Ubuntu, copy it to:
/usr/share/python-support/python-pynut/

For quick tests, just make sure its directory is exported in `PYTHONPATH`
environment variable.

This directory also contains test_nutclient.py, which is a PyNUT test program.
For this to be fully functional, you will need to adapt the login, password and
upsname to fit your configuration. A NUT data server should be running for the
Expand All @@ -27,7 +31,11 @@ test program to verify connection and protocol support.
PyNUT class, along with its resources.

To install it, you will either need to keep the files together, or to install:
- NUT-Monitor to /usr/bin, /usr/X11R6/bin/ or something like that,
- *.ui to /usr/share/nut-monitor/,
- Depending on the Python version(s) your system has, put NUT-Monitor-py2gtk2
or NUT-Monitor-py3qt5 to /usr/bin/, /usr/X11R6/bin/ or something like that
(optionally making a simple NUT-Monitor symlink to the preferred version),
- ui/*.glade (for NUT-Monitor-py2gtk2) or ui/*.ui (for NUT-Monitor-py3qt5)
to /usr/share/nut-monitor/,
- nut-monitor.png to something like /usr/share/pixmaps/
- and nut-monitor.desktop to /usr/share/applications
- finally, nut-monitor-py2gtk2.desktop and/or nut-monitor-py3qt5.desktop
(optionally symlinked as nut-monitor.desktop) to /usr/share/applications/
Loading

0 comments on commit 3130273

Please sign in to comment.