forked from platypush/platypush
Reviewed-on: platypush/platypush#328
This commit is contained in:
commit
fe5158d0ca
83 changed files with 535 additions and 168 deletions
201
.drone.yml
201
.drone.yml
|
@ -273,7 +273,6 @@ steps:
|
|||
environment:
|
||||
DEB_VERSION: stable
|
||||
WORKDIR: /tmp/workdir
|
||||
STABLE_PKG_NAME: platypush
|
||||
PKG_NAME: platypush
|
||||
S3_URL: s3://platypush-pkg/apt
|
||||
AWS_ENDPOINT_URL: https://s3.nl-ams.scw.cloud
|
||||
|
@ -368,7 +367,6 @@ steps:
|
|||
environment:
|
||||
DEB_VERSION: oldstable
|
||||
WORKDIR: /tmp/workdir
|
||||
STABLE_PKG_NAME: platypush
|
||||
PKG_NAME: platypush
|
||||
S3_URL: s3://platypush-pkg/apt
|
||||
AWS_ENDPOINT_URL: https://s3.nl-ams.scw.cloud
|
||||
|
@ -576,6 +574,202 @@ steps:
|
|||
cat "$file" | gpg -q --default-key "$PGP_KEYID" -abs --clearsign > "$dirname/InRelease"
|
||||
done
|
||||
|
||||
###
|
||||
### Update the RPM (stable) packages
|
||||
###
|
||||
|
||||
- name: update-rpm-repo
|
||||
image: fedora
|
||||
privileged: true # Required to use the FUSE module for s3fs
|
||||
environment:
|
||||
RPM_VERSION: stable
|
||||
WORKDIR: /tmp/workdir
|
||||
PKG_NAME: platypush
|
||||
S3_BUCKET: platypush-pkg
|
||||
BUCKET_MNT: /mnt/s3
|
||||
AWS_ENDPOINT_URL: https://s3.nl-ams.scw.cloud
|
||||
AWS_DEFAULT_REGION: nl-ams
|
||||
AWS_ACCESS_KEY_ID:
|
||||
from_secret: aws_access_key_id
|
||||
AWS_SECRET_ACCESS_KEY:
|
||||
from_secret: aws_secret_access_key
|
||||
PGP_PUBKEY:
|
||||
from_secret: rpm_pgp_pub_key
|
||||
PGP_PRIVKEY:
|
||||
from_secret: rpm_pgp_priv_key
|
||||
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
|
||||
depends_on:
|
||||
- build-ui
|
||||
|
||||
commands:
|
||||
- echo "-- Installing dependencies"
|
||||
- yum install -y createrepo rpm-build rpm-sign gpg wget yum-utils git python python-pip s3fs-fuse
|
||||
|
||||
- echo "-- Copying source directory"
|
||||
- mkdir -p "$WORKDIR"
|
||||
- export SRCDIR="$WORKDIR/src"
|
||||
- cp -r "$PWD" "$SRCDIR"
|
||||
- cd "$SRCDIR"
|
||||
|
||||
- echo "-- Mounting the S3 bucket"
|
||||
- mkdir -p "$BUCKET_MNT"
|
||||
- s3fs "$S3_BUCKET" "$BUCKET_MNT" -o url="$AWS_ENDPOINT_URL"
|
||||
- export RPM_ROOT="$BUCKET_MNT/rpm"
|
||||
- mkdir -p "$RPM_ROOT"
|
||||
|
||||
- echo "--- Parsing metadata"
|
||||
- git config --global --add safe.directory $PWD
|
||||
- git pull --rebase origin master --tags
|
||||
- export VERSION=$(python3 setup.py --version)
|
||||
- export RELNUM=$(git log --pretty=oneline HEAD...v$VERSION | wc -l)
|
||||
- export SPECFILE="$WORKDIR/$PKG_NAME.spec"
|
||||
- export BUILD_DIR="$WORKDIR/build"
|
||||
- export TMP_RPM_ROOT="$WORKDIR/repo"
|
||||
- export SRC_URL="https://git.platypush.tech/platypush/platypush/archive/master.tar.gz"
|
||||
|
||||
- echo "--- Creating git package spec"
|
||||
- |
|
||||
cat <<EOF > $SPECFILE
|
||||
Summary: Universal command executor and automation hub.
|
||||
Name: $PKG_NAME-git
|
||||
Version: $VERSION
|
||||
Release: $RELNUM
|
||||
URL: https://platypush.tech
|
||||
Group: System
|
||||
License: MIT
|
||||
Packager: Fabio Manganiello <fabio@platypush.tech>
|
||||
Source: $SRC_URL
|
||||
Requires: $(cat platypush/install/requirements/fedora.txt | tr '\n' ' ')
|
||||
Conflicts: $PKG_NAME
|
||||
Prefix: %{_prefix}
|
||||
BuildRoot: %{_tmppath}/%{name}-root
|
||||
|
||||
%description
|
||||
Universal command executor and automation hub.
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}/
|
||||
cp -r "$BUILD_DIR"/* %{buildroot}/
|
||||
|
||||
%clean
|
||||
|
||||
%files
|
||||
/usr/bin/*
|
||||
/usr/lib/python$(python3 --version | awk '{print $2}' | cut -d. -f 1,2)/site-packages/platypush
|
||||
/usr/lib/python$(python3 --version | awk '{print $2}' | cut -d. -f 1,2)/site-packages/platypush-$VERSION.dist-info
|
||||
|
||||
%changelog
|
||||
* $(date +'%a %b %d %Y') admin <admin@platypush.tech>
|
||||
- [Automatic] Release $VERSION-$RELNUM
|
||||
EOF
|
||||
|
||||
- echo "--- Building git package"
|
||||
- mkdir -p "$BUILD_DIR"
|
||||
- pip install --prefix="$BUILD_DIR/usr" --no-cache --no-deps .
|
||||
- rpmbuild --target "noarch" -bb "$SPECFILE"
|
||||
|
||||
- echo "--- Copying the new RPM package"
|
||||
- mkdir -p "$TMP_RPM_ROOT"
|
||||
- cp "$HOME/rpmbuild/RPMS/noarch/$PKG_NAME-git-$VERSION-$RELNUM.noarch.rpm" "$TMP_RPM_ROOT"
|
||||
|
||||
- echo "--- Checking the latest released stable version"
|
||||
- export LATEST_STABLE_PKG=$(ls -rt "$RPM_ROOT/$PKG_NAME"*.rpm 2>/dev/null | grep -v "$PKG_NAME-git" | tail -1)
|
||||
- |
|
||||
if [ -z "$LATEST_STABLE_PKG" ]; then
|
||||
# If not stable release is available, then create one
|
||||
export UPDATE_STABLE_PKG=1
|
||||
else
|
||||
# Otherwise, create a new release if the reported version on the repo is different
|
||||
# from the latest released version.
|
||||
export LATEST_STABLE_VERSION=$(basename $LATEST_STABLE_PKG | cut -d- -f 2)
|
||||
if [ "$VERSION" != "$LATEST_STABLE_VERSION" ]; then
|
||||
export UPDATE_STABLE_PKG=1
|
||||
else
|
||||
# If the version has remained the same, then simply copy the existing RPM to the
|
||||
# new repository directory.
|
||||
echo "Copying the existing release $LATEST_STABLE_VERSION to the new repository"
|
||||
cp "$LATEST_STABLE_PKG" "$TMP_RPM_ROOT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# If a new stable release is required, build another RPM
|
||||
- |
|
||||
if [ -n "$UPDATE_STABLE_PKG" ]; then
|
||||
export RELNUM=1
|
||||
export SRC_URL="https://git.platypush.tech/platypush/platypush/archive/v$VERSION.tar.gz"
|
||||
|
||||
cat <<EOF > $SPECFILE
|
||||
Summary: Universal command executor and automation hub.
|
||||
Name: $PKG_NAME
|
||||
Version: $VERSION
|
||||
Release: $RELNUM
|
||||
URL: https://platypush.tech
|
||||
Group: System
|
||||
License: MIT
|
||||
Packager: Fabio Manganiello <fabio@platypush.tech>
|
||||
Source: $SRC_URL
|
||||
Requires: $(cat platypush/install/requirements/fedora.txt | tr '\n' ' ')
|
||||
Conflicts: $PKG_NAME-git
|
||||
Prefix: %{_prefix}
|
||||
BuildRoot: %{_tmppath}/%{name}-root
|
||||
|
||||
%description
|
||||
Universal command executor and automation hub.
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}/
|
||||
cp -r "$BUILD_DIR"/* %{buildroot}/
|
||||
|
||||
%clean
|
||||
|
||||
%files
|
||||
/usr/bin/*
|
||||
/usr/lib/python$(python3 --version | awk '{print $2}' | cut -d. -f 1,2)/site-packages/platypush
|
||||
/usr/lib/python$(python3 --version | awk '{print $2}' | cut -d. -f 1,2)/site-packages/platypush-$VERSION.dist-info
|
||||
|
||||
%changelog
|
||||
* $(date +'%a %b %d %Y') admin <admin@platypush.tech>
|
||||
- [Automatic] Release $VERSION-$RELNUM
|
||||
EOF
|
||||
|
||||
echo "--- Building package for stable release $VERSION"
|
||||
rpmbuild --target "noarch" -bb "$SPECFILE"
|
||||
cp "$HOME/rpmbuild/RPMS/noarch/$PKG_NAME-$VERSION-$RELNUM.noarch.rpm" "$TMP_RPM_ROOT"
|
||||
fi
|
||||
|
||||
- echo "--- Importing the repository keys"
|
||||
- |
|
||||
cat <<EOF | gpg --import --armor
|
||||
$PGP_PRIVKEY
|
||||
EOF
|
||||
|
||||
- export PGP_KEYID=$(echo "$PGP_PUBKEY" | gpg --with-colons --import-options show-only --import --fingerprint | grep -e '^fpr:' | head -1 | awk -F ':' '{print $(NF - 1)}')
|
||||
- cat <<EOF > $HOME/.rpmmacros
|
||||
%signature gpg
|
||||
%_gpg_name $PGP_KEYID
|
||||
EOF
|
||||
|
||||
- echo "--- Signing the new RPM packages"
|
||||
- rpm --addsign "$TMP_RPM_ROOT"/*.rpm
|
||||
|
||||
- echo "--- Creating a new copy of the RPM repository"
|
||||
- createrepo "$TMP_RPM_ROOT"
|
||||
- gpg --detach-sign --armor "$TMP_RPM_ROOT/repodata/repomd.xml"
|
||||
|
||||
- echo "--- Updating the S3 bucket"
|
||||
- export NEW_RPM_ROOT="$BUCKET_MNT/rpm_new"
|
||||
- export OLD_RPM_ROOT="$BUCKET_MNT/rpm_old"
|
||||
- mv "$TMP_RPM_ROOT" "$NEW_RPM_ROOT"
|
||||
- mv "$RPM_ROOT" "$OLD_TMP_ROOT"
|
||||
- mv "$NEW_RPM_ROOT" "$RPM_ROOT"
|
||||
- rm -rf "$OLD_TMP_ROOT"
|
||||
|
||||
###
|
||||
### Updates the pip package upon new releases
|
||||
###
|
||||
|
@ -614,10 +808,10 @@ steps:
|
|||
- master
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
|
||||
depends_on:
|
||||
- update-arch-packages
|
||||
- update-rpm-repo
|
||||
- update-apt-repo
|
||||
|
||||
commands:
|
||||
|
@ -639,7 +833,6 @@ steps:
|
|||
|
||||
depends_on:
|
||||
- update-pip-package
|
||||
- wait-pkg-update
|
||||
|
||||
commands:
|
||||
- apk add --update --no-cache curl
|
||||
|
|
|
@ -16,7 +16,6 @@ Events
|
|||
platypush/events/chat.slack.rst
|
||||
platypush/events/chat.telegram.rst
|
||||
platypush/events/clipboard.rst
|
||||
platypush/events/covid19.rst
|
||||
platypush/events/custom.rst
|
||||
platypush/events/dbus.rst
|
||||
platypush/events/distance.rst
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
``covid19``
|
||||
===================================
|
||||
|
||||
.. automodule:: platypush.message.event.covid19
|
||||
:members:
|
|
@ -1,5 +0,0 @@
|
|||
``covid19``
|
||||
=============================
|
||||
|
||||
.. automodule:: platypush.plugins.covid19
|
||||
:members:
|
|
@ -27,7 +27,6 @@ Plugins
|
|||
platypush/plugins/chat.telegram.rst
|
||||
platypush/plugins/clipboard.rst
|
||||
platypush/plugins/config.rst
|
||||
platypush/plugins/covid19.rst
|
||||
platypush/plugins/csv.rst
|
||||
platypush/plugins/db.rst
|
||||
platypush/plugins/dbus.rst
|
||||
|
|
|
@ -25,6 +25,9 @@ manifest:
|
|||
apt:
|
||||
- python3-grpcio
|
||||
- python3-google-auth
|
||||
dnf:
|
||||
- python-grpcio
|
||||
- python-google-auth
|
||||
pacman:
|
||||
- python-grpcio
|
||||
- python-google-auth
|
||||
|
|
|
@ -4,6 +4,9 @@ manifest:
|
|||
apk:
|
||||
- py3-numpy
|
||||
- py3-pillow
|
||||
dnf:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
|
|
|
@ -8,6 +8,8 @@ manifest:
|
|||
- py3-watchdog
|
||||
apt:
|
||||
- python3-watchdog
|
||||
dnf:
|
||||
- python-watchdog
|
||||
pacman:
|
||||
- python-watchdog
|
||||
pip:
|
||||
|
|
|
@ -10,6 +10,8 @@ manifest:
|
|||
- gpsd
|
||||
apt:
|
||||
- gpsd
|
||||
dnf:
|
||||
- gpsd
|
||||
pacman:
|
||||
- gpsd
|
||||
pip:
|
||||
|
|
|
@ -13,6 +13,8 @@ manifest:
|
|||
- py3-inotify
|
||||
apt:
|
||||
- python3-inotify
|
||||
dnf:
|
||||
- python-inotify
|
||||
pip:
|
||||
- inotify
|
||||
package: platypush.backend.inotify
|
||||
|
|
|
@ -17,6 +17,8 @@ manifest:
|
|||
- linuxconsoletools
|
||||
apt:
|
||||
- joystick
|
||||
dnf:
|
||||
- joystick
|
||||
pacman:
|
||||
- joyutils
|
||||
package: platypush.backend.joystick.jstest
|
||||
|
|
|
@ -3,6 +3,8 @@ manifest:
|
|||
install:
|
||||
apt:
|
||||
- python3-kafka
|
||||
dnf:
|
||||
- python-kafka
|
||||
pip:
|
||||
- kafka
|
||||
package: platypush.backend.kafka
|
||||
|
|
|
@ -6,6 +6,8 @@ manifest:
|
|||
- py3-watchdog
|
||||
apt:
|
||||
- python3-watchdog
|
||||
dnf:
|
||||
- python-watchdog
|
||||
pacman:
|
||||
- python-watchdog
|
||||
pip:
|
||||
|
|
|
@ -4,6 +4,8 @@ manifest:
|
|||
install:
|
||||
apt:
|
||||
- python3-rtmidi
|
||||
dnf:
|
||||
- python-rtmidi
|
||||
pacman:
|
||||
- rtmidi
|
||||
- python-rtmidi
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
install:
|
||||
apk:
|
||||
- py3-paho-mqtt
|
||||
dnf:
|
||||
- python-paho-mqtt
|
||||
pacman:
|
||||
- python-paho-mqtt
|
||||
apt:
|
||||
|
|
|
@ -12,6 +12,8 @@ manifest:
|
|||
install:
|
||||
apt:
|
||||
- python3-mpd2
|
||||
dnf:
|
||||
- python-mpd2
|
||||
pacman:
|
||||
- python-mpd2
|
||||
pip:
|
||||
|
|
|
@ -15,6 +15,9 @@ manifest:
|
|||
apt:
|
||||
- sudo
|
||||
- cargo
|
||||
dnf:
|
||||
- sudo
|
||||
- cargo
|
||||
pacman:
|
||||
- sudo
|
||||
- cargo
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
- git
|
||||
apt:
|
||||
- git
|
||||
dnf:
|
||||
- git
|
||||
pacman:
|
||||
- git
|
||||
install:
|
||||
|
|
|
@ -5,10 +5,12 @@ manifest:
|
|||
install:
|
||||
apk:
|
||||
- py3-pyscard
|
||||
pacman:
|
||||
- python-pyscard
|
||||
apt:
|
||||
- python3-pyscard
|
||||
dnf:
|
||||
- python-pyscard
|
||||
pacman:
|
||||
- python-pyscard
|
||||
pip:
|
||||
- pyscard
|
||||
package: platypush.backend.scard
|
||||
|
|
|
@ -3,6 +3,11 @@ manifest:
|
|||
platypush.message.event.wiimote.WiimoteEvent: when the state of the Wiimote (battery,
|
||||
buttons, acceleration etc.) changes
|
||||
install:
|
||||
pip: []
|
||||
apt:
|
||||
- libcwiid1
|
||||
pacman:
|
||||
- cwiid-git
|
||||
pip:
|
||||
- cwiid
|
||||
package: platypush.backend.wiimote
|
||||
type: backend
|
||||
|
|
|
@ -16,6 +16,8 @@ manifest:
|
|||
install:
|
||||
apk:
|
||||
- py3-paho-mqtt
|
||||
dnf:
|
||||
- python-paho-mqtt
|
||||
pacman:
|
||||
- python-paho-mqtt
|
||||
apt:
|
||||
|
|
26
platypush/install/docker/fedora.Dockerfile
Normal file
26
platypush/install/docker/fedora.Dockerfile
Normal file
|
@ -0,0 +1,26 @@
|
|||
FROM fedora
|
||||
|
||||
ADD . /install
|
||||
WORKDIR /var/lib/platypush
|
||||
|
||||
ARG DOCKER_CTX=1
|
||||
ENV DOCKER_CTX=1
|
||||
|
||||
# Enable the RPM Fusion repository
|
||||
RUN dnf install -y \
|
||||
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
|
||||
|
||||
RUN /install/platypush/install/scripts/fedora/install.sh
|
||||
RUN cd /install && pip install -U --no-input --no-cache-dir .
|
||||
RUN rm -rf /install
|
||||
RUN dnf clean all -y
|
||||
|
||||
EXPOSE 8008
|
||||
|
||||
VOLUME /etc/platypush
|
||||
VOLUME /var/lib/platypush
|
||||
|
||||
CMD platypush \
|
||||
--start-redis \
|
||||
--config /etc/platypush/config.yaml \
|
||||
--workdir /var/lib/platypush
|
27
platypush/install/requirements/fedora.txt
Normal file
27
platypush/install/requirements/fedora.txt
Normal file
|
@ -0,0 +1,27 @@
|
|||
python
|
||||
python-pip
|
||||
python-alembic
|
||||
python-bcrypt
|
||||
python-croniter
|
||||
python-dateutil
|
||||
python-docutils
|
||||
python-flask
|
||||
python-frozendict
|
||||
python-greenlet
|
||||
python-magic
|
||||
python-marshmallow
|
||||
python-mypy_extensions
|
||||
python-psutil
|
||||
python-pytz
|
||||
python-redis
|
||||
python-requests
|
||||
python-rsa
|
||||
python-sqlalchemy
|
||||
python-tornado
|
||||
python-websocket-client
|
||||
python-websockets
|
||||
python-wheel
|
||||
python-yaml
|
||||
python-zeroconf
|
||||
redis
|
||||
sudo
|
1
platypush/install/scripts/fedora/PKGCMD
Normal file
1
platypush/install/scripts/fedora/PKGCMD
Normal file
|
@ -0,0 +1 @@
|
|||
dnf install -y
|
28
platypush/install/scripts/fedora/install.sh
Executable file
28
platypush/install/scripts/fedora/install.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
|
||||
# This script parses the system requirements for a specific OS and it runs the
|
||||
# appropriate package manager command to install them.
|
||||
|
||||
# This script is usually symlinked in the folders of the individual operating
|
||||
# systems, and it's not supposed to be invoked directly.
|
||||
# Instead, it will be called either by the root install.sh script or by a
|
||||
# Dockerfile.
|
||||
|
||||
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
OS="$(basename "$SCRIPT_PATH")"
|
||||
CMD="$(cat "${SCRIPT_PATH}/PKGCMD")"
|
||||
REQUIREMENTS="$(cat "${SCRIPT_PATH}/../../requirements/${OS}.txt" | tr '\n' ' ')"
|
||||
SUDO=
|
||||
|
||||
# If we aren't running in a Docker context, or the user is not root, we should
|
||||
# use sudo to install system packages.
|
||||
if [ $(id -u) -ne 0 ] || [ -z "$DOCKER_CTX" ]; then
|
||||
if ! type sudo >/dev/null; then
|
||||
echo "sudo executable not found, I can't install system packages" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SUDO="sudo"
|
||||
fi
|
||||
|
||||
${SUDO_ARGS} ${CMD} ${REQUIREMENTS}
|
|
@ -1,26 +0,0 @@
|
|||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from platypush.message.event import Event
|
||||
|
||||
|
||||
class Covid19UpdateEvent(Event):
|
||||
def __init__(self,
|
||||
confirmed: int,
|
||||
deaths: int,
|
||||
recovered: int,
|
||||
country: Optional[str] = None,
|
||||
country_code: Optional[str] = None,
|
||||
update_time: Optional[datetime] = None,
|
||||
*args, **kwargs):
|
||||
super().__init__(*args,
|
||||
confirmed=confirmed,
|
||||
deaths=deaths,
|
||||
recovered=recovered,
|
||||
country=country,
|
||||
country_code=country_code,
|
||||
update_time=update_time,
|
||||
**kwargs)
|
||||
|
||||
|
||||
# vim:sw=4:ts=4:et:
|
|
@ -35,6 +35,7 @@ class DockerBuilder(BaseBuilder):
|
|||
_pkg_manager_by_base_image = {
|
||||
BaseImage.ALPINE: PackageManagers.APK,
|
||||
BaseImage.DEBIAN: PackageManagers.APT,
|
||||
BaseImage.FEDORA: PackageManagers.DNF,
|
||||
BaseImage.UBUNTU: PackageManagers.APT,
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ manifest:
|
|||
apt:
|
||||
- python3-tenacity
|
||||
- python3-google-auth
|
||||
dnf:
|
||||
- python-tenacity
|
||||
- python-google-auth
|
||||
pacman:
|
||||
- python-tenacity
|
||||
- python-google-auth
|
||||
|
|
|
@ -20,6 +20,9 @@ manifest:
|
|||
- libbluetooth-dev
|
||||
- python3-pydbus
|
||||
- git
|
||||
dnf:
|
||||
- python-pydbus
|
||||
- git
|
||||
pacman:
|
||||
- python-pydbus
|
||||
- python-bleak
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
- py3-icalendar
|
||||
apt:
|
||||
- python3-icalendar
|
||||
dnf:
|
||||
- python-icalendar
|
||||
pacman:
|
||||
- python-icalendar
|
||||
pip:
|
||||
|
|
|
@ -5,14 +5,18 @@ manifest:
|
|||
- py3-numpy
|
||||
- py3-pillow
|
||||
- py3-opencv
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- python-opencv
|
||||
apt:
|
||||
- python3-numpy
|
||||
- python3-pillow
|
||||
- python3-opencv
|
||||
dnf:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- python-opencv
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- python-opencv
|
||||
pip:
|
||||
- numpy
|
||||
- opencv-python
|
||||
|
|
|
@ -5,14 +5,18 @@ manifest:
|
|||
- py3-numpy
|
||||
- py3-pillow
|
||||
- ffmpeg
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- ffmpeg
|
||||
apt:
|
||||
- python3-numpy
|
||||
- python3-pillow
|
||||
- ffmpeg
|
||||
dnf:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- ffmpeg
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- ffmpeg
|
||||
pip:
|
||||
- numpy
|
||||
- Pillow
|
||||
|
|
|
@ -6,16 +6,21 @@ manifest:
|
|||
- py3-pillow
|
||||
- py3-gobject3
|
||||
- py3-gst
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- gst-python
|
||||
- python-gobject
|
||||
apt:
|
||||
- python3-numpy
|
||||
- python3-pillow
|
||||
- python3-gi
|
||||
- python3-gst-1.0
|
||||
dnf:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- python-gstreamer1
|
||||
- python-gobject
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- gst-python
|
||||
- python-gobject
|
||||
pip:
|
||||
- numpy
|
||||
- Pillow
|
||||
|
|
|
@ -5,14 +5,18 @@ manifest:
|
|||
- i2c-tools-dev
|
||||
- py3-numpy
|
||||
- py3-pillow
|
||||
pacman:
|
||||
- i2c-tools
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
apt:
|
||||
- libi2c-dev
|
||||
- python3-numpy
|
||||
- python3-pillow
|
||||
dnf:
|
||||
- i2c-tools
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
pacman:
|
||||
- i2c-tools
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
pip:
|
||||
- numpy
|
||||
- Pillow
|
||||
|
|
|
@ -4,12 +4,15 @@ manifest:
|
|||
apk:
|
||||
- py3-numpy
|
||||
- py3-pillow
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
apt:
|
||||
- python3-numpy
|
||||
- python3-pillow
|
||||
dnf:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
pip:
|
||||
- picamera
|
||||
- numpy
|
||||
|
|
|
@ -23,6 +23,8 @@ manifest:
|
|||
install:
|
||||
apt:
|
||||
- python3-irc
|
||||
dnf:
|
||||
- python-irc
|
||||
pacman:
|
||||
- python-irc
|
||||
pip:
|
||||
|
|
|
@ -4,6 +4,10 @@ manifest:
|
|||
install:
|
||||
apk:
|
||||
- py3-pyclip
|
||||
dnf:
|
||||
- python-pyclip
|
||||
pacman:
|
||||
- python-pyclip
|
||||
pip:
|
||||
- pyclip
|
||||
package: platypush.plugins.clipboard
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
from typing import Optional, Union, List, Dict, Any
|
||||
|
||||
import requests
|
||||
|
||||
from platypush.plugins import Plugin, action
|
||||
|
||||
|
||||
class Covid19Plugin(Plugin):
|
||||
"""
|
||||
Monitor the diffusion data of the COVID-19 pandemic by using the public API at https://api.covid19api.com.
|
||||
"""
|
||||
|
||||
base_url = 'https://api.covid19api.com'
|
||||
|
||||
def __init__(self, country: Union[str, List[str]] = 'world', **kwargs):
|
||||
"""
|
||||
:param country: Default country (or list of countries) to retrieve the stats for. It can either be the full
|
||||
country name or the country code. Special values:
|
||||
|
||||
- ``world``: Get worldwide stats (default).
|
||||
- ``all``: Get all the available stats.
|
||||
"""
|
||||
super().__init__(**kwargs)
|
||||
self.country = []
|
||||
self.all_countries = requests.get('{}/countries'.format(self.base_url)).json()
|
||||
self.country = self._get_countries(country)
|
||||
|
||||
def _get_countries(self, country: Optional[Union[str, List[str]]] = None) -> List[str]:
|
||||
country = country or self.country
|
||||
if isinstance(country, str):
|
||||
country = country.split(',')
|
||||
lc_country = {c.lower() for c in country}
|
||||
return [c['ISO2'] for c in self.all_countries
|
||||
if c['ISO2'].lower() in lc_country
|
||||
or c['Slug'].lower() in lc_country
|
||||
or c['Country'].lower() in lc_country]
|
||||
|
||||
@action
|
||||
def summary(self, country: Optional[Union[str, List[str]]] = None) -> List[Dict[str, Any]]:
|
||||
"""
|
||||
Get the summary data for the world or a country.
|
||||
|
||||
:param country: Default country override.
|
||||
"""
|
||||
countries = self._get_countries(country)
|
||||
response = requests.get('{}/summary'.format(self.base_url)).json()
|
||||
if countries[0] == 'all':
|
||||
return response.get('Countries', [])
|
||||
if countries[0] == 'world':
|
||||
return response.get('Global', {})
|
||||
|
||||
return [
|
||||
c for c in response.get('Countries', [])
|
||||
if c.get('CountryCode').upper() in countries
|
||||
or c.get('Country').upper() in countries
|
||||
]
|
||||
|
||||
@action
|
||||
def data(self, country: Optional[Union[str, List[str]]] = None) -> List[Dict[str, Any]]:
|
||||
"""
|
||||
Get all the data for a country.
|
||||
|
||||
:param country: Default country override.
|
||||
"""
|
||||
countries = self._get_countries(country)
|
||||
ret = []
|
||||
for country in countries:
|
||||
ret += requests.get('{}/total/country/{}'.format(self.base_url, country)).json()
|
||||
return ret
|
||||
|
||||
|
||||
# vim:sw=4:ts=4:et:
|
|
@ -1,6 +0,0 @@
|
|||
manifest:
|
||||
events: {}
|
||||
install:
|
||||
pip: []
|
||||
package: platypush.plugins.covid19
|
||||
type: plugin
|
|
@ -8,6 +8,9 @@ manifest:
|
|||
apt:
|
||||
- python3-pydbus
|
||||
- python3-defusedxml
|
||||
dnf:
|
||||
- python-pydbus
|
||||
- python-defusedxml
|
||||
pacman:
|
||||
- python-pydbus
|
||||
- python-defusedxml
|
||||
|
|
|
@ -3,6 +3,8 @@ manifest:
|
|||
install:
|
||||
apt:
|
||||
- python3-dropbox
|
||||
dnf:
|
||||
- python-dropbox
|
||||
pacman:
|
||||
- python-dropbox
|
||||
pip:
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
- ffmpeg
|
||||
apt:
|
||||
- ffmpeg
|
||||
dnf:
|
||||
- ffmpeg
|
||||
pacman:
|
||||
- ffmpeg
|
||||
- python-ffmpeg
|
||||
|
|
|
@ -8,6 +8,10 @@ manifest:
|
|||
apt:
|
||||
- python3-google-auth
|
||||
- python3-oauth2client
|
||||
dnf:
|
||||
- python-google-api-client
|
||||
- python-google-auth
|
||||
- python-oauth2client
|
||||
pacman:
|
||||
- python-google-api-python-client
|
||||
- python-google-auth
|
||||
|
|
|
@ -8,6 +8,10 @@ manifest:
|
|||
apt:
|
||||
- python3-google-auth
|
||||
- python3-oauth2client
|
||||
dnf:
|
||||
- python-google-api-client
|
||||
- python-google-auth
|
||||
- python-oauth2client
|
||||
pacman:
|
||||
- python-google-api-python-client
|
||||
- python-google-auth
|
||||
|
|
|
@ -8,6 +8,10 @@ manifest:
|
|||
apt:
|
||||
- python3-google-auth
|
||||
- python3-oauth2client
|
||||
dnf:
|
||||
- python-google-api-client
|
||||
- python-google-auth
|
||||
- python-oauth2client
|
||||
pacman:
|
||||
- python-google-api-python-client
|
||||
- python-google-auth
|
||||
|
|
|
@ -8,6 +8,10 @@ manifest:
|
|||
apt:
|
||||
- python3-google-auth
|
||||
- python3-oauth2client
|
||||
dnf:
|
||||
- python-google-api-client
|
||||
- python-google-auth
|
||||
- python-oauth2client
|
||||
pacman:
|
||||
- python-google-api-python-client
|
||||
- python-google-auth
|
||||
|
|
|
@ -8,6 +8,10 @@ manifest:
|
|||
apt:
|
||||
- python3-google-auth
|
||||
- python3-oauth2client
|
||||
dnf:
|
||||
- python-google-api-client
|
||||
- python-google-auth
|
||||
- python-oauth2client
|
||||
pacman:
|
||||
- python-google-api-python-client
|
||||
- python-google-auth
|
||||
|
|
|
@ -8,6 +8,10 @@ manifest:
|
|||
apt:
|
||||
- python3-google-auth
|
||||
- python3-oauth2client
|
||||
dnf:
|
||||
- python-google-api-client
|
||||
- python-google-auth
|
||||
- python-oauth2client
|
||||
pacman:
|
||||
- python-google-api-python-client
|
||||
- python-google-auth
|
||||
|
|
|
@ -8,6 +8,10 @@ manifest:
|
|||
apt:
|
||||
- python3-google-auth
|
||||
- python3-oauth2client
|
||||
dnf:
|
||||
- python-google-api-client
|
||||
- python-google-auth
|
||||
- python-oauth2client
|
||||
pacman:
|
||||
- python-google-api-python-client
|
||||
- python-google-auth
|
||||
|
|
|
@ -8,6 +8,10 @@ manifest:
|
|||
apt:
|
||||
- python3-google-auth
|
||||
- python3-oauth2client
|
||||
dnf:
|
||||
- python-google-api-client
|
||||
- python-google-auth
|
||||
- python-oauth2client
|
||||
pacman:
|
||||
- python-google-api-python-client
|
||||
- python-google-auth
|
||||
|
|
|
@ -4,8 +4,12 @@ manifest:
|
|||
platypush.message.event.hid.HidDeviceDisconnectedEvent: when a previously available device is disconnected
|
||||
platypush.message.event.hid.HidDeviceDataEvent: when a monitored device sends some data
|
||||
install:
|
||||
apk:
|
||||
- python3-hidapi
|
||||
apt:
|
||||
- python3-hid
|
||||
dnf:
|
||||
- python-hidapi
|
||||
pacman:
|
||||
- python-hid
|
||||
pip:
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
manifest:
|
||||
events: {}
|
||||
install:
|
||||
apk:
|
||||
- py3-feedparser
|
||||
apt:
|
||||
- python3-feedparser
|
||||
dnf:
|
||||
- python-feedparser
|
||||
pacman:
|
||||
- python-feedparser
|
||||
pip:
|
||||
- feedparser
|
||||
- feedparser
|
||||
package: platypush.plugins.http.request.rss
|
||||
type: plugin
|
||||
|
|
|
@ -9,6 +9,10 @@ manifest:
|
|||
- sudo
|
||||
- nodejs
|
||||
- npm
|
||||
dnf:
|
||||
- sudo
|
||||
- nodejs
|
||||
- npm
|
||||
pacman:
|
||||
- sudo
|
||||
- nodejs
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!node
|
||||
#!/usr/bin/node
|
||||
|
||||
// This script will parse the content and title of a webpage using the
|
||||
// mercury-parser JavaScript library (https://github.com/postlight/mercury-parser)
|
||||
|
|
|
@ -3,7 +3,11 @@ manifest:
|
|||
platypush.message.event.kafka.KafkaMessageEvent: when a new message is received
|
||||
on the consumer topic.
|
||||
install:
|
||||
apt:
|
||||
- python-kafka
|
||||
dnf:
|
||||
- python-kafka
|
||||
pip:
|
||||
- kafka
|
||||
- kafka
|
||||
package: platypush.plugins.kafka
|
||||
type: plugin
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
- py3-pylast
|
||||
apt:
|
||||
- python3-pylast
|
||||
dnf:
|
||||
- python-pylast
|
||||
pacman:
|
||||
- python-pylast
|
||||
pip:
|
||||
|
|
|
@ -43,6 +43,10 @@ manifest:
|
|||
- olm-dev
|
||||
apt:
|
||||
- libolm-devel
|
||||
- python3-async-lru
|
||||
dnf:
|
||||
- libolm-devel
|
||||
- python-async-lru
|
||||
pacman:
|
||||
- libolm
|
||||
- python-async-lru
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
- py3-pychromecast
|
||||
apt:
|
||||
- python3-pychromecast
|
||||
dnf:
|
||||
- python-chromecast
|
||||
pip:
|
||||
- pychromecast
|
||||
package: platypush.plugins.media.chromecast
|
||||
|
|
|
@ -7,6 +7,9 @@ manifest:
|
|||
apt:
|
||||
- python3-gi
|
||||
- python3-gst-1.0
|
||||
dnf:
|
||||
- python-gstreamer1
|
||||
- python-gobject
|
||||
pacman:
|
||||
- gst-python
|
||||
- python-gobject
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
- mplayer
|
||||
apt:
|
||||
- mplayer
|
||||
dnf:
|
||||
- mplayer
|
||||
pacman:
|
||||
- mplayer
|
||||
package: platypush.plugins.media.mplayer
|
||||
|
|
|
@ -7,6 +7,8 @@ manifest:
|
|||
apt:
|
||||
- mpv
|
||||
- python3-mpv
|
||||
dnf:
|
||||
- mpv
|
||||
pacman:
|
||||
- mpv
|
||||
- python-mpv
|
||||
|
|
|
@ -7,6 +7,9 @@ manifest:
|
|||
apt:
|
||||
- vlc
|
||||
- python3-vlc
|
||||
dnf:
|
||||
- vlc
|
||||
- python3-vlc
|
||||
pacman:
|
||||
- vlc
|
||||
pip:
|
||||
|
|
|
@ -3,6 +3,8 @@ manifest:
|
|||
install:
|
||||
apt:
|
||||
- python3-rtmidi
|
||||
dnf:
|
||||
- python-rtmidi
|
||||
pacman:
|
||||
- python-rtmidi
|
||||
pip:
|
||||
|
|
|
@ -4,12 +4,15 @@ manifest:
|
|||
apk:
|
||||
- py3-numpy
|
||||
- py3-opencv
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-opencv
|
||||
apt:
|
||||
- python3-numpy
|
||||
- python3-opencv
|
||||
dnf:
|
||||
- python-numpy
|
||||
- python-opencv
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-opencv
|
||||
pip:
|
||||
- numpy
|
||||
- opencv-python
|
||||
|
|
|
@ -4,10 +4,12 @@ manifest:
|
|||
install:
|
||||
apk:
|
||||
- py3-paho-mqtt
|
||||
pacman:
|
||||
- python-paho-mqtt
|
||||
apt:
|
||||
- python3-paho-mqtt
|
||||
dnf:
|
||||
- python-paho-mqtt
|
||||
pacman:
|
||||
- python-paho-mqtt
|
||||
pip:
|
||||
- paho-mqtt
|
||||
package: platypush.plugins.mqtt
|
||||
|
|
|
@ -3,6 +3,8 @@ manifest:
|
|||
install:
|
||||
apt:
|
||||
- python3-mpd
|
||||
dnf:
|
||||
- python3-mpd2
|
||||
pacman:
|
||||
- python-mpd2
|
||||
pip:
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
- py3-otp
|
||||
apt:
|
||||
- python3-pyotp
|
||||
dnf:
|
||||
- python-pyotp
|
||||
pacman:
|
||||
- python-pyotp
|
||||
pip:
|
||||
|
|
|
@ -6,6 +6,8 @@ manifest:
|
|||
apt:
|
||||
- libcups2-dev
|
||||
- python3-cups
|
||||
dnf:
|
||||
- python-cups
|
||||
pacman:
|
||||
- python-pycups
|
||||
pip:
|
||||
|
|
|
@ -6,16 +6,21 @@ manifest:
|
|||
- py3-pillow
|
||||
- py3-qrcode
|
||||
- py3-pyzbar
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- python-qrcode
|
||||
- pyzbar
|
||||
apt:
|
||||
- python3-numpy
|
||||
- python3-pillow
|
||||
- python3-pyzbar
|
||||
- python3-qrcode
|
||||
dnf:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- python-qrcode
|
||||
- python-zbar
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pillow
|
||||
- python-qrcode
|
||||
- pyzbar
|
||||
pip:
|
||||
- numpy
|
||||
- qrcode
|
||||
|
|
|
@ -8,6 +8,9 @@ manifest:
|
|||
apt:
|
||||
- python3-feedparser
|
||||
- python3-defusedxml
|
||||
dnf:
|
||||
- python-feedparser
|
||||
- python-defusedxml
|
||||
pacman:
|
||||
- python-feedparser
|
||||
- python-defusedxml
|
||||
|
|
|
@ -19,6 +19,8 @@ manifest:
|
|||
- rtorrent
|
||||
apt:
|
||||
- rtorrent
|
||||
dnf:
|
||||
- rtorrent
|
||||
pacman:
|
||||
- rtorrent
|
||||
package: platypush.plugins.rtorrent
|
||||
|
|
|
@ -6,6 +6,8 @@ manifest:
|
|||
- py3-pyserial
|
||||
apt:
|
||||
- python3-serial
|
||||
dnf:
|
||||
- python-pyserial
|
||||
pacman:
|
||||
- python-pyserial
|
||||
pip:
|
||||
|
|
|
@ -17,6 +17,10 @@ manifest:
|
|||
- ffmpeg
|
||||
- portaudio19-dev
|
||||
- python3-numpy
|
||||
dnf:
|
||||
- ffmpeg
|
||||
- portaudio-devel
|
||||
- python-numpy
|
||||
pacman:
|
||||
- ffmpeg
|
||||
- portaudio
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
- py3-paramiko
|
||||
apt:
|
||||
- python3-paramiko
|
||||
dnf:
|
||||
- python-paramiko
|
||||
pacman:
|
||||
- python-paramiko
|
||||
pip:
|
||||
|
|
|
@ -8,6 +8,8 @@ manifest:
|
|||
- python-sounddevice
|
||||
apt:
|
||||
- python3-numpy
|
||||
dnf:
|
||||
- python-numpy
|
||||
pip:
|
||||
- deepspeech
|
||||
- numpy
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
- py3-py-cpuinfo
|
||||
apt:
|
||||
- python3-cpuinfo
|
||||
dnf:
|
||||
- python-cpuinfo
|
||||
pacman:
|
||||
- python-py-cpuinfo
|
||||
pip:
|
||||
|
|
|
@ -16,14 +16,17 @@ manifest:
|
|||
apk:
|
||||
- py3-numpy
|
||||
- py3-pandas
|
||||
apt:
|
||||
- python3-numpy
|
||||
- python3-pandas
|
||||
dnf:
|
||||
- python3-numpy
|
||||
- python3-pandas
|
||||
pacman:
|
||||
- python-numpy
|
||||
- python-pandas
|
||||
- python-tensorflow
|
||||
- python-keras
|
||||
apt:
|
||||
- python3-numpy
|
||||
- python3-pandas
|
||||
pip:
|
||||
- numpy
|
||||
- pandas
|
||||
|
|
|
@ -5,6 +5,8 @@ manifest:
|
|||
- py3-libtorrent-rasterbar
|
||||
apt:
|
||||
- python3-libtorrent
|
||||
dnf:
|
||||
- rb_libtorrent-python3
|
||||
pacman:
|
||||
- libtorrent-rasterbar
|
||||
pip:
|
||||
|
|
|
@ -3,6 +3,8 @@ manifest:
|
|||
install:
|
||||
apt:
|
||||
- python3-twilio
|
||||
dnf:
|
||||
- python-twilio
|
||||
pip:
|
||||
- twilio
|
||||
package: platypush.plugins.twilio
|
||||
|
|
|
@ -34,6 +34,8 @@ manifest:
|
|||
apt:
|
||||
- python3-aioxmpp
|
||||
- python3-tz
|
||||
dnf:
|
||||
- python-pytz
|
||||
pacman:
|
||||
- python-pytz
|
||||
pip:
|
||||
|
|
|
@ -41,10 +41,12 @@ manifest:
|
|||
install:
|
||||
apk:
|
||||
- py3-paho-mqtt
|
||||
pacman:
|
||||
- python-paho-mqtt
|
||||
apt:
|
||||
- python3-paho-mqtt
|
||||
dnf:
|
||||
- python-paho-mqtt
|
||||
pacman:
|
||||
- python-paho-mqtt
|
||||
pip:
|
||||
- paho-mqtt
|
||||
package: platypush.plugins.zigbee.mqtt
|
||||
|
|
|
@ -17,12 +17,14 @@ manifest:
|
|||
platypush.message.event.zwave.ZwaveValueChangedEvent: >
|
||||
when the value of a node on the network changes.
|
||||
install:
|
||||
apk:
|
||||
- py3-paho-mqtt
|
||||
pacman:
|
||||
- python-paho-mqtt
|
||||
apt:
|
||||
- python3-paho-mqtt
|
||||
apk:
|
||||
- py3-paho-mqtt
|
||||
dnf:
|
||||
- python-paho-mqtt
|
||||
pacman:
|
||||
- python-paho-mqtt
|
||||
pip:
|
||||
- paho-mqtt
|
||||
package: platypush.plugins.zwave.mqtt
|
||||
|
|
|
@ -42,6 +42,7 @@ class BaseImage(Enum):
|
|||
|
||||
ALPINE = 'alpine'
|
||||
DEBIAN = 'debian'
|
||||
FEDORA = 'fedora'
|
||||
UBUNTU = 'ubuntu'
|
||||
|
||||
def __str__(self) -> str:
|
||||
|
@ -129,6 +130,15 @@ class PackageManagers(Enum):
|
|||
parse_list_line=lambda line: line.split('/')[0],
|
||||
)
|
||||
|
||||
DNF = PackageManager(
|
||||
executable='dnf',
|
||||
install=('dnf', 'install', '-y'),
|
||||
uninstall=('dnf', 'remove', '-y'),
|
||||
list=('dnf', 'list', '--installed'),
|
||||
default_os='fedora',
|
||||
parse_list_line=lambda line: re.split(r'\s+', line)[0].split('.')[0],
|
||||
)
|
||||
|
||||
PACMAN = PackageManager(
|
||||
executable='pacman',
|
||||
install=('pacman', '-S', '--noconfirm', '--needed'),
|
||||
|
|
Loading…
Reference in a new issue