s/runbullet/platypush/g

This commit is contained in:
Fabio Manganiello 2017-12-11 20:30:57 +01:00
parent 50413dd89d
commit 6c2ea3767c
18 changed files with 37 additions and 37 deletions

View file

@ -1,4 +1,4 @@
Runbullet
Platypush
=========
Execute any command or custom complex logic on your devices, wherever they are, using your PushBullet account.
@ -7,13 +7,13 @@ Installation
------------
```shell
pip install runbullet
pip install platypush
```
Configuration
-------------
Copy /etc/runbullet/config.example.yaml to /etc/runbullet/config.yaml (system-wise settings) or ~/.config/runbullet/config.yaml (user-wise settings).
Copy /etc/platypush/config.example.yaml to /etc/platypush/config.yaml (system-wise settings) or ~/.config/platypush/config.yaml (user-wise settings).
Edit the file to include:
@ -38,7 +38,7 @@ Each target device is identified by a unique device_id in the messages sent over
Shell interface
---------------
`runbullet` installs `pusher`, a command-line tool to send PushBullet messages to the connected devices in the format used by runbullet.
`platypush` installs `pusher`, a command-line tool to send PushBullet messages to the connected devices in the format used by platypush.
Some examples:
@ -52,13 +52,13 @@ The logic to execute is specified by the `--action` option, whose format is `pac
Available plugins
-----------------
* `runbullet.plugins.shell`: The simplest and yet most versatile plugin. Executes a remote command on the host identified by the `--target` device_id. Example:
* `platypush.plugins.shell`: The simplest and yet most versatile plugin. Executes a remote command on the host identified by the `--target` device_id. Example:
```shell
pusher --target laptop --action shell.exec --cmd "scp /home/user/photos/*.jpg backup_host:/mnt/hd/photos"
```
* `runbullet.plugins.music.mpd`: Controls the playback on a mpd/mopidy music server. Requires the package `mpd2` on the target machine. Example:
* `platypush.plugins.music.mpd`: Controls the playback on a mpd/mopidy music server. Requires the package `mpd2` on the target machine. Example:
```shell
pusher --target raspberry --action music.mpd.play
@ -72,13 +72,13 @@ music.mpd:
port: 6600
```
* `runbullet.plugins.switch.wemo`: Controls a WeMo Switch smart switch device. Requires the package `ouimeaux` on the target machine. Example:
* `platypush.plugins.switch.wemo`: Controls a WeMo Switch smart switch device. Requires the package `ouimeaux` on the target machine. Example:
```shell
pusher --target raspberry --action switch.wemo.on
```
* `runbullet.plugins.light.hue`: Controls a Philips Hue smart lights system. Requires the package `phue` on the target machine. Example:
* `platypush.plugins.light.hue`: Controls a Philips Hue smart lights system. Requires the package `phue` on the target machine. Example:
```shell
pusher --target raspberry --action light.hue.scene --name "Sunset" --group "Living Room"
@ -87,13 +87,13 @@ pusher --target raspberry --action light.hue.scene --name "Sunset" --group "Livi
Writing your plugins
--------------------
Writing your own `runbullet` plugin, that would execute your own custom logic whenever a bullet with your plugin name is received, is a very simple task.
Writing your own `platypush` plugin, that would execute your own custom logic whenever a bullet with your plugin name is received, is a very simple task.
1. Create your plugin directory under `runbullet/plugins` (e.g. `light/batsignal`).
1. Create your plugin directory under `platypush/plugins` (e.g. `light/batsignal`).
2. In the case above, `runbullet.plugins.light.batsignal` will be your package name.
2. In the case above, `platypush.plugins.light.batsignal` will be your package name.
3. Create an `__init__.py` under `runbullet/plugins/light/batsignal`.
3. Create an `__init__.py` under `platypush/plugins/light/batsignal`.
4. If your module is `light/batsignal`, then its main class should be named `LightBatsignalPlugin`.
@ -128,7 +128,7 @@ class LightBatsignalPlugin(LightPlugin):
6. It's a good practice to define a `status` method in your plugin, which returns a 2-items list like `[output, error]`.
7. Rebuild and reinstall `runbullet` if required and relaunch it.
7. Rebuild and reinstall `platypush` if required and relaunch it.
8. Test your new plugin by sending some bullets to it:

