* Update beautifulsoup4 to 4.11.
* Update docker image.
* Add type annotations.
* Publish where you can and notify errors.
* Add tests for partial publishing.
* Drop dependency on python-telegram-bot, as it's not used.
* Align default templates.
This patch tries to bring some consistency to the default templates and
fixes some small bug in the output of some formatters.
* Add pull command.
* Add publish command.
* Enforce start's old semantics.
* Add pull test cases:
- Pull with no events anywhere
- Pull with one event on mobilizon and none on the db
- Pull with one event on mobilizon and another on the db
- Pull with one event on mobilizon and the same event on the db
* Add pull tests:
- Sequence: pull->start
- Sequence: start->pull
- Sequence: pull->new event on mobilizon -> pull
* manifest.scm: Add cloc.
* query: read: Prefer return list to generators.
* tests: pull: Actually test that models are written to the DB.
* added timezone fixture
* Make output dependent on local timezone.
* Fix non deterministic behavior in html to text conversion.
Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
* add column last_update_time
* save last_update_time in event db record
* use id + updatedAt for comparison instead of mobilizon_id, this will treat updated events like new ones
* rework event selection/comparison to include unpublished with updates to ones need to be saved
* added update for unpublished events
* tests: test_update: Add create_unpublished_events tests.
* Move `MobilizonEvent.to_model` to `storage.query`
* Move `MobilizonEvent.from_model` to `storage.query`
* Move `MobilizonEvent.compute_status` to `storage.query`
* Move `publishers.exception.EventNotFound` to `storage.query.exceptions`
* config: get_settings_files_paths: Return first existing path.
* tests: Set SETTINGS_FOR_DYNACONF at import time.
* config: get_settings_files_paths: Log config path.
* manifest.scm: Add docker-compose.
* build_docker_image.sh: Allow building debug image.
* storage: db: Use the same configuration for Tortoise and Aerich.
* Distribuite migration queries.
* storage: implement_db_changes: Use pkg_resources.
Now the inspect command can display informations about
different kind of objects including events and publications.
This patch also changes the cli to output columnar values
suitable for further processing with standard Unix
tool, such as awk.
$ mobilizon-reshare.sh inspect publication -s completed | awk '{ print }' | sort | uniq -c
[2021-12-01 01:05:55,321] [20] [INFO] Tortoise-ORM shutdown
2 mastodon
2 telegram
2 zulip
* filtering publications with inactive publishers
* filtering publications with inactive publishers
* WIP: Generate publications at runtime.
TODO:
- change `MobilizonEvent.compute_status`'s contract and break everything
- while we're at it we should remove `PublicationStatus.WAITING`
- test `storage.query.create_publications_for_publishers`
* cli: inspect_events: Unnest if-then-else.
* publishers: abstract: Remove `EventPublication.make`.
* fixed tests
* split query.py file
* added tests for get_unpublished_events
* added tests
* more tests
* added start test
* refactored start test
* added test start with db event
* added test recap
* added failed publication test
* added format test
Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
* Add Mastodon publisher.
This commit enables publishing on Mastodon and tries to define the
minimal requirements for adding a new platform to Mobilizon Reshare.
* publishers: exceptions: Add HTTPError.
* platforms: mastodon: Make toot length customizable.
* added basic recap feature (no error handling)
* introduced abstractpublication
* extracted base reports
* added error report to recap
* added test
* added docs
* implemented publisher and formatter
* fixed API for recap
* removed redundant config validation
* added config sample
* added mobilizon link to templates
* added link format to telegram
* added mobilizon link to recap
* fixed config and emoji