def check_page(fn):
@wraps(fn)<EOL>def wrapper(self, *args, **kwargs):<EOL><INDENT>if not self.page and not kwargs.get('<STR_LIT>'):<EOL><INDENT>self.error("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>return fn(self, *args, **kwargs)<EOL><DEDENT><DEDENT>return wrapper<EOL>
Decorator to protect drawing methods