comparison flys-backend/contrib/shpimporter/utils.py @ 3800:69d19995bc3c 2.9.1

merged flys-backend/2.9.1
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:48 +0200
parents 59ca5dab2782
children b1d7e600b43b
comparison
equal deleted inserted replaced
3786:4adc35aa655c 3800:69d19995bc3c
1 import os
2 from shpimporter import DEBUG, INFO, ERROR
3
4 SHP='.shp'
5
6 def findShapefiles(path):
7 shapes = []
8
9 for root, dirs, files in os.walk(path):
10 if len(files) == 0:
11 continue
12
13 DEBUG("Processing directory '%s' with %i files " % (root, len(files)))
14
15 for f in files:
16 idx = f.find(SHP)
17 if (idx+len(SHP)) == len(f):
18 shapes.append((f.replace(SHP, ''), root + "/" + f))
19
20 return shapes
21

http://dive4elements.wald.intevation.org