spyceProject.py abspath() needed.
"Yongsub Chung" <[email protected]> Mon, 11 Dec 2006 13:29:41 -0500
| Newsgroups | gmane.comp.python.spyce.general |
|---|---|
| Message-ID | <[email protected]> |
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