From 81d54dab91f9415051583660391d2794c179c3fc Mon Sep 17 00:00:00 2001 From: helmutm Date: Tue, 8 Nov 2005 21:49:47 +0000 Subject: [PATCH] work in progress: unit and doc tests (README.txt) set up git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@667 fd906abe-77d9-0310-91a1-e0d9ade77398 --- README.txt | 8 ++++++-- task.py | 23 ++++++----------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/README.txt b/README.txt index 0730e3c..9f2ae04 100755 --- a/README.txt +++ b/README.txt @@ -3,7 +3,11 @@ Task Examples:: >>> from loops.task import Task - >>> t = Task() - >>> t.title + >>> t1 = Task() + >>> t1.title u'' + >>> t2 = Task(u't2', u'Second Task') + >>> t2.title + u'Second Task' + diff --git a/task.py b/task.py index 00f24ed..a15d0d2 100644 --- a/task.py +++ b/task.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2004 Helmut Merz helmutm@cy55.de +# Copyright (c) 2005 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,17 +35,6 @@ from interfaces import ITask from copy import copy -class ResourceAllocation(Relation): - """ A relation that represents an allocation of a resource - to a task. - """ - - -class ResourceAllocations(Relations): - """ A set of resource allocations. - """ - - class Task(OrderedContainer): implements(ITask) @@ -54,12 +43,12 @@ class Task(OrderedContainer): qualifier = u'' priority = FieldProperty(ITask['priority']) - def __init__(self): + def __init__(self, name=None, title=u''): OrderedContainer.__init__(self) - self._subtasks = Relations() - self._parentTasks = Relations() - self._resourceAllocs = {} - self.resourceConstraints = [] + if name: + self.__name__ = name + if title: + self.title = title # subtasks: