def write_begin_end(message):
    """Decorator factory, returning a begin-end decorator with the desired message.
    Can only be used on functions of a class that has self.write_end and self.write_begin.
    Usage:
    @write_begin_end('Summary')
    def _write_summary(self):
    ...
    """
    def decorator(func_to_be_wrapped):
        """Decorator, returning a wrapped function
        """
        def wrapper(self, *args, **kwargs):
            """The wrapped function
            """
            self.write_begin(message)
            func_to_be_wrapped(self, *args, **kwargs)
            self.write_end(message)
        return wrapper
    return decorator