def createClient(*args, **kwargs): test_name = None if 'test_name' in kwargs: test_name = kwargs['test_name'] del kwargs['test_name'] kwargs['http_handler'] = TestHTTPHandler(test_name) return Client(*args, **kwargs)
def createClient(*args, **kwargs): test_name = None if "test_name" in kwargs: test_name = kwargs["test_name"] del kwargs["test_name"] kwargs["http_handler"] = TestHTTPHandler(test_name) return Client(*args, **kwargs)
def __init__(self, path='/Applications', *args, **kwargs): """Create an instance of a Transmission client. If Transmission is not currently running, then it will be started. If it is running, the PID is grabbed in case Transmission needs to be killed. """ super(Transmission, self).__init__(*args, **kwargs) self._logger = logging.getLogger('Transmission') transmission = 'Transmission.app/Contents/MacOS/Transmission' self.executable = os.sep.join([path, transmission]) self.pid = None if not self.running: output = call(self.executable, shell=True) self._logger.debug(output) if not self.running: self._logger.warn('Unable to start Transmission') self.client = Client()