View file

@ -105,10 +105,10 @@ def parse_config_file(config_file=None):
locations = [
# ./config.yaml
os.path.join(wrkdir, 'config.yaml'),
# ~/.config/runbullet/config.yaml
os.path.join(os.environ['HOME'], '.config', 'runbullet', 'config.yaml'),
# /etc/runbullet/config.yaml
os.path.join(os.sep, 'etc', 'runbullet', 'config.yaml'),
# ~/.config/platypush/config.yaml
os.path.join(os.environ['HOME'], '.config', 'platypush', 'config.yaml'),
# /etc/platypush/config.yaml
os.path.join(os.sep, 'etc', 'platypush', 'config.yaml'),
]
for loc in locations:

View file

@ -1,5 +1,5 @@
import logging
import runbullet
import platypush
from threading import Thread
@ -40,7 +40,7 @@ class Backend(Thread):
cls._init(self, **config)
def is_local(self):
from runbullet.backend.local import LocalBackend
from platypush.backend.local import LocalBackend
return isinstance(self, LocalBackend)
def on_msg(self, msg):
@ -48,7 +48,7 @@ class Backend(Thread):
return # No target
target = msg.pop('target')
if target != runbullet.get_device_id() and not self.is_local():
if target != platypush.get_device_id() and not self.is_local():
return # Not for me
if 'action' not in msg:

View file

@ -7,10 +7,10 @@ import re
import sys
import yaml
from runbullet import parse_config_file
from runbullet.backend.kafka import KafkaBackend
from runbullet.backend.local import LocalBackend
from runbullet.backend.pushbullet import PushbulletBackend
from platypush import parse_config_file
from platypush.backend.kafka import KafkaBackend
from platypush.backend.local import LocalBackend
from platypush.backend.pushbullet import PushbulletBackend
def print_usage():

View file

@ -3,7 +3,7 @@ backend.kafka:
pusher: True # The pusher executable will use this backend by default
logging: DEBUG
server: your_server:9092
topic: runbullet
topic: platypush
backend.pushbullet:
disabled: True
@ -12,7 +12,7 @@ backend.pushbullet:
device: your_pushbullet_virtual_device_name
backend.local:
fifo: /tmp/runbullet.fifo
fifo: /tmp/platypush.fifo
# device_id: <your_device_id> (default: current hostname)
# debug: True (default: False)

View file

@ -15,42 +15,42 @@ def pkg_files(dir):
return paths
def create_etc_dir():
path = '/etc/runbullet'
path = '/etc/platypush'
try:
os.makedirs(path)
except OSError as e:
if isinstance(e, PermissionError):
print('WARNING: Could not create /etc/runbullet')
print('WARNING: Could not create /etc/platypush')
elif e.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
plugins = pkg_files('runbullet/plugins')
backend = pkg_files('runbullet/backend')
plugins = pkg_files('platypush/plugins')
backend = pkg_files('platypush/backend')
create_etc_dir()
setup(
name = "runbullet",
name = "platypush",
version = "0.2.2.dev2",
author = "Fabio Manganiello",
author_email = "info@fabiomanganiello.com",
description = ("Runbullet service"),
description = ("Platypush service"),
license = "MIT",
python_requires = '>= 3',
keywords = "pushbullet notifications automation",
url = "https://github.com/BlackLight/runbullet",
# packages = ['runbullet'],
url = "https://github.com/BlackLight/platypush",
# packages = ['platypush'],
packages = find_packages(),
# package_data = {'': plugins},
scripts = ['runbullet/bin/pusher'],
scripts = ['platypush/bin/pusher'],
entry_points = {
'console_scripts': [
'runbullet=runbullet:main',
'platypush=platypush:main',
],
},
data_files = [
('/etc/runbullet', ['runbullet/config.example.yaml'])
('/etc/platypush', ['platypush/config.example.yaml'])
],
long_description = read('README.md'),
classifiers = [