Logo Search packages:      
Sourcecode: yagtd version File versions  Download package

Public Member Functions | Static Public Attributes | Private Member Functions

gtd::ToDo Class Reference

List of all members.

Public Member Functions

def __init__
def __repr__
def add
def erase
def extend
def find
def order
def search
def sort
def supp

Static Public Attributes

 find_into = find
 order_by = order

Private Member Functions

def _attr_list
def _cmp_prio
def _last_id

Detailed Description

A todo list.
Herited from list class.
    
Usage:
>>> todo = ToDo()
>>> t1 = Task({'title': "Test 1", 'importance': NORMAL, 'context': ['@home', '@work']})
>>> t2 = Task({'title': "Test 2", 'importance': HIGH, 'context': ['@work']})
>>> todo.add(t1)
1
>>> todo.add(t2)
2
>>> todo
[{'id': 1, 'title': 'Test 1', 'description': '', 'context': ['@home', '@work'], 'project': [], 'status': [], 'reference': [], 'urgency': 1, 'importance': 3, 'time': datetime.timedelta(0, 3600), 'complete': 0, 'start': None, 'due': None, 'end': None, 'recurrence': None}, {'id': 2, 'title': 'Test 2', 'description': '', 'context': ['@work'], 'project': [], 'status': [], 'reference': [], 'urgency': 1, 'importance': 4, 'time': datetime.timedelta(0, 3600), 'complete': 0, 'start': None, 'due': None, 'end': None, 'recurrence': None}]
>>> todo[0].priority()
2.0493901531919194
>>> todo[1].priority()
2.6457513110645907
>>> todo.sort()
[{'id': 2, 'title': 'Test 2', 'description': '', 'context': ['@work'], 'project': [], 'status': [], 'reference': [], 'urgency': 1, 'importance': 4, 'time': datetime.timedelta(0, 3600), 'complete': 0, 'start': None, 'due': None, 'end': None, 'recurrence': None}, {'id': 1, 'title': 'Test 1', 'description': '', 'context': ['@home', '@work'], 'project': [], 'status': [], 'reference': [], 'urgency': 1, 'importance': 3, 'time': datetime.timedelta(0, 3600), 'complete': 0, 'start': None, 'due': None, 'end': None, 'recurrence': None}]
>>> todo.supp(1)
>>> todo
[{'id': 2, 'title': 'Test 2', 'description': '', 'context': ['@work'], 'project': [], 'status': [], 'reference': [], 'urgency': 1, 'importance': 4, 'time': datetime.timedelta(0, 3600), 'complete': 0, 'start': None, 'due': None, 'end': None, 'recurrence': None}]
>>> todo.add(t1)
3
>>> todo
[{'id': 2, 'title': 'Test 2', 'description': '', 'context': ['@work'], 'project': [], 'status': [], 'reference': [], 'urgency': 1, 'importance': 4, 'time': datetime.timedelta(0, 3600), 'complete': 0, 'start': None, 'due': None, 'end': None, 'recurrence': None}, {'id': 3, 'title': 'Test 1', 'description': '', 'context': ['@home', '@work'], 'project': [], 'status': [], 'reference': [], 'urgency': 1, 'importance': 3, 'time': datetime.timedelta(0, 3600), 'complete': 0, 'start': None, 'due': None, 'end': None, 'recurrence': None}]
>>> todo.order_by('context')
{'@home': [{'id': 3, 'title': 'Test 1', 'description': '', 'context': ['@home', '@work'], 'project': [], 'status': [], 'reference': [], 'urgency': 1, 'importance': 3, 'time': datetime.timedelta(0, 3600), 'complete': 0, 'start': None, 'due': None, 'end': None, 'recurrence': None}], '@work': [{'id': 2, 'title': 'Test 2', 'description': '', 'context': ['@work'], 'project': [], 'status': [], 'reference': [], 'urgency': 1, 'importance': 4, 'time': datetime.timedelta(0, 3600), 'complete': 0, 'start': None, 'due': None, 'end': None, 'recurrence': None}, {'id': 3, 'title': 'Test 1', 'description': '', 'context': ['@home', '@work'], 'project': [], 'status': [], 'reference': [], 'urgency': 1, 'importance': 3, 'time': datetime.timedelta(0, 3600), 'complete': 0, 'start': None, 'due': None, 'end': None, 'recurrence': None}]}
>>> todo.erase()
>>> todo
[]

Definition at line 251 of file gtd.py.


The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index