Comments (6)
I think it's either make a compromise like either of our suggestions, or create a V2 config file format and redesign it with the new requirements in mind, supporting both formats for now.
I would probably go with a compromise and your option looks good. I'll propose an implementation based on the tagging at some point, when I next get a chance to look at it.
from urlwatch.
In general, it's a good idea. And as long as the existing format is still supported, that shouldn't affect existing users.
Not too happy with "reporters" below "report".
We could do it without an additional key. By default, each immediate child (e.g. email
) of "report" has as immediate child a dict (e.g. email
has a dict with enabled
, from
, to
, ...). If we add support for a list-of-dicts below each reporter, that could do the trick:
report:
text: # Still have these for inheritance
details: true
footer: true
line_length: 75
minimal: false
html:
diff: unified
email:
- enabled: true
from: [email protected]
to: [email protected]
method: sendmail
tags: tag1
- enabled: true
from: [email protected]
to: [email protected]
method: sendmail
tags: tag2
html: true
stdout:
color: true
enabled: true
telegram: # Still support dict format
bot_token: ''
chat_id: ''
enabled: false
This would probably be the least intrusive (no new keys), and should be super simple to check (if the immediate child is a dict, treat it as a single config, otherwise if it's a list, treat it as list of multiple configs).
Certain shared/superclass configs (e.g. text
and html
) obviously wouldn't have the possibility to be specified as list, as there can only be one. Then again, what if you want to have e.g. different text
reporter configurations for each of the multiple e-mail reporters defined? This proposal doesn't support that, but maybe that's okay for a first version?
from urlwatch.
Great, I like the compromise (backwards compatible) variant better, because it means less disruption for existing users. And maybe you can split the possible PRs into two, once that adds multiple reporter configs, and then after that's been merged, a separate on that adds tagging on top (or I guess tagging could be done first, as these are mostly independent?).
from urlwatch.
I did tagging first because I already had that PR in flight :)
from urlwatch.
WIP on this, for after tags are merged in: https://github.com/thp/urlwatch/compare/master...Jamstah:multiple-reporters?expand=1
from urlwatch.
WIP on this, for after tags are merged in: https://github.com/thp/urlwatch/compare/master...Jamstah:multiple-reporters?expand=1
Tags is now merged if you want to tackle this, too.
from urlwatch.
Related Issues (20)
- Reporting blanks HOT 28
- add support to specify multiple recipients per URL HOT 7
- YAML Anchors/Aliases not working HOT 4
- CSS Filter "AttributeError: 'CSSSelector' object has no attribute 'evaluate'" HOT 2
- Meaning of max_tries is confusing
- urlwatch stopped working HOT 4
- sendmail is not documented HOT 2
- Randomly "not enough values to unpack" Python errors HOT 4
- Cache inconsistency creating new items from nowhere HOT 3
- Feature request: Extension of regex filtering to extract data HOT 7
- Consider releasing version 2.29 HOT 5
- Question - Report http errors only once HOT 5
- urlwatch 2.25-1 on Debian Stable 12.5 (navigate fails) HOT 3
- Enable/disable job from the command line HOT 1
- urlwatch moans when supplying --config HOT 1
- urlwatch 2.25 - AttributeError: 'list' object has no attribute 'read' HOT 2
- XML parsing with CDATA not working HOT 6
- urlwatch 2.28: html: separate: true not sending separate emails HOT 2
- --test-filter works but not with a normal execution HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urlwatch.