def __call__(self, pattern):
    action = self.replacement.get(pattern, None)
    if (action is None):
        logging.error("%s: unknown replacement pattern '%s'", self.project.name, pattern)
        return ''
    elif callable(action):
        return action()
    else:
        return action
def __call__(self, pattern):
    action = self.replacement.get(pattern, None)
    if (action is None):
        logging.error("%s: unknown replacement pattern '%s'", self.project.name, pattern)
        return 
    elif callable(action):
        return action()
    else:
        return action