Skip to content

Commit

Permalink
Added len() support
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed May 13, 2023
1 parent c71c0b8 commit eb3e162
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apprise/plugins/NotifyPlivo.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,16 @@ def url(self, privacy=False, *args, **kwargs):
[NotifyPlivo.quote(x, safe='') for x in self.targets]),
args=NotifyPlivo.urlencode(args))

def __len__(self):
"""
Returns the number of targets associated with this notification
"""
#
# Factor batch into calculation
#
targets = len(self.targets)
return targets if targets > 0 else 1

@staticmethod
def parse_url(url):
"""
Expand Down

0 comments on commit eb3e162

Please sign in to comment.