1
# Copyright (C) 2011 Canonical
6
# This program is free software; you can redistribute it and/or modify it under
7
# the terms of the GNU General Public License as published by the Free Software
8
# Foundation; version 3.
10
# This program is distributed in the hope that it will be useful, but WITHOUT
11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15
# You should have received a copy of the GNU General Public License along with
16
# this program; if not, write to the Free Software Foundation, Inc.,
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
from gettext import gettext as _
21
from softwarecenter.distro import Distro
24
class Suselinux(Distro):
25
# see __init__.py description
26
DISTROSERIES = ["11.4",
30
SCREENSHOT_THUMB_URL = ("http://screenshots.ubuntu.com/"
31
"thumbnail-with-version/%(pkgname)s/%(version)s")
32
SCREENSHOT_LARGE_URL = ("http://screenshots.ubuntu.com/"
33
"screenshot-with-version/%(pkgname)s/%(version)s")
34
SCREENSHOT_JSON_URL = "http://screenshots.ubuntu.com/json/package/%s"
37
REVIEWS_SERVER = (os.environ.get("SOFTWARE_CENTER_REVIEWS_HOST") or
38
"http://reviews.ubuntu.com/reviews/api/1.0")
39
REVIEWS_URL = (REVIEWS_SERVER + "/reviews/filter/%(language)s/%(origin)s/"
40
"%(distroseries)s/%(version)s/%(pkgname)s%(appname)s/")
42
REVIEW_STATS_URL = REVIEWS_SERVER + "/review-stats"
44
def get_app_name(self):
45
return _("Software Center")
47
def get_app_description(self):
48
return _("Lets you choose from thousands of applications available.")
50
def get_distro_channel_name(self):
51
""" The name in the Release file """
54
def get_distro_channel_description(self):
55
""" The description of the main distro channel """
56
return _("Provided by openSUSE")
58
def get_removal_warning_text(self, cache, pkg, appname, depends):
59
primary = _("To remove %s, these items must be removed "
61
button_text = _("Remove All")
63
return (primary, button_text)
65
def get_license_text(self, component):
66
if component in ("main", "universe", "independent"):
67
return _("Open source")
68
elif component in ("restricted", "commercial"):
69
return _("Proprietary")
71
def is_supported(self, cache, doc, pkgname):
75
def get_supported_query(self):
78
query1 = xapian.Query("XOL" + "Ubuntu")
79
query2a = xapian.Query("XOC" + "main")
80
query2b = xapian.Query("XOC" + "restricted")
81
query2 = xapian.Query(xapian.Query.OP_OR, query2a, query2b)
82
return xapian.Query(xapian.Query.OP_AND, query1, query2)
84
def get_maintenance_status(self, cache, appname, pkgname, component,
89
def get_downloadable_icon_url(self, full_archive_url, icon_filename):