diff 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
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/shpimporter.py	Fri Feb 15 16:18:34 2013 +0100
+++ b/flys-backend/contrib/shpimporter/shpimporter.py	Fri Feb 15 16:19:52 2013 +0100
@@ -181,15 +181,17 @@
 
     directories = []
     if not config.river_name:
-        for file in os.listdir(config.directory):
+        for file in [os.path.join(config.directory, d) for d in \
+                os.listdir(config.directory)]:
             if os.path.isdir(file):
-                directories.append(os.path.join(file))
+                directories.append(file)
     else:
         directories.append(config.directory)
 
     for directory in directories:
         if not config.river_name:
-            river_name = os.path.basename(os.path.normpath(directory))
+            river_name = utils.getUTF8Path(
+                    os.path.basename(os.path.normpath(directory)))
         else:
             river_name = config.river_name
         river_id = utils.getRiverId(dbconn_raw, river_name)

http://dive4elements.wald.intevation.org