Package: yagtd
Version: 0.2.8-1
Severity: normal
Tags: patch
Hi,
There's a issue when I do something like that (reproducible everytime) :
GTD> add test1 @home
Task #1 appended
Task #1 added
GTD> order
@Home
1:(2.049390) test1 @home U:1 I:3 T:1H S:2009-09-05
GTD> replace 1 test replace @home
Task #1 replaced
GTD> order
Traceback (most recent call last):
File "/usr/bin/yagtd", line 1106, in <module>
main(options, args[0])
File "/usr/bin/yagtd", line 1073, in main
gtd_cmd.cmdloop()
File "/usr/lib/python2.5/cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python2.5/cmd.py", line 219, in onecmd
return func(arg)
File "/usr/bin/yagtd", line 868, in do_order
tasks = [ t for t in tasks if t['start'] <= today ]
TypeError: can't compare datetime.datetime to NoneType
So, I've made a patch which makes it work by setting 'start' entry in the
replace function. See the attachment.
Thanks :)
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (990, 'unstable'), (500, 'testing'), (2, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.30-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_BE.UTF-8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages yagtd depends on:
ii python 2.5.4-2 An interactive high-level object-o
ii python-support 1.0.3 automated rebuilding support for P
yagtd recommends no packages.
yagtd suggests no packages.
-- no debconf information
--- yagtd.old.py 2009-09-05 17:41:24.000000000 +0200
+++ yagtd.py 2009-09-05 17:41:45.000000000 +0200
@@ -370,6 +370,9 @@
# And, replace it into the to-do list
self.todo[i] = task
+
+ # And, set the start date if none
+ self.do_append("%d S:%s" % (idx,
datetime.datetime.now().strftime("%Y-%m-%d")))
def _search(self, regexp, completed=False, quiet=False):
"""Retrieve tasks matching given regexp.