It's time to write some code, using the specification document and the unit tests as guides. Specifically, it's time to write the
planner.data module, which contains
statuses, activities, and
I made a directory called
planner, and within that directory created a file called
__init__.py. There's no need to put anything inside
__init__.py, but the file itself needs to exist to tell Python that the
planner directory is a package.
The following code goes in
from datetime import timedelta class task_error(Exception): pass class schedule_error(Exception): pass class _tasks: def __init__(self, name, begins, ends): if ends < begins: raise task_error('The begin time must precede the end time') if ends - begins ...