1
# -*- coding: utf-8 -*-
2
# Copyright (c) 2009 - Luca Invernizzi <invernizzi.l@gmail.com>
4
# This program is free software: you can redistribute it and/or modify it under
5
# the terms of the GNU General Public License as published by the Free Software
6
# Foundation, either version 3 of the License, or (at your option) any later
9
# This program is distributed in the hope that it will be useful, but WITHOUT
10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
# You should have received a copy of the GNU General Public License along with
15
# this program. If not, see <http://www.gnu.org/licenses/>.
18
class GenericTask(object):
19
"""GenericTask is the abstract interface that represents a generic task."""
21
def __init__(self, proxy):
25
return "Task " + self.title + "(" + self.id + ")"
29
"\t - Title: " + self.title + "\n" + \
30
"\t - ID: " + self.id + "\n" + \
31
"\t - Modified: " + str(self.modified) + "\n" + \
32
"\t - Due: " + str(self.due_date) + "\n"
35
#Minimizing the number of actions will allow a faster RTM plugin
36
# (where GET is fast, but SET is slow)
37
if self.title != task.title:
38
self.title = task.title
39
if self.text != task.text:
41
if self.status != task.status:
42
self.status = task.status
43
if self.due_date != task.due_date:
44
self.due_date = task.due_date
49
title = property(lambda self: self._get_title(),
50
lambda self, arg: self._set_title(arg))
52
id = property(lambda self: self._get_id())
54
text = property(lambda self: self._get_text(),
55
lambda self, arg: self._set_text(arg))
57
status = property(lambda self: self._get_status(),
58
lambda self, arg: self._set_status(arg))
60
modified = property(lambda self: self._get_modified())
62
due_date = property(lambda self: self._get_due_date(),
63
lambda self, arg: self._set_due_date(arg))
65
tags = property(lambda self: self._get_tags(),
66
lambda self, arg: self._set_tags(arg))
68
self = property(lambda self: self)