[Greater-commits] r315 - trunk/GREAT-ER/Greater/Modules

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 30 11:30:42 CEST 2011


Author: aheinecke
Date: 2011-06-30 11:30:41 +0200 (Thu, 30 Jun 2011)
New Revision: 315

Modified:
   trunk/GREAT-ER/Greater/Modules/catchment.py
Log:
Write encoding files after the catchment files have been pulled from
the database.
This is currently based on the assumption that we only use UTF-8 encoding.


Modified: trunk/GREAT-ER/Greater/Modules/catchment.py
===================================================================
--- trunk/GREAT-ER/Greater/Modules/catchment.py	2011-06-30 09:26:14 UTC (rev 314)
+++ trunk/GREAT-ER/Greater/Modules/catchment.py	2011-06-30 09:30:41 UTC (rev 315)
@@ -582,6 +582,14 @@
             shapefiles[o.obj_sub_type] = filename
             if o.obj_sub_type == 'PICS':
                 pics_present = 1
+    # Write encoding files
+    # TODO make codepages dynamic
+    for fname in os.listdir(shapefile_dir):
+        if fname.endswith(".shp"):
+            fptr = open(os.path.join(shapefile_dir,
+                                     fname.replace(".shp", ".cpg")), "w")
+            fptr.write("UTF-8")
+            fptr.close()
 
     if pics_present:
         xmldata = xmldata_start + xmldata_pics + xmldata_end



More information about the Greater-commits mailing list