Skip to content

Commit

Permalink
Version 1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Feb 2, 2024
1 parent dc74724 commit 29e430d
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 53 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,20 @@ pub rsa4096 2020-10-31 [SC]

## Copyright

- Current version: 1.2.3 (10/10/2023)
- Current version: 1.2.4 (02/02/2024)
- Compatibility: Python 3.3 / 3.4 / 3.5 / 3.6 / 3.7 / 3.8 / 3.9 / 3.10 / 3.11 / 3.12
- Links: [luigifab.fr](https://www.luigifab.fr/python/radexreader) - [github.com](https://github.com/luigifab/python-radexreader) - [pypi.org](https://pypi.org/project/radexreader/)\
[Debian python-radexreader.deb](https://packages.debian.org/python3-radexreader)\
- Links: [luigifab.fr](https://www.luigifab.fr/python/radexreader) - [github.com](https://github.com/luigifab/python-radexreader) - [PyPI](https://pypi.org/project/radexreader/)\
[Arch Linux python-radexreader.zst](https://aur.archlinux.org/packages/python-radexreader)\
[Debian python-radexreader.deb](https://packages.debian.org/python3-radexreader)
*([ITP](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973447),
[RFS](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=974217))*\
[Fedora python-radexreader.rpm](https://src.fedoraproject.org/rpms/python-radexreader)\
[openSUSE python-radexreader.rpm](https://software.opensuse.org/package/python-radexreader)\
[Ubuntu PPA](https://launchpad.net/~luigifab/+archive/ubuntu/packages)

This program is provided under the terms of the **GNU GPLv2+** license.\
If you like, take some of your time to improve some translations, go to https://bit.ly/2HyCCEc.

## Packages in official distros repositories

[![Packages status](https://repology.org/badge/vertical-allrepos/python:radexreader.svg?header=radexreader)](https://repology.org/project/python:radexreader/versions)
43 changes: 43 additions & 0 deletions archlinux/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
pkgname=python-radexreader
pkgver=1.2.4
pkgrel=1
pkgdesc="Reader for the RADEX RD1212 and ONE Geiger counters"
arch=('any')
url='https://github.com/luigifab/python-radexreader'
license=('GPL2')
depends=('python-pyusb' 'python-pyserial')
makedepends=('python-setuptools')
source=("https://github.com/luigifab/python-radexreader/archive/v${pkgver}/python-radexreader-${pkgver}.tar.gz")
md5sums=("...")

prepare() {
cd "$pkgname-$pkgver"
sed -i 's/python3-radexreader /python3-radexreader-zst /g' src/radexreader.py
sed -i 's/\#\!\/usr\/bin\/python3/\#/g' src/radexreader/__init__.py
}

build() {
cd "$pkgname-$pkgver/src"
python setup.py build
}

package() {
cd "$pkgname-$pkgver/src"
python setup.py install --root="${pkgdir}" --optimize=1 --skip-build

mkdir -p "$pkgdir/usr/bin/"
install -pm 755 radexreader.py "$pkgdir/usr/bin/"

mkdir -p "$pkgdir/usr/share/doc/$pkgname/"
install -pm 644 ../README.md "$pkgdir/usr/share/doc/$pkgname/"

mkdir -p "$pkgdir/usr/share/licenses/$pkgname/"
install -pm 644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/"

mkdir -p "$pkgdir/usr/share/man/man1/" "$pkgdir/usr/share/man/fr/man1/"
install -pm 644 ../debian/radexreader.1 "$pkgdir/usr/share/man/man1/$pkgname.1"
install -pm 644 ../debian/radexreader.fr.1 "$pkgdir/usr/share/man/fr/man1/$pkgname.1"

mkdir -p "$pkgdir/usr/lib/udev/rules.d/"
install -pm 644 ../debian/udev "$pkgdir/usr/lib/udev/rules.d/60-$pkgname.rules"
}
4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
python-radexreader (1.2.3-1) experimental; urgency=low
python-radexreader (1.2.4-1) experimental; urgency=low

* Initial Debian package release (Closes: #973447)

-- Fabrice Creuzot <[email protected]> Tue, 10 Oct 2023 20:00:00 +0000
-- Fabrice Creuzot <[email protected]> Fri, 02 Feb 2024 20:00:00 +0000
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Priority: optional
Maintainer: Fabrice Creuzot <[email protected]>
Build-Depends: debhelper-compat (= 13), python3-all, dh-python, dh-exec
Rules-Requires-Root: no
Standards-Version: 4.6.1.0
Standards-Version: 4.6.2
Homepage: https://github.com/luigifab/python-radexreader
Vcs-Browser: https://github.com/luigifab/python-radexreader
Vcs-Git: https://github.com/luigifab/python-radexreader.git
Expand Down
2 changes: 1 addition & 1 deletion debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Source: https://github.com/luigifab/python-radexreader
Upstream-Contact: Fabrice Creuzot <[email protected]>

Files: *
Copyright: 2020-2023 Fabrice Creuzot (luigifab) <[email protected]>
Copyright: 2020-2024 Fabrice Creuzot (luigifab) <[email protected]>
License: GPL-2+

License: GPL-2+
Expand Down
8 changes: 4 additions & 4 deletions debian/deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@


cd "$(dirname "$0")"
version="1.2.3"
version="1.2.4"


rm -rf builder/
mkdir builder
rm -rf builder/*

# copy to a tmp directory
if [ true ]; then
Expand All @@ -31,10 +31,10 @@ fi


# create packages for Debian and Ubuntu
for serie in experimental mantic lunar jammy focal bionic xenial trusty; do
for serie in experimental noble mantic jammy focal bionic xenial trusty; do

if [ $serie = "experimental" ]; then
# for Ubuntu
# copy for Ubuntu
cp -a builder/python-radexreader-$version/ builder/python-radexreader-$version+src/
# Debian only
cd builder/python-radexreader-$version/
Expand Down
19 changes: 12 additions & 7 deletions fedora/python-radexreader.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Pour éviter un Access denied (insufficient permissions), n'oubliez pas
de débrancher l'appareil après l'installation.}

Name: python-radexreader
Version: 1.2.3
Version: 1.2.4
Release: 1%{?dist}
Summary: %{common_summary_en}
Summary(fr): %{common_summary_fr}
Expand Down Expand Up @@ -61,12 +61,14 @@ cd src
cd src
%py3_install
mkdir -p %{buildroot}%{_bindir}/
mkdir -p %{buildroot}/lib/udev/rules.d/
install -pm 755 radexreader.py %{buildroot}%{_bindir}/radexreader

mkdir -p %{buildroot}%{_mandir}/man1/ %{buildroot}%{_mandir}/fr/man1/
install -p -m 755 ../src/radexreader.py %{buildroot}%{_bindir}/radexreader
install -p -m 644 ../debian/radexreader.1 %{buildroot}%{_mandir}/man1/radexreader.1
install -p -m 644 ../debian/radexreader.fr.1 %{buildroot}%{_mandir}/fr/man1/radexreader.1
install -p -m 644 ../debian/udev %{buildroot}/lib/udev/rules.d/60-python3-radexreader.rules
install -pm 644 ../debian/radexreader.1 %{buildroot}%{_mandir}/man1/radexreader.1
install -pm 644 ../debian/radexreader.fr.1 %{buildroot}%{_mandir}/fr/man1/radexreader.1

mkdir -p %{buildroot}/lib/udev/rules.d/
install -pm 644 ../debian/udev %{buildroot}/lib/udev/rules.d/60-%{name}.rules

%files -n python3-radexreader
%license LICENSE
Expand All @@ -76,10 +78,13 @@ install -p -m 644 ../debian/udev %{buildroot}/lib/udev/rules.d/60-python3-radexr
%{_bindir}/radexreader
%{_mandir}/man1/radexreader.1*
%{_mandir}/*/man1/radexreader.1*
/lib/udev/rules.d/60-python3-radexreader.rules
/lib/udev/rules.d/60-%{name}.rules


%changelog
* Fri Feb 02 2024 Fabrice Creuzot <[email protected]> - 1.2.4-1
- New upstream release

* Tue Oct 10 2023 Fabrice Creuzot <[email protected]> - 1.2.3-1
- New upstream release

Expand Down
14 changes: 7 additions & 7 deletions fedora/rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Fedora: configure: error: C compiler cannot create executables? remove and reinstall glibc-devel gcc

cd "$(dirname "$0")"
version="1.2.3"
version="1.2.4"


rm -rf builder/
mkdir -p builder ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
find builder/* ! -name "*$version*.rpm" ! -name "*$version*.gz" -exec rm -rf {} + 2>/dev/null

# copy to a tmp directory
if [ true ]; then
Expand All @@ -20,7 +20,7 @@ else
rm -rf /tmp/$temp/*/builder/ /tmp/$temp/radexreader/__pycache__/

mv /tmp/$temp builder/
cp /usr/share/licenses/linux-firmware/GPL-2 builder/$temp/LICENSE
cp /usr/share/licenses/*-firmware/GPL-2 builder/$temp/LICENSE # * = linux

cd builder/
tar czf $temp.tar.gz $temp
Expand All @@ -32,10 +32,10 @@ fi

# create package (rpm sign https://access.redhat.com/articles/3359321)
rpmbuild -ba python-radexreader.spec
rpm --addsign ~/rpmbuild/RPMS/*/*.rpm
rpm --addsign ~/rpmbuild/SRPMS/*.rpm
mv ~/rpmbuild/RPMS/*/*.rpm builder/
mv ~/rpmbuild/SRPMS/*.rpm builder/
rpm --addsign ~/rpmbuild/RPMS/*/python*radexreader*.rpm
rpm --addsign ~/rpmbuild/SRPMS/python*radexreader*.rpm
mv ~/rpmbuild/RPMS/*/python*radexreader*.rpm builder/
mv ~/rpmbuild/SRPMS/python*radexreader*.rpm builder/
echo "==========================="
rpm --checksig builder/*.rpm
echo "==========================="
Expand Down
15 changes: 9 additions & 6 deletions opensuse/python-radexreader.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-radexreader
Version: 1.2.3
Version: 1.2.4
Release: 0
Summary: Reader for the RADEX RD1212 and ONE Geiger counters
License: GPL-2.0-or-later
Expand Down Expand Up @@ -45,23 +45,23 @@ cd src
mkdir -p %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_mandir}/man1/ %{buildroot}%{_mandir}/fr/man1/
mkdir -p %{buildroot}%{_udevrulesdir}/
install -p -m 755 ../src/radexreader.py %{buildroot}%{_bindir}/radexreader
install -p -m 644 ../debian/radexreader.1 %{buildroot}%{_mandir}/man1/radexreader.1
install -p -m 644 ../debian/radexreader.fr.1 %{buildroot}%{_mandir}/fr/man1/radexreader.1
%python_expand install -p -m 644 ../debian/udev %{buildroot}%{_udevrulesdir}/60-python%{$python_bin_suffix}-radexreader.rules
install -pm 755 radexreader.py %{buildroot}%{_bindir}/radexreader
install -pm 644 ../debian/radexreader.1 %{buildroot}%{_mandir}/man1/radexreader.1
install -pm 644 ../debian/radexreader.fr.1 %{buildroot}%{_mandir}/fr/man1/radexreader.1
%python_clone -a %{buildroot}%{_bindir}/radexreader
%python_clone -a %{buildroot}%{_mandir}/man1/radexreader.1
%python_clone -a %{buildroot}%{_mandir}/fr/man1/radexreader.1
%python_expand install -pm 644 ../debian/udev %{buildroot}%{_udevrulesdir}/60-python%{$python_bin_suffix}-radexreader.rules

%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/radexreader/
%{python_sitelib}/radexreader*egg-info/
%{_udevrulesdir}/60-python%{python_bin_suffix}-radexreader.rules
%python_alternative %{_bindir}/radexreader
%python_alternative %{_mandir}/man1/radexreader.1%{?ext_man}
%python_alternative %{_mandir}/fr/man1/radexreader.1%{?ext_man}
%{_udevrulesdir}/60-python%{python_bin_suffix}-radexreader.rules

%post
%{python_install_alternative radexreader radexreader.1}
Expand All @@ -71,6 +71,9 @@ install -p -m 644 ../debian/radexreader.fr.1 %{buildroot}%{_mandir}/fr/man1/rade


%changelog
* Fri Feb 02 2024 Fabrice Creuzot <[email protected]> - 1.2.4-1
- New upstream release

* Tue Oct 10 2023 Fabrice Creuzot <[email protected]> - 1.2.3-1
- New upstream release

Expand Down
14 changes: 7 additions & 7 deletions opensuse/rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@


cd "$(dirname "$0")"
version="1.2.3"
version="1.2.4"


rm -rf builder/
mkdir -p builder ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
find builder/* ! -name "*$version*.rpm" ! -name "*$version*.gz" -exec rm -rf {} + 2>/dev/null

# copy to a tmp directory
if [ true ]; then
Expand All @@ -20,7 +20,7 @@ else
rm -rf /tmp/$temp/*/builder/ /tmp/$temp/radexreader/__pycache__/

mv /tmp/$temp builder/
cp /usr/share/licenses/kernel-firmware/GPL-2 builder/$temp/LICENSE
cp /usr/share/licenses/*-firmware/GPL-2 builder/$temp/LICENSE # * = kernel

cd builder/
tar czf $temp.tar.gz $temp
Expand All @@ -32,10 +32,10 @@ fi

# create package (rpm sign https://access.redhat.com/articles/3359321)
rpmbuild -ba python-radexreader.spec
rpm --addsign ~/rpmbuild/RPMS/*/*.rpm
rpm --addsign ~/rpmbuild/SRPMS/*.rpm
mv ~/rpmbuild/RPMS/*/*.rpm builder/
mv ~/rpmbuild/SRPMS/*.rpm builder/
rpm --addsign ~/rpmbuild/RPMS/*/python*radexreader*.rpm
rpm --addsign ~/rpmbuild/SRPMS/python*radexreader*.rpm
mv ~/rpmbuild/RPMS/*/python*radexreader*.rpm builder/
mv ~/rpmbuild/SRPMS/python*radexreader*.rpm builder/
echo "==========================="
rpm --checksig builder/*.rpm
echo "==========================="
Expand Down
6 changes: 3 additions & 3 deletions pypi/pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
# Fedora: sudo dnf install python3-devel

cd "$(dirname "$0")"
version="1.2.3"
version="1.2.4"
rm -rf builder/


# copy to a tmp directory
mkdir builder
mkdir builder/radexreader-${version}

# copy to a tmp directory
cp -r ../src/* builder/radexreader-${version}/
cp ../README.md builder/radexreader-${version}/
cp /usr/share/common-licenses/GPL-2 builder/radexreader-${version}/LICENSE
Expand All @@ -30,6 +29,7 @@ sed -i 's/Usage: radexreader /Usage: radexreader.py /g' builder/radexreader-




# create package (https://packaging.python.org/tutorials/packaging-projects/)
cd builder/radexreader-${version}/
python3 -m pip install --user --upgrade setuptools wheel --no-warn-script-location
Expand Down
2 changes: 1 addition & 1 deletion src/radexreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Created L/19/10/2020
# Updated D/08/10/2023
#
# Copyright 2020-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
# Copyright 2020-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
# https://github.com/luigifab/python-radexreader
#
# This program is free software, you can redistribute it or modify
Expand Down
16 changes: 9 additions & 7 deletions src/radexreader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/python3
# -*- coding: utf8 -*-
# Created L/19/10/2020
# Updated S/07/10/2023
# Updated L/01/01/2024
#
# Copyright 2020-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
# Copyright 2020-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
# https://github.com/luigifab/python-radexreader
#
# This program is free software, you can redistribute it or modify
Expand All @@ -27,7 +27,7 @@
import serial
import serial.tools.list_ports

__version__ = '1.2.3'
__version__ = '1.2.4'

class RadexReader():

Expand Down Expand Up @@ -218,11 +218,12 @@ def read(self, last=False):
'time': timestamp,
'interval': interval[hexa[8]]
}
# to get last measure with RD1212v1
if last and self.com == 'RD1212v1':
break

# sort by date
# most recent measure
if last:
return dict({ max(values): values[max(values)] }) if len(values) > 0 else values

# sort measures by date
return dict(sorted(values.items(), key=operator.itemgetter(0)))

def readOne(self):
Expand Down Expand Up @@ -279,3 +280,4 @@ def erase(self):
self.hid_set_report((0x12, 0x12, 0x01, 0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0x3c, 0x84))
elif self.com == 'RD1212v1':
self.hid_set_report((0x12, 0x12, 0x01, 0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0x3c, 0x84))

8 changes: 4 additions & 4 deletions src/setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/python3
# -*- coding: utf8 -*-
# Created L/19/10/2020
# Updated S/07/10/2023
# Updated J/12/10/2023
#
# Copyright 2020-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
# Copyright 2020-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
# https://github.com/luigifab/python-radexreader
#
# This program is free software, you can redistribute it or modify
Expand All @@ -26,7 +26,7 @@
long_description = fh.read().replace('(images/', '(https://raw.githubusercontent.com/luigifab/python-radexreader/master/images/')
setup(
name='radexreader',
version='1.2.3',
version='1.2.4',
description='Python library for the RADEX RD1212 and the RADEX ONE Geiger counters.',
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -40,7 +40,7 @@
except:
setup(
name='radexreader',
version='1.2.3',
version='1.2.4',
description='Python library for the RADEX RD1212 and the RADEX ONE Geiger counters.',
license='GPL 2',
author='Fabrice Creuzot',
Expand Down

0 comments on commit 29e430d

Please sign in to comment.