comparison src/plugins/plugin_xep_0249.py @ 1373:6d0e01809893

plugin text commands: minor docstrings improvments
author Goffi <goffi@goffi.org>
date Thu, 19 Mar 2015 14:41:15 +0100
parents 876c9fbd0b3d
children 73f8582c7c99
comparison
equal deleted inserted replaced
1372:85caf0a3abb3 1373:6d0e01809893
166 self.host.askConfirmation(room_jid_s, "YES/NO", data, accept_cb, profile) 166 self.host.askConfirmation(room_jid_s, "YES/NO", data, accept_cb, profile)
167 167
168 def cmd_invite(self, mess_data, profile): 168 def cmd_invite(self, mess_data, profile):
169 """invite someone in the room 169 """invite someone in the room
170 170
171 @command (group): (JID) 171 @command (group): JID
172 - JID: the JID of the person to invite 172 - JID: the JID of the person to invite
173 """ 173 """
174 jid_s = mess_data["unparsed"].strip() 174 jid_s = mess_data["unparsed"].strip()
175 try: 175 try:
176 assert(jid_s) 176 assert jid_s
177 jid_ = jid.JID(jid_s) 177 jid_ = jid.JID(jid_s)
178 assert(jid_.user) 178 assert jid_.user
179 assert(jid_.host) 179 assert jid_.host
180 except (jid.InvalidFormat, AssertionError): 180 except (jid.InvalidFormat, AssertionError):
181 feedback = _(u"You must provide a valid JID to invite, like in '/invite contact@example.net'") 181 feedback = _(u"You must provide a valid JID to invite, like in '/invite contact@example.net'")
182 self.host.plugins[C.TEXT_CMDS].feedBack(feedback, mess_data, profile) 182 self.host.plugins[C.TEXT_CMDS].feedBack(feedback, mess_data, profile)
183 return False 183 return False
184 184