#!/usr/bin/python
-
-
+import asyncio
import configparser
import logging
import os
return database.Connection(hostname, name, user=user, password=password)
+ async def open(self, path):
+ """
+ Opens a package and returns the archive
+ """
+ return await asyncio.to_thread(self._open, path)
+
+ def _open(self, path):
+ # Create a dummy Pakfire instance
+ p = pakfire.Pakfire(offline=True)
+
+ # Open the archive
+ return p.open(path)
+
def delete_file(self, path, not_before=None):
self.db.execute("INSERT INTO queue_delete(path, not_before) \
VALUES(%s, %s)", path, not_before)