/usr/lib/python3/dist-packages/AptUrl/gtk/backend/__init__.py is in apturl 0.5.2ubuntu11.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Integration of package managers into UpdateManager"""
# (c) 2005-2009 Canonical, GPL
import os
import os.path
from gi.repository import GObject
class InstallBackend(GObject.GObject):
"""The abstract backend that can install/remove packages"""
(INSTALL, UPDATE) = range(2)
def __init__(self, window_main):
"""init backend
takes a gtk main window as parameter
"""
GObject.GObject.__init__(self)
self.window_main = window_main
def commit(self, pkgs_install, pkgs_upgrade, close_on_done):
"""Commit the cache changes """
raise NotImplemented
def update(self):
"""Run a update to refresh the package list"""
raise NotImplemented
def get_backend(*args, **kwargs):
"""Select and return a package manager backend."""
# try aptdaemon
if (os.path.exists("/usr/sbin/aptd") and
not "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" in os.environ):
# check if the gtkwidgets are installed as well
try:
from .InstallBackendAptdaemon import InstallBackendAptdaemon
return InstallBackendAptdaemon(*args, **kwargs)
except ImportError:
import logging
logging.exception("importing aptdaemon")
# try synaptic
if (os.path.exists("/usr/sbin/synaptic") and
not "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" in os.environ):
from .InstallBackendSynaptic import InstallBackendSynaptic
return InstallBackendSynaptic(*args, **kwargs)
# nothing found, raise
raise Exception("No working backend found, please try installing "
"synaptic or aptdaemon")
|