Ejemplo n.º 1
0
 def init_commands(self):
     return [
         InteractiveModuleCommand(keyword='listuser',
                                  callback=self.list_user,
                                  location=Location.QUERY,
                                  role=Role.ADMIN),
         InteractiveModuleCommand(keyword='adduser',
                                  callback=self.insert_user,
                                  location=Location.QUERY,
                                  role=Role.ADMIN,
                                  pattern=r'^$',
                                  syntaxhint='???'),
         InteractiveModuleCommand(keyword='chguser',
                                  callback=self.change_user,
                                  location=Location.QUERY,
                                  role=Role.ADMIN,
                                  pattern=r'^$',
                                  syntaxhint='???'),
         InteractiveModuleCommand(keyword='deluser',
                                  callback=self.delete_user,
                                  location=Location.QUERY,
                                  role=Role.ADMIN,
                                  pattern=r'^$',
                                  syntaxhint='???')
     ]
Ejemplo n.º 2
0
 def init_commands(self):
     return [
         InteractiveModuleCommand(
             keyword='nick',
             callback=self.change_nickame,
             location=Location.QUERY,
             role=Role.ADMIN,
             pattern=r'^$',
             syntaxhint='???'
         ),
         InteractiveModuleCommand(
             keyword='join',
             callback=self.join_channel,
             location=Location.QUERY,
             role=Role.ADMIN,
             pattern=r'^$',
             syntaxhint='???'
         ),
         InteractiveModuleCommand(
             keyword='part',
             callback=self.part_channel,
             location=Location.QUERY,
             role=Role.ADMIN, 
             pattern=r'^$',
             syntaxhint='???'
         ),
         InteractiveModuleCommand(
             keyword='quit',
             callback=self.quit,
             location=Location.QUERY,
             role=Role.ADMIN,
             pattern=r'^$',
             syntaxhint='???'
         )
     ]
Ejemplo n.º 3
0
 def init_commands(self):
     return [
         InteractiveModuleCommand(keyword='wer',
                                  callback=self.who,
                                  location=Location.CHANNEL),
         InteractiveModuleCommand(
             keyword='decide',
             callback=self.decide,
             pattern=r'^((.+)$|$)',
             syntaxhint='[Auswahl1[, [Auswahl2[, ...]]]]'),
         InteractiveModuleCommand(keyword='makemyday',
                                  callback=self.sort,
                                  pattern=r'^(.+)$',
                                  syntaxhint='[Item1[, Item2[, ...]]]')
     ]
Ejemplo n.º 4
0
 def init_commands(self):
     return [
         InteractiveModuleCommand(
             keyword='roll',
             callback=self.roll,
             pattern=r'^([\d]+)(?:-([\d]+))?$',
             syntaxhint='zahl[-zahl]'
         )
     ]
Ejemplo n.º 5
0
 def init_commands(self):
     return [
         InteractiveModuleCommand(keyword='topic',
                                  callback=self.display_current_topic),
         InteractiveModuleCommand(keyword='settopic',
                                  callback=self.set_new_topic,
                                  pattern=r'^(.+)$',
                                  syntaxhint='<new topic>'),
         InteractiveModuleCommand(keyword='addtopic',
                                  callback=self.add_new_addition,
                                  pattern=r'^(.+)$',
                                  syntaxhint='<addition>'),
         InteractiveModuleCommand(keyword='deltopic',
                                  callback=self.del_addition,
                                  pattern=r'^(.+)$',
                                  syntaxhint=r'<id>'),
         InteractiveModuleCommand(keyword='listtopic',
                                  callback=self.display_topic_additions)
     ]
Ejemplo n.º 6
0
 def init_commands(self):
     """
     Declare all commands of the module.
     """
     return [
         InteractiveModuleCommand(keyword='addquote',
                                  callback=self.add_new_quote,
                                  pattern=r'^(.+)$',
                                  syntaxhint='<text>'),
         InteractiveModuleCommand(keyword='delquote',
                                  callback=self.del_quote,
                                  pattern=r'^(\d+)$',
                                  syntaxhint='<id>'),
         InteractiveModuleCommand(keyword='quote',
                                  callback=self.display_quote,
                                  pattern=r'^(.+)$|^$',
                                  syntaxhint='<id|text>'),
         InteractiveModuleCommand(keyword='searchquote',
                                  callback=self.search_quotes,
                                  pattern=r'^(.+)$',
                                  syntaxhint='<text>')
     ]
Ejemplo n.º 7
0
 def init_commands(self):
     return [
         InteractiveModuleCommand(
             keyword='kalender',
             callback=self.display_calendar_address,
         ),
         InteractiveModuleCommand(
             keyword='listtoday',
             callback=self.display_events_today,
         ),
         InteractiveModuleCommand(keyword='listdeleted',
                                  callback=self.display_deleted_objects,
                                  pattern=r'^(.*)$',
                                  syntaxhint='[kalendar|event|kontakt]'),
         InteractiveModuleCommand(keyword='restore',
                                  callback=self.restore_deleted_object,
                                  pattern=r'^[\d]+$',
                                  syntaxhint='<id>'),
         InteractiveModuleCommand(
             keyword='addevent',
             callback=self.insert_event,
             pattern=
             r'^(\d{1,2}\.\d{1,2}\.\d{4}|\d{1,2}\.\d{1,2}\.\d{4}-\d{1,2}\.\d{1,2}\.\d{4})\s(.+)$',
             syntaxhint='<datumvon>[-datumbis] <titel>'),
         InteractiveModuleCommand(
             keyword='editevent',
             callback=self.change_event,
             pattern=r'^([\d]+)\s(.+?)\s(.+)$',
             syntaxhint='<id> <start|ende|titel|beschreibung|ort> <wert>'),
         InteractiveModuleCommand(
             keyword='delevent',
             callback=self.delete_event,
             pattern=r'^([\d]+|\d{1,2}\.\d{1,2}\.\d{4})$',
             syntaxhint='<id|datum>'),
         InteractiveModuleCommand(keyword='searchevent',
                                  callback=self.search_event,
                                  pattern=r'^(.+)$',
                                  syntaxhint='<text>'),
         InteractiveModuleCommand(keyword='topicevent',
                                  callback=self.topic_event,
                                  pattern=r'^[\d]+$',
                                  syntaxhint='<id>'),
         InteractiveModuleCommand(
             keyword='addcontact',
             callback=self.insert_contact,
             pattern=r'^(.+)\s(\d{1,2}\.\d{1,2}\.\d{4})$',
             syntaxhint='<nickname> <geburtsdatum>'),
         InteractiveModuleCommand(
             keyword='editcontact',
             callback=self.change_contact,
             pattern=r'^[\d]+\s(.+)\s(.+)$',
             syntaxhint=
             '<id> <vorname|nachname|nickname|geburtsdatum> <wert>'),
         InteractiveModuleCommand(keyword='delcontact',
                                  callback=self.delete_contact,
                                  pattern=r'^([\d]+|(.+))$',
                                  syntaxhint='<id>'),
         InteractiveModuleCommand(keyword='searchcontact',
                                  callback=self.search_contact,
                                  pattern=r'^(.+)$',
                                  syntaxhint='<text>')
     ]