Re: spyceProject.py abspath() needed.

"Jonathan Ellis" <[email protected]> Mon, 11 Dec 2006 10:41:33 -0800
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
Thanks for the patch; I've applied it to the 2.1 branch in subversion.

-Jonathan

On Mon, 11 Dec 2006 13:29:41 -0500, "Yongsub Chung" <[email protected]>
said:
> Hello.
> Recently I knew about Spyce, and I liked the project.
> I was following tutorial and I found that spyceProject.py should be
> called in the actual spyce directory to see 'util' directory. (BTW,
> Version 2.1.3)  The command I ran was:
> 
> $ python /usr/local/spyce/spyceProject.py ~/prj/spyce/hello
> 
> This failed with:
> 
> Traceback (most recent call last):
>   File "/home/litdream/spyce-2.1/spyceProject.py", line 35, in ?
>     for fname in os.listdir('util'):
> OSError: [Errno 2] No such file or directory: 'util'
> 
> I looked at the sourcecode and wrote a quick fix:
> 
> 
> 5a6,7
> >     _prj_path = os.path.abspath(sys.argv[0])
> >     spyce_path = os.path.dirname(_prj_path)
> 35c37
> < for fname in os.listdir('util'):
> ---
> > for fname in os.listdir(os.path.join(spyce_path, 'util')):
> 38,39c40,43
> <     src = os.path.join('util', fname)
> <     dst = os.path.join(target, 'www', '_util', fname)
> ---
> >     src = os.path.join(spyce_path,os.path.join('util', fname))
> >     dst = os.path.join(spyce_path,os.path.join(target, 'www', '_util', fname))
> >
> >     print "------ %s   %s ----------" % (src, dst)
> 
> 
> I hope this should not break other codes because I am dealing with
> base directory name with separate variables.
> 
> Thanks for all who contributes this projects.
> Let me know if this doesn't make sense.  ( That's possible since I am
> completely newbie ;)  )
> 
>   Raymond Chung
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Spyce-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/spyce-users
-- 
C++ is history repeated as tragedy. Java is history repeated as farce.  --Scott McKay


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV