1
# Copyright (C) 2009 Canonical
7
# This program is free software; you can redistribute it and/or modify it under
8
# the terms of the GNU General Public License as published by the Free Software
9
# Foundation; version 3.
11
# This program is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16
# You should have received a copy of the GNU General Public License along with
17
# this program; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
from softwarecenter.distro import Distro
23
from gettext import gettext as _
36
# disable paid software
37
PURCHASE_APP_URL = None
40
# FIXME - fedora should get its own proxy eventually
41
SCREENSHOT_THUMB_URL = ("http://screenshots.ubuntu.com/"
42
"thumbnail-with-version/%(pkgname)s/%(version)s")
43
SCREENSHOT_LARGE_URL = ("http://screenshots.ubuntu.com/"
44
"screenshot-with-version/%(pkgname)s/%(version)s")
45
SCREENSHOT_JSON_URL = "http://screenshots.ubuntu.com/json/package/%s"
48
# FIXME: fedora will want to get their own review server instance at
49
# some point I imagine :) (or a alternative backend)
51
REVIEWS_SERVER = (os.environ.get("SOFTWARE_CENTER_REVIEWS_HOST") or
52
"http://reviews.ubuntu.com/reviews/api/1.0")
53
REVIEWS_URL = (REVIEWS_SERVER + "/reviews/filter/%(language)s/%(origin)s/"
54
"%(distroseries)s/%(version)s/%(pkgname)s%(appname)s/")
56
REVIEW_STATS_URL = REVIEWS_SERVER + "/review-stats"
58
def get_distro_channel_name(self):
59
""" The name of the primary repository """
62
def get_distro_channel_description(self):
63
""" The description of the main distro channel
64
Overrides what's present in yum.conf for fedora, updates,
65
updates-testing, their respective -source and -debuginfo
67
return _("Provided by Fedora")
69
def get_app_name(self):
70
return _("Fedora Software Center")
72
def get_removal_warning_text(self, cache, pkg, appname, depends):
73
primary = _("To remove %s, these items must be removed "
75
button_text = _("Remove All")
77
return (primary, button_text)
79
def get_license_text(self, component):
80
# with a PackageKit backend, component is always 'main'
81
# (but we have license in the individual packages)
82
return _("Open source")
84
def get_architecture(self):
87
def get_foreign_architectures(self):
90
def is_supported(self, cache, doc, pkgname):
91
origin = cache.get_origin(pkgname)
92
return origin == 'fedora' or origin == 'updates'
94
def get_maintenance_status(self, cache, appname, pkgname, component,
99
def get_supported_query(self):
101
query1 = xapian.Query("XOO" + "fedora")
102
query2 = xapian.Query("XOO" + "updates")
103
return xapian.Query(xapian.Query.OP_OR, query1, query2)