# HG changeset patch # User Steve Losh # Date 1316559135 14400 # Node ID 44d920ae117e7e3b7790d76179e120cac9224d42 # Parent 2e3102258623a49519e72d130528e815e67704f3# Parent 65b004631139c07343611a2cbbaaceae8f0caabc Merge. diff -r 2e3102258623 -r 44d920ae117e t.py --- a/t.py Tue Sep 20 18:47:55 2011 -0400 +++ b/t.py Tue Sep 20 18:52:15 2011 -0400 @@ -51,7 +51,9 @@ and other metadata will be generated when the line is read. This is supported to enable editing of the taskfile with a simple text editor. """ - if '|' in taskline: + if taskline.strip().startswith('#'): + return None + elif '|' in taskline: text, _, meta = taskline.rpartition('|') task = { 'text': text.strip() } for piece in meta.strip().split(','): @@ -136,7 +138,8 @@ tls = [tl.strip() for tl in tfile if tl] tasks = map(_task_from_taskline, tls) for task in tasks: - getattr(self, kind)[task['id']] = task + if task is not None: + getattr(self, kind)[task['id']] = task def __getitem__(self, prefix): """Return the unfinished task with the given prefix. diff -r 2e3102258623 -r 44d920ae117e tests/manual.t --- a/tests/manual.t Tue Sep 20 18:47:55 2011 -0400 +++ b/tests/manual.t Tue Sep 20 18:52:15 2011 -0400 @@ -30,3 +30,8 @@ $ xt 5 - New. +Add comments to task file: + + $ echo '# this is a comment' >> test + $ xt + 5 - New.