Mercurial > dive4elements > river
comparison flys-backend/contrib/shpimporter/utils.py @ 2877:f0a67bc0e777 2.7
merged flys-backend/2.7
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:31 +0200 |
parents | 5a654f2e35bc |
children | 59ca5dab2782 |
comparison
equal
deleted
inserted
replaced
2793:6310b1582f2d | 2877:f0a67bc0e777 |
---|---|
1 import os | |
2 | |
3 SHP='.shp' | |
4 | |
5 def findShapefiles(path): | |
6 shapes = [] | |
7 | |
8 for root, dirs, files in os.walk(path): | |
9 if len(files) == 0: | |
10 continue | |
11 | |
12 print "Processing directory '%s' with %i files " % (root, len(files)) | |
13 | |
14 for f in files: | |
15 idx = f.find(SHP) | |
16 if (idx+len(SHP)) == len(f): | |
17 shapes.append((f.replace(SHP, ''), root + "/" + f)) | |
18 | |
19 return shapes | |
20 |