# HG changeset patch # User Andre Heinecke # Date 1360941592 -3600 # Node ID eb2d6609387cd82012411a9a04f746f1a1c4af8b # Parent f1c01fecf1942fcdc2f4f6ad6399e82319926bc2 Importer: Fix directory paths and river name encoding diff -r f1c01fecf194 -r eb2d6609387c flys-backend/contrib/shpimporter/shpimporter.py --- 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)