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
This commit is contained in:
parent
503a35b04e
commit
81d54dab91
2 changed files with 12 additions and 19 deletions
|
@ -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'
|
||||
|
||||
|
|
23
task.py
23
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:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue