~nik90/ubuntu/precise/software-center/add_keywords

« back to all changes in this revision

Viewing changes to softwarecenter/hw.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt, Michael Vogt, Brendan Donegan, Gary Lasker
  • Date: 2012-02-03 18:34:43 UTC
  • Revision ID: package-import@ubuntu.com-20120203183443-1r39x52ozrb1revz
Tags: 5.1.8
[ Michael Vogt ]
* softwarecenter/db/update.py:
  - trivial fix to skip unreadable app-install-data files
* lp:~mvo/software-center/device-profiles:
  - implement the hardware-requirements display in
    the detailsview
* lp:~mvo/software-center/arb-partner-channels:
  - add support for extras.ubuntu.com and archive.canonical.com
    channel detection and adding via software-center-agent
* data/software-center.menu.in:
  - do not show "X-Publishing" in education because the
    software-center-agent will send "X-Publishing;Education" for
    compatibility with the old clients
* lp:~mvo/software-center/fix-cachedir-for-public-api:
  - add missing cachedir argument
* lp:~mvo/software-center/region-support:
  - add support for a region tag and display a warning to
    the user if an application is not suitable for their
    region

[ Brendan Donegan ]
* lp:~brendan-donegan/software-center/test_utils_get_nice_date_string:
  - add a test function in test_utils.py which covers all of
    get_nice_date_string

[ Gary Lasker ]
* lp:~gary-lasker/software-center/launcher-integration-lp761851:
  - update to the Unity launcher integration implementation to
    support the revamped functionality on the Unity side (LP: #761851) 
* lp:~gary-lasker/software-center/recommends-ui-lobby:
  - initial recommends UI implementation, limited to non-personalized
    recommends currently
* lp:~gary-lasker/software-center/appdetailsview-button-focus-fix:
  - make sure the action button in the applications details view
    always gets the initial focus (LP: #925613)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2012 Canonical
 
2
#
 
3
# Authors:
 
4
#  Michael Vogt
 
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
from gettext import gettext as _
 
20
 
 
21
TAG_DESCRIPTION = {
 
22
    'hardware::camera' : _('camera'),
 
23
    'hardware::input:mouse' : _('mouse'),
 
24
    'hardware::input:joystick' : _('joystick'),
 
25
    'hardware::input:touchscreen' : _('touchscreen'),
 
26
    'hardware::gps' : _('GPS'),
 
27
    'hardware::laptop' : _('notebook computer'),
 
28
    'hardware::printer': _('printer'),
 
29
    'hardware::scanner' : _('scanner'),
 
30
    'hardware::storage:cd' : _('CD drive'),
 
31
    'hardware::storage:cd-writer' : _('CD burner'),
 
32
    'hardware::storage:dvd' : _('DVD drive'),
 
33
    'hardware::storage:dvd-writer' : _('DVD burner'),
 
34
    'hardware::storage:floppy' : _('floppy disk drive'),
 
35
    'hardware::video:opengl' : _('OpenGL hardware acceleration'),
 
36
 
 
37
}
 
38
 
 
39
TAG_MISSING_DESCRIPTION = {
 
40
    'hardware::camera' : _('This software requires a camera, but none '
 
41
                           'are currently connected'),
 
42
    'hardware::input:mouse' : _('This software requires a mouse, '
 
43
                                'but none is currently setup.'),
 
44
    'hardware::input:joystick' : _('This software requires a joystick, '
 
45
                                   'but none are currently connected.'),
 
46
    'hardware::input:touchscreen' : _('This software requires a touchscreen, '
 
47
                                      'but the computer does not have one.'),
 
48
    'hardware::gps' : _('This software requires a GPS, '
 
49
                        'but the computer does not have one.'),
 
50
    'hardware::laptop' : _('This software is for notebook computers.'),
 
51
    'hardware::printer': _('This software requires a printer, but none '
 
52
                           'are currently set up.'),
 
53
    'hardware::scanner' : _('This software requires a scanner, but none are '
 
54
                            'currently set up.'),
 
55
    'hardware::stoarge:cd' : _('This software requires a CD drive, but none '
 
56
                               'are currently connected.'),
 
57
    'hardware::storage:cd-writer' : _('This software requires a CD burner, '
 
58
                                      'but none are currently connected.'),
 
59
    'hardware::storage:dvd' : _('This software requires a DVD drive, but none '
 
60
                                'are currently connected.DVD drive'),
 
61
    'hardware::storage:dvd-writer' : _('This software requires a DVD burner, '
 
62
                                       'but none are currently connected.'),
 
63
    'hardware::storage:floppy' : _('This software requires a floppy disk '
 
64
                                   'drive, but none are currently connected.'),
 
65
    'hardware::video:opengl' : _('This computer does not have graphics fast '
 
66
                                 'enough for this software.'),
 
67
}
 
68
 
 
69
def get_hw_missing_long_description(tags):
 
70
    s = ""
 
71
    # build string
 
72
    for tag, supported in tags.iteritems():
 
73
        if supported == "no":
 
74
            s += "%s\n" % TAG_MISSING_DESCRIPTION.get(tag)
 
75
    # ensure that the last \n is gone
 
76
    if s:
 
77
        s = s[:-1]
 
78
    return s