Commit Graph

240 Commits

Author SHA1 Message Date
SlyK182 de3e503cd6
Notification system (#13)
* Fixed typo

* Added proper exceptions for publishers

* Updated publishers logics: using messengers to allow publications without events

* Added new exception 'InvalidSettings'

* Updated notifiers and publishers: retrieve credentials and destination from config, use only message/event in constructors, lesser refactoring

* Updated publishers' tests

* Updated notifiers and publishers config for Telegram service, updated settings.toml file

* Updated 'post()' method and removed useless config checks for Telegram bot

* Added jinja2 template management for message formatting methods

* Manage message validation in publishers' run() method

* Better config management for notifiers and publishers

* Lesser update to logging and error-raising management (#23)
2021-07-05 21:44:11 +02:00
Giacomo Leidi dd664089d8 main: Use get_published_events query. 2021-05-31 01:19:24 +02:00
tinoilcotechino c129edd1e5
Add models (#18) 2021-05-31 01:11:50 +02:00
tinoilcotechino 48c72a6118
Merge pull request #17 from Tech-Workers-Coalition-Italia/gracefully_crash
main: Gracefully tear down DB on exception.
2021-05-30 23:07:07 +02:00
Giacomo Leidi e51e8f160f :main: Gracefully tear down DB on exception. 2021-05-30 23:03:34 +02:00
Simone Robutti fcd5116d1c
download events (#19)
* added get events stub

* added event parsing

* removed datetime

* added config and tests

* fixed response format in test

* more tests

* added error handling for request

* improved dummy data

* added get_unpublished_events

* added test

* removed last_accessed

* mobilizon_url moved to fixture

* added config comments

* moved mobilizon group to config
2021-05-30 21:47:36 +02:00
Simone Robutti 044c66eb5b
Merge pull request #15 from Tech-Workers-Coalition-Italia/main_loop
Main loop
2021-05-14 23:10:04 +02:00
Simone Robutti 95dacc139a
Merge pull request #12 from Tech-Workers-Coalition-Italia/conf_skeleton
Conf skeleton
2021-05-14 23:09:34 +02:00
Simone Robutti 0e236a4be3 added main loop stub 2021-05-13 13:32:56 +02:00
Simone Robutti ed2d016715 added notifier config 2021-05-09 17:22:14 +02:00
Simone Robutti 765b78dfb9 added conf for strategies and publisher 2021-05-09 17:17:48 +02:00
Simone Robutti d3f647c2fe moved event_selector 2021-05-09 16:15:07 +02:00
tinoilcotechino 47f8c0aa17
Merge pull request #4 from Tech-Workers-Coalition-Italia/conf
Basic configuration.
2021-05-09 15:59:41 +02:00
Giacomo Leidi f5ba924e92 Versioning will be handled elsewhere. 2021-05-09 15:57:04 +02:00
Simone Robutti 23be6d8812
Merge pull request #6 from Tech-Workers-Coalition-Italia/event_selector
Event selector
2021-05-09 15:45:08 +02:00
Simone Robutti 136ba12205 removed unused import 2021-05-09 15:41:11 +02:00
Simone Robutti 214e2a0c3b added more tests 2021-05-05 14:37:19 +02:00
Simone Robutti 4f194ab01c added tests for strategy 2021-05-05 14:29:13 +02:00
Simone Robutti 3fe3c8efc6 added event selector (w/o tests) 2021-05-04 22:58:00 +02:00
Simone Robutti e938ba709b added begins_before 2021-05-04 12:07:59 +02:00
Simone Robutti 821f2a6435 added jinja 2021-05-04 11:48:54 +02:00
Giacomo Leidi 218e228e6a pyproject.toml: Update pytest to 5.3. 2021-05-03 19:51:19 +02:00
Giacomo Leidi 6a51dc86ee mobilizon_bots: Configure logger with dynaconf.
* mobilizon_bots/cli.py: New file.
* mobilizon_bots/config.py: Minor tweaks.
* mobilizon_bots/settings.toml: Downcase variables, drop jinja2
templating in favor of format, add logging configuration.
2021-05-03 19:48:04 +02:00
Giacomo Leidi 0d02f2dd52 Init configuration 2021-05-03 18:31:37 +02:00
Simone Robutti 44c3f57365 added event class and format 2021-05-03 17:26:34 +02:00
Simone Robutti 6273e56311 restructured folders 2021-05-03 15:11:22 +02:00
Simone Robutti 559a5d4e64
Merge pull request #3 from Tech-Workers-Coalition-Italia/storage
Init storage.
2021-05-02 18:49:52 +02:00
Giacomo Leidi ab69908a66 Init storage. 2021-05-02 18:44:08 +02:00
Simone Robutti d78ab809a7 updated to python 3.9 2021-05-02 18:33:13 +02:00
Simone Robutti 5c9f5d37cd
Merge pull request #2 from Tech-Workers-Coalition-Italia/publishers-dev
Publishers dev
2021-05-02 18:10:41 +02:00
Simone Robutti 06f2f3343b added .idea to .gitignore 2021-05-02 16:43:17 +02:00
Simone Robutti df837b17b6 changed visiblity log methods in publisher 2021-05-02 11:27:07 +02:00
Simone Robutti a45c2c19ec added test predicates 2021-05-02 11:23:31 +02:00
Simone Robutti fabc1e7eff added predicates 2021-05-02 10:47:38 +02:00
Simone Robutti fb00516d6c reworked validation 2021-05-02 10:37:46 +02:00
Simone Robutti a6a14d2689 changed logger to be more pythonic 2021-05-02 10:24:46 +02:00
ComradeSlyK b60971206f Add abstract functioning for publishers, mock-up for Telegram publisher 2021-05-02 10:07:52 +02:00
Simone Robutti 07bba0f752 added README for pre-commit 2021-04-25 11:13:59 +02:00
Simone Robutti f3bd228510 added .gitignore and pre-commit 2021-04-25 11:10:47 +02:00
Simone Robutti d61ad2537d first commit 2021-04-18 16:10:45 +02:00