mirror of
https://github.com/caronc/apprise.git
synced 2024-12-12 18:01:08 +01:00
Tag clarification
parent
416d57b54e
commit
cdd1137efd
@ -81,22 +81,38 @@ a.add('json://localhost/tagCDE/', tag=set(["TagC", "TagD", "TagE"]))
|
|||||||
|
|
||||||
Now that we've added our services and assigned them tags, this is how we can access them:
|
Now that we've added our services and assigned them tags, this is how we can access them:
|
||||||
```python
|
```python
|
||||||
# Expression: TagC and TagD
|
# Notify services associated with tag: TagA
|
||||||
|
# Matches the following only:
|
||||||
|
# - json://localhost/tagA/
|
||||||
|
# - json://localhost/tagAB/
|
||||||
|
a.notify(title="my title", body="my body", tag='TagA')
|
||||||
|
|
||||||
|
# Notify services associated with tag: TagA OR TagB
|
||||||
|
# Matches the following only:
|
||||||
|
# - json://localhost/tagA/
|
||||||
|
# - json://localhost/tagAB/
|
||||||
|
# - json://localhost/tagB/
|
||||||
|
a.notify(title="my title", body="my body", tag=['TagA', 'TagB'])
|
||||||
|
|
||||||
|
# The AND requires you nest an additional list/tuple/set inside
|
||||||
|
# your tag list...
|
||||||
|
|
||||||
|
# Notify services associated with tags: TagC AND TagD
|
||||||
# Matches the following only:
|
# Matches the following only:
|
||||||
# - json://localhost/tagCD/
|
# - json://localhost/tagCD/
|
||||||
# - json://localhost/tagCDE/
|
# - json://localhost/tagCDE/
|
||||||
a.notify(title="my title", body="my body", tag=[('TagC', 'TagD')])
|
a.notify(title="my title", body="my body", tag=[('TagC', 'TagD')])
|
||||||
|
|
||||||
# Expression: (TagY and TagZ) or TagX
|
# Notify services associated with tags: (TagY AND TagZ) OR TagX
|
||||||
# Matches nothing
|
# Matches nothing
|
||||||
a.notify(title="my title", body="my body", tag=[('TagY', 'TagZ'), 'TagX'])
|
a.notify(title="my title", body="my body", tag=[('TagY', 'TagZ'), 'TagX'])
|
||||||
|
|
||||||
# Expression: (TagY and TagZ) or TagA
|
# Notify services associated with tags: (TagY AND TagZ) OR TagA
|
||||||
# Matches the following only:
|
# Matches the following only:
|
||||||
# - json://localhost/tagAB/
|
# - json://localhost/tagAB/
|
||||||
a.notify(title="my title", body="my body", tag=[('TagY', 'TagZ'), 'TagA'])
|
a.notify(title="my title", body="my body", tag=[('TagY', 'TagZ'), 'TagA'])
|
||||||
|
|
||||||
# Expression: (TagE and TagD) or TagB
|
# Notify services associated with tags: (TagE AND TagD) OR TagB
|
||||||
# Matches the following only:
|
# Matches the following only:
|
||||||
# - json://localhost/tagCDE/
|
# - json://localhost/tagCDE/
|
||||||
# - json://localhost/tagAB/
|
# - json://localhost/tagAB/
|
||||||
@ -111,10 +127,10 @@ You could look at the **apprise.notify()** logic like this:
|
|||||||
|
|
||||||
| tag= | Tag Representation |
|
| tag= | Tag Representation |
|
||||||
| ------------------------- | ------------------------ |
|
| ------------------------- | ------------------------ |
|
||||||
| "TagA, TagB" | TagA **or** TagB
|
| "TagA, TagB" | TagA **OR** TagB
|
||||||
| ['TagA', 'TagB'] | TagA **or** TagB
|
| ['TagA', 'TagB'] | TagA **OR** TagB
|
||||||
| [('TagA', 'TagC'), 'TagB']| (TagA **and** TagC) **or** TagB
|
| [('TagA', 'TagC'), 'TagB']| (TagA **AND** TagC) **OR** TagB
|
||||||
| [('TagB', 'TagC')] | TagB **and** TagC
|
| [('TagB', 'TagC')] | TagB **AND** TagC
|
||||||
|
|
||||||
By default, all notifications are sent as type **NotifyType.INFO** using the _default_ theme. The following other types are included with this theme:
|
By default, all notifications are sent as type **NotifyType.INFO** using the _default_ theme. The following other types are included with this theme:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user