def __init__(self): super(QObject, self).__init__() self._conda_api = CondaAPI() self._queue = deque() self._threads = [] self._workers = [] self._timer = QTimer() self._chunk_size = 1024 self._timer.setInterval(1000) self._timer.timeout.connect(self._clean)
def __init__(self): super(QObject, self).__init__() self._anaconda_client_api = binstar_client.utils.get_server_api( log_level=logging.NOTSET) self._queue = deque() self._threads = [] self._workers = [] self._timer = QTimer() self._conda_api = CondaAPI() self._timer.setInterval(1000) self._timer.timeout.connect(self._clean)
def __init__(self, load_rc_func=None): """Download API based on requests.""" super(QObject, self).__init__() self._conda_api = CondaAPI() self._queue = deque() self._threads = [] self._workers = [] self._timer = QTimer() self._load_rc_func = load_rc_func self._chunk_size = 1024 self._timer.setInterval(1000) self._timer.timeout.connect(self._clean)
def __init__(self): """Anaconda Manager API process worker.""" super(_ManagerAPI, self).__init__() # API's self._conda_api = CondaAPI() self._client_api = ClientAPI() self._download_api = DownloadAPI(load_rc_func=self._conda_api.load_rc) self._requests_download_api = RequestsDownloadAPI( load_rc_func=self._conda_api.load_rc) self.ROOT_PREFIX = self._conda_api.ROOT_PREFIX # Vars self._checking_repos = None self._data_directory = None self._files_downloaded = None self._repodata_files = None self._valid_repos = None # Expose some methods for convenient access. Methods return a worker self.conda_create = self._conda_api.create self.conda_create_yaml = self._conda_api.create_from_yaml self.conda_clone = self._conda_api.clone_environment self.conda_dependencies = self._conda_api.dependencies self.conda_get_condarc_channels = self._conda_api.get_condarc_channels self.conda_install = self._conda_api.install self.conda_remove = self._conda_api.remove self.conda_terminate = self._conda_api.terminate_all_processes self.conda_config_add = self._conda_api.config_add self.conda_config_remove = self._conda_api.config_remove self.pip_list = self._conda_api.pip_list self.pip_remove = self._conda_api.pip_remove # No workers are returned for these methods self.conda_clear_lock = self._conda_api.clear_lock self.conda_environment_exists = self._conda_api.environment_exists self.conda_get_envs = self._conda_api.get_envs self.conda_linked = self._conda_api.linked self.conda_get_prefix_envname = self._conda_api.get_prefix_envname self.conda_package_version = self._conda_api.package_version self.conda_platform = self._conda_api.get_platform # These download methods return a worker get_api_info = self._requests_download_api.get_api_info is_valid_url = self._requests_download_api.is_valid_api_url is_valid_channel = self._requests_download_api.is_valid_channel terminate = self._requests_download_api.terminate self.download_requests = self._requests_download_api.download self.download_async = self._download_api.download self.download_async_terminate = self._download_api.terminate self.download_is_valid_url = self._requests_download_api.is_valid_url self.download_is_valid_api_url = is_valid_url self.download_get_api_info = lambda: get_api_info(self._client_api. get_api_url()) self.download_is_valid_channel = is_valid_channel self.download_requests_terminate = terminate # These client methods return a worker self.client_store_token = self._client_api.store_token self.client_remove_token = self._client_api.remove_token self.client_login = self._client_api.login self.client_logout = self._client_api.logout self.client_load_repodata = self._client_api.load_repodata self.client_prepare_packages_data = self._client_api.prepare_model_data self.client_user = self._client_api.user self.client_domain = self._client_api.domain self.client_set_domain = self._client_api.set_domain self.client_packages = self._client_api.packages self.client_multi_packages = self._client_api.multi_packages self.client_organizations = self._client_api.organizations self.client_load_token = self._client_api.load_token self.client_get_api_url = self._client_api.get_api_url self.client_set_api_url = self._client_api.set_api_url