~ubuntu-branches/ubuntu/raring/software-center/raring-proposed

« back to all changes in this revision

Viewing changes to softwarecenter/distro/suselinux.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2012-10-11 15:33:05 UTC
  • mfrom: (195.1.18 quantal)
  • Revision ID: package-import@ubuntu.com-20121011153305-fm5ln7if3rpzts4n
Tags: 5.4.1.1
* lp:~mvo/software-center/reinstall-previous-purchase-token-fix:
  - fix reinstall previous purchases that have a system-wide
    license key LP: #1065481
* lp:~mvo/software-center/lp1060106:
  - Add missing gettext init for utils/update-software-center-agent
    (LP: #1060106)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2011 Canonical
 
2
#
 
3
# Authors:
 
4
#  Alex Eftimie
 
5
#
 
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.
 
9
#
 
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
 
13
# details.
 
14
#
 
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
 
18
 
 
19
import os
 
20
from gettext import gettext as _
 
21
from softwarecenter.distro import Distro
 
22
 
 
23
 
 
24
class Suselinux(Distro):
 
25
    # see __init__.py description
 
26
    DISTROSERIES = ["11.4",
 
27
                   ]
 
28
 
 
29
    # screenshot handling
 
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"
 
35
 
 
36
    # reviews
 
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/")
 
41
 
 
42
    REVIEW_STATS_URL = REVIEWS_SERVER + "/review-stats"
 
43
 
 
44
    def get_app_name(self):
 
45
        return _("Software Center")
 
46
 
 
47
    def get_app_description(self):
 
48
        return _("Lets you choose from thousands of applications available.")
 
49
 
 
50
    def get_distro_channel_name(self):
 
51
        """ The name in the Release file """
 
52
        return "openSUSE"
 
53
 
 
54
    def get_distro_channel_description(self):
 
55
        """ The description of the main distro channel """
 
56
        return _("Provided by openSUSE")
 
57
 
 
58
    def get_removal_warning_text(self, cache, pkg, appname, depends):
 
59
        primary = _("To remove %s, these items must be removed "
 
60
                    "as well:") % appname
 
61
        button_text = _("Remove All")
 
62
 
 
63
        return (primary, button_text)
 
64
 
 
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")
 
70
 
 
71
    def is_supported(self, cache, doc, pkgname):
 
72
        # FIXME
 
73
        return False
 
74
 
 
75
    def get_supported_query(self):
 
76
        # FIXME
 
77
        import xapian
 
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)
 
83
 
 
84
    def get_maintenance_status(self, cache, appname, pkgname, component,
 
85
        channelname):
 
86
        # FIXME
 
87
        pass
 
88
 
 
89
    def get_downloadable_icon_url(self, full_archive_url, icon_filename):
 
90
        # FIXME
 
91
        pass