@classmethod<EOL><INDENT>def needsconnection(self, f):<DEDENT>
@wraps(f)<EOL>def wrapper(self, *args, **kwargs):<EOL><INDENT>if not self.connection:<EOL><INDENT>self.connect()<EOL><DEDENT>return f(self, *args, **kwargs)<EOL><DEDENT>return wrapper<EOL>
Decorator used to make sure that the connection has been established.