W3C home > Mailing lists > Public > www-archive@w3.org > November 2006

toIcal.py - failed attempt of using it

From: Karl Dubost <karl@w3.org>
Date: Fri, 24 Nov 2006 18:34:25 +0900
Message-Id: <3619715D-6AB7-444F-BA27-78DCAD7133E3@w3.org>
Cc: www-archive@w3.org
To: Dan Connolly <connolly@w3.org>

Hi Dan,

This is the story telling in my failed attempt of using toIcal.py.  
Maybe I make a mistake at the start, but this is to share my way of  
going through errors following my nose.


I was trying to use toIcal.py
from http://www.w3.org/2000/10/swap/pim/toIcal.py

And I got this error message

% python toIcal.py rdf-calendar.rdf > lastcall.ics
Traceback (most recent call last):
   File "toical.py", line 51, in <module>
     from myStore import Namespace, load, setStore # http:// 
www.w3.org/2000/10/swap/
ImportError: No module named myStore


I have done on my computer
w3.org/WWW/2000/10/swap [16:32:11]% cvs update -dP .
and try to use the program from the pim directory itself. Same problem.

hmmm I see…

w3.org/WWW/2000/10/swap [16:32:11]% find . -name "*myStore*"
./myStore.html
./myStore.py
./myStore.pyc


Which means there are dependencies on modules which are on  
directories above. Not good, because swap is not something installed  
in Python libraries.

I added in toIcal.py

import sys
sys.path.append('/Users/karl/Sites/w3.org/WWW/2000/10/swap')

and then ran the program again

% python toIcal.py rdf-calendar.rdf
Traceback (most recent call last):
   File "toIcal.py", line 56, in <module>
     from fromIcal import iCalendarDefs # http://www.w3.org/2002/12/cal/
ImportError: No module named fromIcal

I went to the page RDF Calendar Workspace
	http://www.w3.org/2002/12/cal/

And I see in the page this program
	http://www.w3.org/2002/12/cal/fromIcal.py

I decide to copy it in local.
	
% curl -o fromIcal.py http://www.w3.org/2002/12/cal/fromIcal.py

and try again

% python toIcal.py rdf-calendar.rdf
Traceback (most recent call last):
   File "toIcal.py", line 56, in <module>
     from fromIcal import iCalendarDefs # http://www.w3.org/2002/12/cal/
   File "/Users/karl/Sites/w3.org/WWW/Team/karl/ongoing/lastcall/ 
fromIcal.py", line 67, in <module>
     import XMLWriter
ImportError: No module named XMLWriter


eeek another missing module. :)
hmmmm XMLWriter is another module in the cal directory

%curl -o XMLwriter.py http://www.w3.org/2002/12/cal/XMLWriter.py

and try again.

% python toIcal.py rdf-calendar.rdf
Traceback (most recent call last):
   File "toIcal.py", line 56, in <module>
     from fromIcal import iCalendarDefs # http://www.w3.org/2002/12/cal/
   File "/Users/karl/test/fromIcal.py", line 68, in <module>
     from icslex import unbreak, parseLine, unesc, recurlex
ImportError: No module named icslex


hmmmm ok I think I have to download the full directory. This is easy  
for me, but not necessary for people outside of W3C. There is no tar.gz

% cvs co WWW/2002/12/cal/
cvs.bin checkout: Updating WWW/2002/12/cal
...

I add the sys.path to the initial program: toIcal.py

import sys
sys.path.append('/Users/karl/Sites/w3.org/WWW/2000/10/swap')
sys.path.append('/Users/karl/Sites/w3.org/WWW/2002/12/cal')


And try again

% python toIcal.py rdf-calendar.rdf
loading...file:/Users/karl/test/rdf-calendar.rdf
Traceback (most recent call last):
   File "toIcal.py", line 428, in <module>
     else: main(sys.argv)
   File "toIcal.py", line 404, in main
     sts = load(addr)
   File "/Users/karl/Sites/w3.org/WWW/2000/10/swap/myStore.py", line  
159, in load
     return _checkStore().load(uri, openFormula=openFormula,  
contentType=contentType,
   File "/Users/karl/Sites/w3.org/WWW/2000/10/swap/myStore.py", line  
94, in _checkStore
     import llyn   # default
   File "/Users/karl/Sites/w3.org/WWW/2000/10/swap/llyn.py", line 80,  
in <module>
     from formula import Formula, StoredStatement
   File "/Users/karl/Sites/w3.org/WWW/2000/10/swap/formula.py", line 26
     from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of  
the file



I gave up. Do you have any ideas to improve it?
I was thinking about writing in the comments of the program a link to  
a Web page with all the required dependencies.


-- 
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 Friday, 24 November 2006 09:34:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:18:00 GMT