/[packages]/cauldron/dcraw/current/SOURCES/lcfile
ViewVC logotype

Contents of /cauldron/dcraw/current/SOURCES/lcfile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 53152 - (show annotations) (download)
Thu Feb 17 16:09:23 2011 UTC (13 years, 2 months ago) by ahmad
File size: 673 byte(s)
imported package dcraw
1 #!/usr/bin/python
2 # Lowercase a list of filenames and change spaces to underscores.
3 # Directories are descended recursively.
4 # Dave Coffin 12/14/99
5
6 from os import *
7 from os.path import *
8 from string import *
9 import exceptions
10 import errno
11 import sys
12
13 def dodir(list):
14 for name in list:
15 if isdir(name) and not islink(name):
16 orig = getcwd()
17 chdir(name)
18 dodir(listdir("."))
19 chdir(orig)
20 new = replace(lower(name)," ","_")
21 if new == name: continue
22 try:
23 rename(name,new)
24 except OSError, (errno,message):
25 print "Error renaming %s to %s: %s" % (name,new,message)
26
27 list = sys.argv[1:]
28 if list==[]: list=["."]
29
30 dodir(list)

  ViewVC Help
Powered by ViewVC 1.1.30