Thread: [Rest2web-develop] Use of tilde as HOME indicator in paths
Brought to you by:
mjfoord
From: Grzegorz A. H. <gr...@ti...> - 2006-08-27 17:14:11
|
It would be good if ~ could be used inside paths through os.path.expanduser(). Right now full paths have to be used. |
From: Michael F. <fuz...@vo...> - 2006-08-27 17:21:35
|
Grzegorz Adam Hankiewicz wrote: > It would be good if ~ could be used inside paths through > os.path.expanduser(). Right now full paths have to be used. > Ok, but isn't a tilde also a valid part of a path name ? (I'm not Lunix user, so I don't know these things - but at least on Windoze it can be a valid part of a filename.) Do you just mean (or particularly mean) in the config file ? How about if paths starting with a tilde were expanded ? Fuzzyman http://www.voidspace.org.uk/python/index.shtml > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > > |
From: Grzegorz A. H. <gr...@ti...> - 2006-08-27 17:29:21
|
On 2006-08-27, Michael Foord <fuz...@vo...> wrote: > Ok, but isn't a tilde also a valid part of a path name ? (I'm > not Lunix user, so I don't know these things - but at least on > Windoze it can be a valid part of a filename.) Yes, which under Windows could be expanded to C:\documentblah blah\user or whatever it is. > Do you just mean (or particularly mean) in the config file ? How > about if paths starting with a tilde were expanded ? os.path.expanduser() only expands the tilde as first character, as any other implementation. Knowing this you can prefix a local file with `./' if it starts with tilde, though right know the other alternative is using full paths, which wouldn't allow tilde expansion anyway. |
From: Michael F. <fuz...@gm...> - 2006-10-09 23:28:29
|
On 27/08/06, Grzegorz Adam Hankiewicz <gr...@ti...> wrote: > > On 2006-08-27, Michael Foord <fuz...@vo...> wrote: > > Ok, but isn't a tilde also a valid part of a path name ? (I'm > > not Lunix user, so I don't know these things - but at least on > > Windoze it can be a valid part of a filename.) > > Yes, which under Windows could be expanded to C:\documentblah > blah\user or whatever it is. > > > Do you just mean (or particularly mean) in the config file ? How > > about if paths starting with a tilde were expanded ? > > os.path.expanduser() only expands the tilde as first character, > as any other implementation. Knowing this you can prefix a local > file with `./' if it starts with tilde, though right know the > other alternative is using full paths, which wouldn't allow tilde > expansion anyway. I've just fixed this. I now do 'expanduser' (~) expansion for the paths in the config file and the 'file' keyword in restindexes. Anywhere else ? Fuzzyman ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > -- http://www.Voidspace.org.uk The Place where headspace meets cyberspace. Online resource site - covering science, technology, computing, cyberpunk, psychology, spirituality, fiction and more. --- http://www.Voidspace.org.uk/python/index.shtml Python utilities, modules and apps. Including Nanagram, Dirwatcher and more. --- http://www.fuchsiashockz.co.uk --- Everyone has talent. What is rare is the courage to follow talent to the dark place where it leads. -Erica Jong Ambition is a poor excuse for not having sense enough to be lazy. -Milan Kundera |
From: Gael V. <gae...@no...> - 2006-10-09 23:32:16
|
On Tue, Oct 10, 2006 at 12:28:24AM +0100, Michael Foord wrote: > I now do 'expanduser' (~) expansion for the paths in the config file= and > the 'file' keyword in restindexes. > Anywhere else ? In the macros, such as "colorize" ? Ga=EBl |
From: Michael F. <fuz...@gm...> - 2006-10-09 23:35:34
|
On 10/10/06, Gael Varoquaux <gae...@no...> wrote: > > On Tue, Oct 10, 2006 at 12:28:24AM +0100, Michael Foord wrote: > > I now do 'expanduser' (~) expansion for the paths in the config file > and > > the 'file' keyword in restindexes. > > > Anywhere else ? > > In the macros, such as "colorize" ? Ok, I'll fix the macros that take filenames. Fuzzyman Ga=EBl > > ------------------------------------------------------------------------- > 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=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > --=20 http://www.Voidspace.org.uk The Place where headspace meets cyberspace. Online resource site - covering science, technology, computing, cyberpunk, psychology, spirituality, fictio= n and more. --- http://www.Voidspace.org.uk/python/index.shtml Python utilities, modules and apps. Including Nanagram, Dirwatcher and more. --- http://www.fuchsiashockz.co.uk --- Everyone has talent. What is rare is the courage to follow talent to the dark place where it leads. -Erica Jong Ambition is a poor excuse for not having sense enough to be lazy. -Milan Kundera |
From: Grzegorz A. H. <gr...@ti...> - 2006-12-06 19:55:39
|
On 2006-10-10, Michael Foord <fuz...@gm...> wrote: > I now do 'expanduser' (~) expansion for the paths in the config file and the > 'file' keyword in restindexes. > > Anywhere else ? In theory this should happen "everywhere", in a transparent way. What I mean about transparent is that if you let users write '~/something' in a configuration file, you can't write it back to disk as '/home/user/something', since that may be or not the same username on a different machine if I've copied that over the network to another machine/account, or just happen to work on Linux and Macs, where the paths are different. Internally that's a pain, since you basically need to maintain the enduser version and always expand it before using the filename. Sort of the same goes for symlinks, where you can't go up the tree with "cd .." because you may not end up in the place you expected. I've always been tempted to use a special filename class which would return the user specified string or the full real path name. This can be handy when you get two paths and try to find out if you can build a relative likn from one to the other. |
From: Michael F. <fuz...@vo...> - 2006-12-06 20:56:15
|
Grzegorz Adam Hankiewicz wrote: > On 2006-10-10, Michael Foord <fuz...@gm...> wrote: >> I now do 'expanduser' (~) expansion for the paths in the config file and the >> 'file' keyword in restindexes. >> >> Anywhere else ? > > In theory this should happen "everywhere", in a transparent way. As far as I *know* rest2web never writes back paths to configuration files or back into the restindexes. As far as I know it also now expands tilde in all the relevant places. If you find any I've missed let me know. Fuzzyman http://www.voidspace.org.uk/python/index.shtml -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.15.9/573 - Release Date: 05/12/2006 |