def handle_noargs(self, **options): verbosity = options.get('verbosity', 1) conn = Connection(connect=False) try: conn.connect() except ConnectError: raise CommandError('Could not connect to the newsserver.') else: conn.update(self.logger_function) finally: conn.disconnect()
def get_conn(self): conn = Connection(connect=False) conn._nntp = Mock() return conn