From 6c2ea3767c0e564a06bcaa1b1cb0215c8ba96c11 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 11 Dec 2017 20:30:57 +0100 Subject: [PATCH] s/runbullet/platypush/g --- README.md | 26 +++++++++---------- {runbullet => platypush}/__init__.py | 8 +++--- {runbullet => platypush}/backend/__init__.py | 6 ++--- .../backend/kafka/__init__.py | 0 .../backend/local/__init__.py | 0 .../backend/pushbullet/__init__.py | 0 {runbullet => platypush}/bin/pusher | 8 +++--- {runbullet => platypush}/config.example.yaml | 4 +-- {runbullet => platypush}/create_device.sh | 0 {runbullet => platypush}/plugins/__init__.py | 0 .../plugins/light/__init__.py | 0 .../plugins/light/hue/__init__.py | 0 .../plugins/music/__init__.py | 0 .../plugins/music/mpd/__init__.py | 0 .../plugins/shell/__init__.py | 0 .../plugins/switch/__init__.py | 0 .../plugins/switch/wemo/__init__.py | 0 setup.py | 22 ++++++++-------- 18 files changed, 37 insertions(+), 37 deletions(-) rename {runbullet => platypush}/__init__.py (95%) rename {runbullet => platypush}/backend/__init__.py (92%) rename {runbullet => platypush}/backend/kafka/__init__.py (100%) rename {runbullet => platypush}/backend/local/__init__.py (100%) rename {runbullet => platypush}/backend/pushbullet/__init__.py (100%) rename {runbullet => platypush}/bin/pusher (94%) rename {runbullet => platypush}/config.example.yaml (94%) rename {runbullet => platypush}/create_device.sh (100%) rename {runbullet => platypush}/plugins/__init__.py (100%) rename {runbullet => platypush}/plugins/light/__init__.py (100%) rename {runbullet => platypush}/plugins/light/hue/__init__.py (100%) rename {runbullet => platypush}/plugins/music/__init__.py (100%) rename {runbullet => platypush}/plugins/music/mpd/__init__.py (100%) rename {runbullet => platypush}/plugins/shell/__init__.py (100%) rename {runbullet => platypush}/plugins/switch/__init__.py (100%) rename {runbullet => platypush}/plugins/switch/wemo/__init__.py (100%) diff --git a/README.md b/README.md index 6fba50cc..5b0106b6 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/runbullet/__init__.py b/platypush/__init__.py similarity index 95% rename from runbullet/__init__.py rename to platypush/__init__.py index 011ee9e8..7cdfe84c 100644 --- a/runbullet/__init__.py +++ b/platypush/__init__.py @@ -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: diff --git a/runbullet/backend/__init__.py b/platypush/backend/__init__.py similarity index 92% rename from runbullet/backend/__init__.py rename to platypush/backend/__init__.py index 2ad00cea..47f34b6d 100644 --- a/runbullet/backend/__init__.py +++ b/platypush/backend/__init__.py @@ -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: diff --git a/runbullet/backend/kafka/__init__.py b/platypush/backend/kafka/__init__.py similarity index 100% rename from runbullet/backend/kafka/__init__.py rename to platypush/backend/kafka/__init__.py diff --git a/runbullet/backend/local/__init__.py b/platypush/backend/local/__init__.py similarity index 100% rename from runbullet/backend/local/__init__.py rename to platypush/backend/local/__init__.py diff --git a/runbullet/backend/pushbullet/__init__.py b/platypush/backend/pushbullet/__init__.py similarity index 100% rename from runbullet/backend/pushbullet/__init__.py rename to platypush/backend/pushbullet/__init__.py diff --git a/runbullet/bin/pusher b/platypush/bin/pusher similarity index 94% rename from runbullet/bin/pusher rename to platypush/bin/pusher index b10017fa..11c60908 100755 --- a/runbullet/bin/pusher +++ b/platypush/bin/pusher @@ -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(): diff --git a/runbullet/config.example.yaml b/platypush/config.example.yaml similarity index 94% rename from runbullet/config.example.yaml rename to platypush/config.example.yaml index 1cd0ad3c..932f4837 100644 --- a/runbullet/config.example.yaml +++ b/platypush/config.example.yaml @@ -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: (default: current hostname) # debug: True (default: False) diff --git a/runbullet/create_device.sh b/platypush/create_device.sh similarity index 100% rename from runbullet/create_device.sh rename to platypush/create_device.sh diff --git a/runbullet/plugins/__init__.py b/platypush/plugins/__init__.py similarity index 100% rename from runbullet/plugins/__init__.py rename to platypush/plugins/__init__.py diff --git a/runbullet/plugins/light/__init__.py b/platypush/plugins/light/__init__.py similarity index 100% rename from runbullet/plugins/light/__init__.py rename to platypush/plugins/light/__init__.py diff --git a/runbullet/plugins/light/hue/__init__.py b/platypush/plugins/light/hue/__init__.py similarity index 100% rename from runbullet/plugins/light/hue/__init__.py rename to platypush/plugins/light/hue/__init__.py diff --git a/runbullet/plugins/music/__init__.py b/platypush/plugins/music/__init__.py similarity index 100% rename from runbullet/plugins/music/__init__.py rename to platypush/plugins/music/__init__.py diff --git a/runbullet/plugins/music/mpd/__init__.py b/platypush/plugins/music/mpd/__init__.py similarity index 100% rename from runbullet/plugins/music/mpd/__init__.py rename to platypush/plugins/music/mpd/__init__.py diff --git a/runbullet/plugins/shell/__init__.py b/platypush/plugins/shell/__init__.py similarity index 100% rename from runbullet/plugins/shell/__init__.py rename to platypush/plugins/shell/__init__.py diff --git a/runbullet/plugins/switch/__init__.py b/platypush/plugins/switch/__init__.py similarity index 100% rename from runbullet/plugins/switch/__init__.py rename to platypush/plugins/switch/__init__.py diff --git a/runbullet/plugins/switch/wemo/__init__.py b/platypush/plugins/switch/wemo/__init__.py similarity index 100% rename from runbullet/plugins/switch/wemo/__init__.py rename to platypush/plugins/switch/wemo/__init__.py diff --git a/setup.py b/setup.py index b4887a7d..1573e320 100755 --- a/setup.py +++ b/setup.py @@ -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 = [