示例#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."),
                  {})
示例#2
0
 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."), {}
     )
示例#3
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 requested opcode.
     '''
     return error(
         _("Error Parsing %(op_code)s Arguments"), { 'op_code': opcode },
         _("Text after requested operation code not allowed."), {}
     )
示例#4
0
 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."), {}
     )
示例#5
0
 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."), {}
     )
示例#6
0
 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."), {}
     )
示例#7
0
 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."), {}
     )
示例#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})
示例#9
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 opcode.
     '''
     return error(
         _("Error Parsing %(op_code)s Arguments"), { 'op_code': opcode },
         _("Should start with a complete operation code."), {}
     )
示例#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})
示例#11
0
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]