Mercurial > dive4elements > river
comparison flys-backend/contrib/shpimporter/shpimporter.py @ 5005:eb2d6609387c dami
Importer: Fix directory paths and river name encoding
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 15 Feb 2013 16:19:52 +0100 |
parents | ab5d8f73a982 |
children | 769593a84606 |
comparison
equal
deleted
inserted
replaced
5004:f1c01fecf194 | 5005:eb2d6609387c |
---|---|
179 | 179 |
180 types = {} | 180 types = {} |
181 | 181 |
182 directories = [] | 182 directories = [] |
183 if not config.river_name: | 183 if not config.river_name: |
184 for file in os.listdir(config.directory): | 184 for file in [os.path.join(config.directory, d) for d in \ |
185 os.listdir(config.directory)]: | |
185 if os.path.isdir(file): | 186 if os.path.isdir(file): |
186 directories.append(os.path.join(file)) | 187 directories.append(file) |
187 else: | 188 else: |
188 directories.append(config.directory) | 189 directories.append(config.directory) |
189 | 190 |
190 for directory in directories: | 191 for directory in directories: |
191 if not config.river_name: | 192 if not config.river_name: |
192 river_name = os.path.basename(os.path.normpath(directory)) | 193 river_name = utils.getUTF8Path( |
194 os.path.basename(os.path.normpath(directory))) | |
193 else: | 195 else: |
194 river_name = config.river_name | 196 river_name = config.river_name |
195 river_id = utils.getRiverId(dbconn_raw, river_name) | 197 river_id = utils.getRiverId(dbconn_raw, river_name) |
196 | 198 |
197 if not river_id: | 199 if not river_id: |