Crontab implementation for Errbot
Project description
It is extention for plugin of Errbot to implement poller llike crontab.
Requirements
Installation
$ pip install errcron
or
$ pip install git+https://github.com/attakei/errcron.git
Usage
Example
from errcron import CrontabMixin
class ClockTimer(CrontabMixin, BotPlugin):
CRONTAB = [
'@hourly .post_hourly',
'0 8 * * * .post_morning_call @attakei'
]
def activate(self):
super().activate()
# some expression
def post_hourly(self, polled_time):
user = self.build_identifier('#general')
return self.send(user, 'Just {} o-clock!!'.format(polled_time.strftime('%H')))
def post_morning_call(self, polled_time, identity):
user = self.build_identifier(identity)
return self.send(user, 'Good morning!')
Extend your plugin by CrontabMixin
Define crontab
In activate, activate crontab too
Run
Latest changes
version 0.4.4
Fix for latest crontab-parser
Fix test targets in Travis-CI
version 0.4.3
Add python 3.6 for test target (compatible)
Can import as from errcron import CrontabMixin
License
Errbot is available as open source software and released under the GPL v3 license.
See full license file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
errcron-0.4.4.tar.gz
(5.6 kB
view details)
Built Distribution
File details
Details for the file errcron-0.4.4.tar.gz
.
File metadata
- Download URL: errcron-0.4.4.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20437246cf9d28a9437075241ebbcab4ed278e98cdbe6983b5d4af38c026603e |
|
MD5 | e4da98f03d7ba2df37193a9b0cfd1538 |
|
BLAKE2b-256 | c51301ec83e289dc5627e26df0d23ac29978f69b3fe7e76d912ca005b5fb54f0 |
File details
Details for the file errcron-0.4.4-py3-none-any.whl
.
File metadata
- Download URL: errcron-0.4.4-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 185429abf6a999de5a2873c7f5c44f98d30102885b4ca61de2d4fe12cab03add |
|
MD5 | 51f0a8875ddc031cc984b02b83a0d004 |
|
BLAKE2b-256 | 78ca44bd5409373a4ab0f28bb964a50d873aefa465f1aa138710502a45192c14 |