Re: include.spyce odd path behavior - relative vs absolute paths
"Jonathan Ellis" <[email protected]> Tue, 11 Dec 2007 12:11:46 -0800
| Newsgroups | gmane.comp.python.spyce.general |
|---|---|
| Message-ID | <[email protected]> |
For most use cases it's more convenient to treat the path as a "path" the way the browser would interpret it. That's the only reason it works the way it does. If I were to revisit this for spyce 2.2 I would probably do it the way you suggest and just have the user use util.url2file if they want the docroot-relative path, but in earlier versions it's enough extra verbosity to import spyceUtil and do that that it wasn't worth it. -Jonathan On Tue, 11 Dec 2007 14:44:25 -0500, "Jason Persampieri" <[email protected]> said: > Howdy folks. Spyce newbie here. > > I have noticed an oddity in the *include.spyce* behavior. > > If the argument is a relative path - *include.spyce('../include.spy')* - > everything works fine. > > But if I pass an absolute path - > *include.spyce('/cluster/home/user/public_html/share/include.spy') > *- it looks like spyce prepends the spyce home directory (which in this > case > is the same as the http home) on to the path - * spyceNotFound: > spyceNotFound exception: could not find > "/common/www/html/cluster/home/user/public_html/share/include.spy" > > *While the absolute path behavior seems consistent with the > documentation, > this is incredibly odd. If I specify an absolute path, shouldn't it > assume > I'm pointing to exactly what I want? > > this whole thing is especially annoying since I need to *execfile *a > file > in the same directory (which *only* takes absolute paths seemingly) and > hence need to keep both a relative and absolute path reference. Piddly > to > be sure, but annoying. > > That said, Spyce is really rocking my world, and is *exactly* the right > solution for my project. > > Jason Persampieri > Programmer > Boston College Bioinformatics Dept. ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php