~ubuntu-branches/ubuntu/natty/gnome-activity-journal/natty

« back to all changes in this revision

Viewing changes to src/sources.py

  • Committer: Bazaar Package Importer
  • Author(s): Siegfried-Angel Gevatter Pujals
  • Date: 2010-01-19 19:02:56 UTC
  • Revision ID: james.westby@ubuntu.com-20100119190256-x0iws5zymbi2oitq
Tags: upstream-0.3.2
Import upstream version 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -.- coding: utf-8 -.-
 
2
#
 
3
# GNOME Activity Journal
 
4
#
 
5
# Copyright © 2009-2010 Seif Lotfy <seif@lotfy.com>
 
6
# Copyright © 2009-2010 Siegfried Gevatter <siegfried@gevatter.com>
 
7
# Copyright © 2007 Alex Graveley <alex@beatniksoftware.com>
 
8
# Copyright © 2010 Markus Korn <thekorn@gmx.de>
 
9
#
 
10
# This program is free software: you can redistribute it and/or modify
 
11
# it under the terms of the GNU General Public License as published by
 
12
# the Free Software Foundation, either version 3 of the License, or
 
13
# (at your option) any later version.
 
14
#
 
15
# This program is distributed in the hope that it will be useful,
 
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
# GNU Lesser General Public License for more details.
 
19
#
 
20
# You should have received a copy of the GNU Lesser General Public License
 
21
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
22
 
 
23
import gettext
 
24
 
 
25
from zeitgeist.datamodel import Event, Subject, Interpretation, Manifestation
 
26
 
 
27
class Source:
 
28
 
 
29
    def __init__(self, interpretation, icon, desc_sing, desc_pl):
 
30
        self.name = interpretation.name
 
31
        self.icon = icon
 
32
        self._desc_sing = desc_sing
 
33
        self._desc_pl = desc_pl
 
34
 
 
35
    def group_label(self, num):
 
36
        return gettext.ngettext(self._desc_sing, self._desc_pl, num)
 
37
 
 
38
SUPPORTED_SOURCES = {
 
39
    # TODO: Move this into Zeitgeist's library, implemented properly
 
40
    Interpretation.VIDEO.uri: Source(Interpretation.VIDEO, "gnome-mime-video", _("Worked with a Video"), _("Worked with Videos")),
 
41
    Interpretation.MUSIC.uri: Source(Interpretation.MUSIC, "gnome-mime-audio", _("Worked with Audio"), _("Worked with Audio")),
 
42
    Interpretation.IMAGE.uri: Source(Interpretation.IMAGE, "image", _("Worked with an Image"), _("Worked with Images")),
 
43
    Interpretation.DOCUMENT.uri: Source(Interpretation.DOCUMENT, "stock_new-presentation", _("Edited or Read Document"), _("Edited or Read Documents")),
 
44
    Interpretation.SOURCECODE.uri: Source(Interpretation.SOURCECODE, "applications-development", _("Edited or Read Code"), _("Edited or Read Code")),
 
45
    Interpretation.UNKNOWN.uri: Source(Interpretation.UNKNOWN, "applications-other", _("Other Activity"), _("Other Activities")),
 
46
}
 
47