def action_stop(options, irc_manager): connection = options.irc_connection try: console('Stopping irc connection %s. It may take a short while.' % connection) irc_manager.stop_connections(wait=False, name=connection) console( 'Successfully stopped {0}. Use `flexget irc status {0}` to check its status.'.format(connection or 'all')) except KeyError: console('ERROR: %s is not a valid irc connection' % connection)
def get(self, session=None): """Stops IRC connections""" from flexget.plugins.daemon.irc import irc_manager if irc_manager is None: raise BadRequest('IRC daemon does not appear to be running') args = irc_stop_parser.parse_args() name = args.get('name') wait = args.get('wait') try: irc_manager.stop_connections(wait=wait, name=name) except KeyError: raise NotFoundError('Connection {} is not a valid IRC connection'.format(name)) return success_response('Successfully stopped connection(s)')
def get(self, session=None): """Stops IRC connections""" from flexget.plugins.daemon.irc import irc_manager if irc_manager is None: raise BadRequest('IRC daemon does not appear to be running') args = irc_stop_parser.parse_args() name = args.get('name') wait = args.get('wait') try: irc_manager.stop_connections(wait=wait, name=name) except KeyError: raise NotFoundError( 'Connection {} is not a valid IRC connection'.format(name)) return success_response('Successfully stopped connection(s)')