diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2009-06-23 04:28:43 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2009-06-23 04:28:43 +0200 |
commit | a5c1c9260fb01204112f8b8868170d15dd05019c (patch) | |
tree | 7ffd606a19f0fbb2b5bf5682b28e025658696c35 /item.py | |
parent | e1b6d1a619aa8f75510d5b1812fe68459fb01578 (diff) | |
download | todolist-a5c1c9260fb01204112f8b8868170d15dd05019c.tar.gz todolist-a5c1c9260fb01204112f8b8868170d15dd05019c.tar.xz todolist-a5c1c9260fb01204112f8b8868170d15dd05019c.zip |
added priorities with possibility to define different colors
colors does not work correctly
Diffstat (limited to '')
-rw-r--r-- | item.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import time +from priority import Priorities class item: readOnly = ['id'] @@ -10,7 +11,7 @@ class item: if title != None: self.title = title self.created = created - self.priority = priority + self.setPriority(priority) self.description = description self.completed = completed self.removed = removed @@ -58,6 +59,14 @@ class item: def getDue(self): return self.due + def setPriority(self, id=None, name=None): + if id is not None: + self.priority = Priorities().getPriority(id = id) + elif name is not None: + self.priority = Priorities().getPriority(name = name) + else: + self.priority = None + def __setattr__(self, name, value): if name not in item.readOnly: if name not in self.__dict__ or self.__dict__[name] != value: |