~saurabhanandiit/gtg/exportFixed

« back to all changes in this revision

Viewing changes to GTG/backends/backend_tomboy.py

Merge of my work on liblarch newbase and all the backends ported to liblarch
(which mainly means porting the datastore).
One failing test, will check it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# -----------------------------------------------------------------------------
 
3
# Getting Things Gnome! - a personal organizer for the GNOME desktop
 
4
# Copyright (c) 2008-2009 - Lionel Dricot & Bertrand Rousseau
 
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, either version 3 of the License, or (at your option) any later
 
9
# version.
 
10
#
 
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
 
14
# details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License along with
 
17
# this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
# -----------------------------------------------------------------------------
 
19
 
 
20
'''
 
21
The tomboy backend. The actual backend is all in GenericTomboy, since it's
 
22
shared with the Gnote backend.
 
23
'''
 
24
 
 
25
from GTG.backends.genericbackend import GenericBackend
 
26
from GTG                         import _
 
27
from GTG.backends.generictomboy  import GenericTomboy
 
28
 
 
29
 
 
30
 
 
31
class Backend(GenericTomboy):
 
32
    '''
 
33
    A simple class that adds some description to the GenericTomboy class.
 
34
    It's done this way since Tomboy and Gnote backends have different
 
35
    descriptions and Dbus addresses but the same backend behind them.
 
36
    '''
 
37
    
 
38
 
 
39
    _general_description = { \
 
40
        GenericBackend.BACKEND_NAME:       "backend_tomboy", \
 
41
        GenericBackend.BACKEND_HUMAN_NAME: _("Tomboy"), \
 
42
        GenericBackend.BACKEND_AUTHORS:    ["Luca Invernizzi"], \
 
43
        GenericBackend.BACKEND_TYPE:       GenericBackend.TYPE_READWRITE, \
 
44
        GenericBackend.BACKEND_DESCRIPTION: \
 
45
            _("This backend can synchronize all or part of your Tomboy"
 
46
              " notes in GTG. If you decide it would be handy to"
 
47
              " have one of your notes in your TODO list, just tag it "
 
48
              "with the tag you have chosen (you'll configure it later"
 
49
              "), and it will appear in GTG."),\
 
50
        }
 
51
 
 
52
    _static_parameters = { \
 
53
        GenericBackend.KEY_ATTACHED_TAGS: {\
 
54
            GenericBackend.PARAM_TYPE: GenericBackend.TYPE_LIST_OF_STRINGS, \
 
55
            GenericBackend.PARAM_DEFAULT_VALUE: ["@GTG-Tomboy"]}, \
 
56
        }
 
57
 
 
58
    _BUS_ADDRESS = ("org.gnome.Tomboy",
 
59
                     "/org/gnome/Tomboy/RemoteControl",
 
60
                     "org.gnome.Tomboy.RemoteControl")