W3C home > Mailing lists > Public > www-archive@w3.org > January 2007

[todo.py] done.txt non existent

From: Karl Dubost <karl@w3.org>
Date: Wed, 17 Jan 2007 14:55:31 +0900
To: shane.koster@gmail.com, ginatrapani@gmail.com
Message-Id: <9E60BDAE-F5C9-4A54-B612-5B46DBCE4501@w3.org>
Cc: www-archive@w3.org
Hi Shane, Gina,

About
http://todotxt.com/library/todo.sh/todo.py


When the done.txt file is non existant because no tasks have been  
done yet, the report command  exit with an error.

% ls /Users/karl/todo
todo.txt

% python todo.py report
Traceback (most recent call last):
   File "todo.py", line 337, in <module>
     report()
   File "todo.py", line 263, in report
     archive()
   File "todo.py", line 161, in archive
     done = getDoneDict()
   File "todo.py", line 121, in getDoneDict
     for line in open(DONE_FILE).readlines():
IOError: [Errno 2] No such file or directory: '/Users/karl/todo/ 
done.txt'


You could refactor the program with
	try, except methods.

Here a diff for one rewritten function.




Best Regards.

-- 
Karl Dubost - http://www.w3.org/People/karl/
W3C Conformance Manager, QA Activity Lead
   QA Weblog - http://www.w3.org/QA/
      *** Be Strict To Be Cool ***





Received on Wednesday, 17 January 2007 05:56:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 July 2008 08:09:55 GMT