diff frontends/src/jp/cmd_event.py @ 2291:c05000d00dbb

plugin events, invitations + jp (event/create, invitation/invitee/invite): several emails addresses can now be specified for a single invitation: if several addresses are specified, the same invitation (same ID and data) is sent to all the addresses
author Goffi <goffi@goffi.org>
date Fri, 30 Jun 2017 00:04:47 +0200
parents f4d8d83a50e2
children a3cd2ac25d58
line wrap: on
line diff
--- a/frontends/src/jp/cmd_event.py	Fri Jun 30 00:02:16 2017 +0200
+++ b/frontends/src/jp/cmd_event.py	Fri Jun 30 00:04:47 2017 +0200
@@ -204,7 +204,7 @@
 
     def add_parser_options(self):
         self.parser.add_argument("-i", "--item", type=base.unicode_decoder, default=u'', help=_(u"ID of the PubSub Item"))
-        self.parser.add_argument("-e", "--email", type=base.unicode_decoder, default='', help='email to send the invitation to (if --no-email is set, email will just be saved)')
+        self.parser.add_argument("-e", "--email", action="append", type=base.unicode_decoder, default=[], help='email(s) to send the invitation to')
         self.parser.add_argument("-n", "--name", type=base.unicode_decoder, default='', help='name of the invitee')
         self.parser.add_argument("-N", "--host-name", type=base.unicode_decoder, default='', help='name of the host')
         self.parser.add_argument("-l", "--lang", type=base.unicode_decoder, default='', help='main language spoken by the invitee')
@@ -214,12 +214,15 @@
 
     def start(self):
         common.checkURI(self.args)
+        email = self.args.email[0] if self.args.email else None
+        emails_extra = self.args.email[1:]
 
         self.host.bridge.eventInvite(
             self.args.service,
             self.args.node,
             self.args.item,
-            self.args.email,
+            email,
+            emails_extra,
             self.args.name,
             self.args.host_name,
             self.args.lang,