Exemple #1
0
def registerMessageHandler(format, function, module = None, implicit = False, noIgnore = False):
    if format == None:
        parsedFormat = None
    else:
        parsedFormat = stringmatcher.parseFormat(format)
    registration = _registerHandler(function, module, _messageHandlers)
    registration.format = parsedFormat
    registration.implicit = implicit
    registration.noIgnore = noIgnore
    return registration
Exemple #2
0
def registerFunction(format, function, syntax = None, module = None, implicit = False, restricted = False, errorMessages = True, noIgnore = False):
    parsedFormat = stringmatcher.parseFormat(format)
    registration = _registerHandler(function, module, _functionHandlers)
    registration.format = parsedFormat
    registration.description = function.__doc__
    registration.syntax = syntax
    registration.syntaxErrorMessage = None
    registration.implicit = implicit
    registration.restricted = restricted
    registration.restrictedErrorMessage = None
    registration.errorMessages = errorMessages
    registration.noIgnore = noIgnore
    return registration