From cdd1137efde44f8c61974aa59e320bd4d7b9e50c Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Fri, 15 Feb 2019 12:32:14 -0500 Subject: [PATCH] Tag clarification --- Development_API.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/Development_API.md b/Development_API.md index eb62765..4a95ce2 100644 --- a/Development_API.md +++ b/Development_API.md @@ -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: ```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: # - json://localhost/tagCD/ # - json://localhost/tagCDE/ 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 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: # - json://localhost/tagAB/ 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: # - json://localhost/tagCDE/ # - json://localhost/tagAB/ @@ -111,10 +127,10 @@ You could look at the **apprise.notify()** logic like this: | tag= | Tag Representation | | ------------------------- | ------------------------ | -| "TagA, TagB" | TagA **or** TagB -| ['TagA', 'TagB'] | TagA **or** TagB -| [('TagA', 'TagC'), 'TagB']| (TagA **and** TagC) **or** TagB -| [('TagB', 'TagC')] | TagB **and** TagC +| "TagA, TagB" | TagA **OR** TagB +| ['TagA', 'TagB'] | TagA **OR** TagB +| [('TagA', 'TagC'), 'TagB']| (TagA **AND** TagC) **OR** TagB +| [('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: