Ejemplo n.º 1
0
 def no_auth(cls, informer, command_name, user_ID=None):
     commands.inform(
         informer,
         admin.whisper_text(
             "You are not authorised to use the "
             "command, %s." % command_name, informer
             in messages.coloured_informers), user_ID)
Ejemplo n.º 2
0
 def disabled(cls, informer, command_name):
     commands.inform(
         informer,
         admin.whisper_text(
             "Command, %s, is currently "
             "disabled." % command_name, informer
             in messages.coloured_informers))
Ejemplo n.º 3
0
 def _callback(self, args, informer=None, user_ID=None):
     if not self.menu_interface:
         self.callback(args,
                       informer=informer,
                       user_ID=user_ID,
                       by_menu=False)
         return
     defaults = [
         parameter.default_value
         if parameter.default_value is not commands.ABSENT else None
         for parameter in self.callback.parameters
     ]
     for index, value in enumerate(args[:]):
         if value == defaults[index]:
             args.remove(value)
     self.parameters[len(args)].menu.send(user_ID)
     args.insert(0, self.basename)
     menus.Menu.players[user_ID].identifiers.extend(args)
     if informer == commands.ClientConsoleCommand.INFORMER:
         commands.inform(
             informer,
             admin.whisper_text(
                 "You have been sent a menu "
                 "where you can select a value "
                 "for the next parameter.", informer
                 in messages.coloured_informers))
     return
Ejemplo n.º 4
0
 def no_auth(cls, informer, command_name, user_ID=None):
     commands.inform(informer,
                     admin.whisper_text("You are not authorised to use the "
                                        "command, %s." % command_name,
                                        informer in
                                        messages.coloured_informers),
                     user_ID)
Ejemplo n.º 5
0
 def invalid_value(cls, informer, command_name, parameter, arg,
                   user_ID=None):
     commands.inform(informer,
                     admin.whisper_text("Invalid value, %s, for "
                                        "parameter, %s." %(arg,
                                        parameter.basename),
                                        informer in
                                        messages.coloured_informers),
                     user_ID)
Ejemplo n.º 6
0
 def invalid_value(cls,
                   informer,
                   command_name,
                   parameter,
                   arg,
                   user_ID=None):
     commands.inform(
         informer,
         admin.whisper_text(
             "Invalid value, %s, for "
             "parameter, %s." % (arg, parameter.basename), informer
             in messages.coloured_informers), user_ID)
Ejemplo n.º 7
0
 def _invalid_syntax_callback(self, informer, command_name, parameters,
                              args, user_ID=None):
     total_args = len(args)
     if not self.menu_interface or total_args > len(parameters):
         commands.inform(informer,
                         admin.whisper_text("Invalid syntax for command, "
                                            "%s." % command_name,
                                            informer in
                                            messages.coloured_informers),
                         user_ID)
     else:
         self.parameters[total_args].menu.send(user_ID)
         args.insert(0, self.basename)
         menus.Menu.players[user_ID].identifiers.extend(args)
Ejemplo n.º 8
0
 def _invalid_syntax_callback(self,
                              informer,
                              command_name,
                              parameters,
                              args,
                              user_ID=None):
     total_args = len(args)
     if not self.menu_interface or total_args > len(parameters):
         commands.inform(
             informer,
             admin.whisper_text(
                 "Invalid syntax for command, "
                 "%s." % command_name, informer
                 in messages.coloured_informers), user_ID)
     else:
         self.parameters[total_args].menu.send(user_ID)
         args.insert(0, self.basename)
         menus.Menu.players[user_ID].identifiers.extend(args)
Ejemplo n.º 9
0
 def _callback(self, args, informer=None, user_ID=None):
     if not self.menu_interface:
         self.callback(args, informer=informer, user_ID=user_ID,
                       by_menu=False)
         return
     defaults = [parameter.default_value if parameter.default_value
                 is not commands.ABSENT else None
                 for parameter in self.callback.parameters]
     for index, value in enumerate(args[:]):
         if value == defaults[index]:
             args.remove(value)
     self.parameters[len(args)].menu.send(user_ID)
     args.insert(0, self.basename)
     menus.Menu.players[user_ID].identifiers.extend(args)
     if informer == commands.ClientConsoleCommand.INFORMER:
         commands.inform(informer,
                         admin.whisper_text("You have been sent a menu "
                                            "where you can select a value "
                                            "for the next parameter.",
                                            informer in
                                            messages.coloured_informers))
     return
Ejemplo n.º 10
0
 def disabled(cls, informer, command_name):
     commands.inform(informer,
                     admin.whisper_text("Command, %s, is currently "
                                        "disabled." % command_name,
                                        informer in
                                        messages.coloured_informers))