Last change
on this file since 18066 was 13358, checked in by neise, 13 years ago |
just some tests for file random walk ... just for me... DN
|
-
Property svn:executable
set to
*
|
File size:
488 bytes
|
Line | |
---|
1 | #!/usr/bin/python -itt
|
---|
2 |
|
---|
3 | import os.path
|
---|
4 |
|
---|
5 | def prin(arg, dirname, fnames):
|
---|
6 | print 'arg:', arg
|
---|
7 | print 'dirname', dirname
|
---|
8 | print 'fnames', fnames
|
---|
9 |
|
---|
10 | def prinif(arg, dirname, fnames):
|
---|
11 | found = False
|
---|
12 | for f in fnames:
|
---|
13 | if scan(f,arg):
|
---|
14 | print os.path.join(dirname,f)
|
---|
15 | def scan(f,arg):
|
---|
16 | ret = False
|
---|
17 | front, ext = os.path.splitext(f)
|
---|
18 | if arg in ext:
|
---|
19 | return True
|
---|
20 | elif ''==ext:
|
---|
21 | return False
|
---|
22 | else:
|
---|
23 | return scan(front,arg)
|
---|
24 | |
---|
Note:
See
TracBrowser
for help on using the repository browser.