From: Michael Tremer Date: Fri, 27 Oct 2023 16:12:58 +0000 (+0000) Subject: hub: Drop unused methods X-Git-Tag: 0.9.30~1389 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc2c20aeff9dea4048bc44d6af8fb5cabb1a5848;p=pakfire.git hub: Drop unused methods Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/hub.py b/src/pakfire/hub.py index 92c5979cb..6d819673e 100644 --- a/src/pakfire/hub.py +++ b/src/pakfire/hub.py @@ -258,61 +258,8 @@ class Hub(object): return krb5_context - # Test functions - - async def test(self): - """ - Tests the connection - """ - return await self._request("GET", "/test") - - # Build actions - - def get_build(self, uuid): - return self._request("/api/v1/builds/%s" % uuid, decode="json") - - async def build(self, path, repo=None, arches=None, - disable_test_builds=False): - """ - Create a new build on the hub - """ - # Upload the souce file to the server - upload_id = await self.upload(path) - - log.debug("%s has been uploaded as %s" % (path, upload_id)) - - # Create a new build - build_id = await self._request("POST", "/api/v1/builds", - upload_id=upload_id, - repo=repo, - arches=arches, - disable_test_builds=disable_test_builds, - ) - - log.debug("Build creates as %s" % build_id) - - return build_id - - # Job actions - - def get_job(self, uuid): - return self._request("/jobs/%s" % uuid, decode="json") - - # Package actions - - def get_package(self, uuid): - return self._request("/packages/%s" % uuid, decode="json") - # Uploads - async def list_uploads(self): - """ - Returns a list of all uploads - """ - response = await self._request("GET", "/api/v1/uploads") - - return response.get("uploads") - async def upload(self, path, filename=None, show_progress=True): """ Uploads the file to the hub returning the upload ID @@ -464,33 +411,6 @@ class Hub(object): """ return await self._proxy(JobControlConnection, *args, **kwargs) - # Repositories - - async def list_repos(self, distro): - """ - Lists all repositories - """ - return await self._request("GET", "/api/v1/repos/%s" % distro) - - async def get_repo(self, distro, name): - """ - Fetches repository information - """ - return await self._request("GET", "/api/v1/repos/%s/%s" % (distro, name)) - - async def create_repo(self, distro, name, description=None): - """ - Creates a new repository - """ - return await self._request("POST", "/api/v1/repos/%s" % distro, - name=name, description=description) - - async def delete_repo(self, distro, name): - """ - Deletes a repository - """ - await self._request("DELETE", "/api/v1/repos/%s/%s" % (distro, name)) - class HubObject(object): # Disable Nagle's algorithm?