from AppInstall.Menu import SHOW_ALL, SHOW_ONLY_SUPPORTED, SHOW_ONLY_FREE, SHOW_ONLY_MAIN, SHOW_ONLY_PROPRIETARY, SHOW_ONLY_THIRD_PARTY, SHOW_ONLY_INSTALLED
from gettext import gettext as _
class Distribution(Default.Distribution):
def __init__(self):
Default.Distribution.__init__(self)
self.filters_primary = {
SHOW_ALL: (_('All available applications'), _('Show all applications including ones which are possibly restricted by law or copyright')),
SHOW_ONLY_FREE: (_('All Open Source applications'), _('Show all Debian applications which can be freely used, modified and distributed. This includes a large variety of community maintained applications')) }
self.filters_secondary = {
SHOW_ONLY_THIRD_PARTY: (_('Third party applications'), _('Show only applications that are provided by independent software vendors and are not part of Debian')) }
self.components_ask = [
'contrib',
'non-free']
self.components_activation = {
None: [
_('Enable the installation of software from the %s component of Debian?'),
_('%s is not officially supported with security updates.')],
'main': [
_('Enable the installaion of officially supported Debian software?'),
_('%s is part of the Debian main distribution. Debian provides support and security updates, which will be enabled too.')],
'contrib': [
_('Enable the installation of partial free software?'),
_('%s is not part of the Debian main distribution and requires non-free software to work. Debian provides support and security updates, which will be enabled too.')],
'non-free': [
_('Enable the installation of non-free software?'),
_('The use, modification and distribution of %s is restricted by copyright or by legal terms in some countries.')] }
self.dependencies_map = [
(('kdelibs4c2a', 'python-kde3', 'libqt3-mt'), _('%s integrates well into the KDE desktop'), 'application-kde'),
(('libgnome2-0', 'python-gnome2', 'libgtk2.0-0', 'python-gtk2'), _('%s integrates well into the GNOME desktop'), 'application-gnome'),
('libgnustep-base1.11', _('%s integrates well into the Gnustep desktop'), None),
(('libxfce4util4',), _('%s integrates well into the XFCE desktop'), None)]
self.comp_depend_map = {
'contrib': [
'main',
'non-free'],
'non-free': [
'main'] }
def get_app_emblems(self, app, cache):
emblems = []
icon_name = None
tooltip = None
if app.thirdparty or app.channel:
tooltip = '%s is provided by a third party vendor and is therefore not an official part of Debian. The third party vendor is responsible for support and security updates.' % app.name
icon_name = 'application-proprietary'
emblems.append((icon_name, tooltip))
elif app.component == 'main':
tooltip = _('Debian provides support and security updates for %s') % app.name
icon_name = 'application-debian-main'
emblems.append((icon_name, tooltip))
elif app.component == 'contrib':
tooltip = _('%s requires non-free software to work.Debian provides support and security updates.') % app.name
icon_name = 'application-debian-contrib'
emblems.append((icon_name, tooltip))
elif app.component == 'non-free':
tooltip = _('The use, modification and distribution of %s is restricted by copyright or by legal terms in some countries. Debian provides support and security updates.') % app.name
icon_name = 'application-debian-non-free'
emblems.append((icon_name, tooltip))
if cache.has_key(app.pkgname):
for deps, tooltip, icon_name in self.dependencies_map: