Exemple #1
0
 def _error_no_facility_code(self, opcode):
     '''
     Return a MessageEffect that indicates a failure as a result of
     the arguments being empty.
     '''
     return error(_("Error Parsing %(op_code)s Arguments"),
                  {'op_code': opcode}, _("Must provide a facility code."),
                  {})
 def _error_no_opcode(self, opcode, arg_string):
     '''
     Return a MessageEffect that indicates a failure as a result of
     the arguments being empty.
     '''
     return error(
         _("Error Parsing %(op_code)s Arguments"), { 'op_code': opcode },
         _("Must request a specific operation code."), {}
     )
 def _error_extra_chars(self, opcode, arg_string):
     '''
     Return a MessageEffect that indicates a failure as a result of
     the arguments having extra chars after the requested opcode.
     '''
     return error(
         _("Error Parsing %(op_code)s Arguments"), { 'op_code': opcode },
         _("Text after requested operation code not allowed."), {}
     )
 def _error_missing_digits(self, opcode):
     '''
     Return a MessageEffect that indicates a failure as a result of
     the arguments missing numbers after the fridge tag.
     '''
     return error(
         _("Error Parsing %(op_code)s Arguments"), { 'op_code': opcode },
         _("Expected the number of temperature events."), {}
     )
 def _error_extra_chars(self, opcode):
     '''
     Return a MessageEffect that indicates a failure as a result of
     the arguments having extra chars after the equipment_id.
     '''
     return error(
         _("Error Parsing %(op_code)s Arguments"), { 'op_code': opcode },
         _("Text after equipment ID not allowed."), {}
     )
 def _error_missing_fridge_tag(self, opcode):
     '''
     Return a MessageEffect that indicates a failure as a result of
     the arguments haveing numbers with missing fridge tags.
     '''
     return error(
         _("Error Parsing %(op_code)s Arguments"), { 'op_code': opcode },
         _("Expected a fridge tag."), {}
     )
 def _error_duplicate_fridge(self, opcode):
     '''
     Return a MessageEffect that indicates a failure as a result of
     the arguments having duplicate fridge tags.
     '''
     return error(
         _("Error Parsing %(op_code)s Arguments"), { 'op_code': opcode },
         _("Duplicate fridge tag."), {}
     )
Exemple #8
0
 def _error_extra_chars(self, opcode, arg_string):
     '''
     Return a MessageEffect that indicates a failure as a result of
     the arguments having extra chars after the facility code.
     '''
     return error(
         _("Error Parsing %(op_code)s Arguments"), {'op_code': opcode},
         _("Text after facility code in %(arg_string)s not allowed."),
         {'arg_string': arg_string})
 def _error_unrecognized_chars(self, opcode, arg_string):
     '''
     Return a MessageEffect that indicates a failure as a result of
     the arguments containing unrecognized characters in the argument string
     instead of an opcode.
     '''
     return error(
         _("Error Parsing %(op_code)s Arguments"), { 'op_code': opcode },
         _("Should start with a complete operation code."), {}
     )
Exemple #10
0
 def _error_unrecognized_chars(self, opcode, arg_string):
     '''
     Return a MessageEffect that indicates a failure as a result of
     the arguments containing unrecognized characters in the argument string
     instead of an facility code.
     '''
     return error(_("Error Parsing %(op_code)s Arguments"),
                  {'op_code': opcode},
                  _("Should provide a facility code, not %(arg_string)s."),
                  {'arg_string': arg_string})
def help_semantic(sender, message, opcode, requested_opcode, **named_args):
    if requested_opcode not in settings.SIM_OPERATION_CODES.keys():
        effect = error(
            _("Error Interpreting %(op_code)s Arguments"), { 'op_code': opcode},
            _("Requested help for unrecognized operation %(requested_opcode)s."), { 'requested_opcode': requested_opcode }            
        )
    else:
        effect = info(
            _("Verified %(op_code)s Arguments"), { 'op_code': opcode },
            _("Requested help for operation %(requested_opcode)s."), { 'requested_opcode': requested_opcode }
        )

    return [effect]