[Greater-commits] r3815 - in trunk/greater-pre-processing: . doc

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Oct 14 11:14:52 CEST 2011


Author: aheinecke
Date: 2011-10-14 11:14:51 +0200 (Fri, 14 Oct 2011)
New Revision: 3815

Modified:
   trunk/greater-pre-processing/doc/howto.tex
   trunk/greater-pre-processing/greater-pre-processing.py
Log:
Fix how catchment description is written and add a warning
in the documentation


Modified: trunk/greater-pre-processing/doc/howto.tex
===================================================================
--- trunk/greater-pre-processing/doc/howto.tex	2011-10-14 08:36:36 UTC (rev 3814)
+++ trunk/greater-pre-processing/doc/howto.tex	2011-10-14 09:14:51 UTC (rev 3815)
@@ -24,6 +24,9 @@
 together with greater-pre-processing)
 
 \section{Running the Data Preprocessing}
+\begin{center}
+\begin{textbf} Warning GREAT-ER Preprocessing will modify your
+files! Keep a backup of your raw data! \end{textbf} \end{center}
 
 On Windows a shortcut called \"Catchment Preprocessing\" should
 have been installed in your Start Menu.

Modified: trunk/greater-pre-processing/greater-pre-processing.py
===================================================================
--- trunk/greater-pre-processing/greater-pre-processing.py	2011-10-14 08:36:36 UTC (rev 3814)
+++ trunk/greater-pre-processing/greater-pre-processing.py	2011-10-14 09:14:51 UTC (rev 3815)
@@ -33,7 +33,7 @@
 catchment = {}
 version_str = 'greater-pre-processing 1.2.0'
 usage_str = 'greater-pre-processing [check|help|run|run-without-cleanup|clean]'
-greater_pre_proc_path = os.path.abspath(os.path.dirname(sys.argv[0]))
+greater_pre_proc_path = '"%s"' % os.path.abspath(os.path.dirname(sys.argv[0]))
 
 # Static definition of what file contians which objects for the
 # Upload
@@ -892,7 +892,8 @@
             except:
                 wx.wxMessageBox("An error occurred:\n%s"
                                 % str(sys.exc_info()[1]),
-                                "Error preprocessing Catchment.")
+                                "Error preprocessing Catchment.\n"
+          "Please make sure that you can write files in the catchment directory.")
         finally:
             os.chdir(oldcwd)
             dialog.Destroy()
@@ -912,16 +913,8 @@
         uploading into the catchments.desc
     """
     cdir = catchment_page.catchment_dir
-    cfile = os.path.join(cdir, "catchment.desc")
-    with open(cfile, "w") as fptr:
-        fptr.write("ID=%s\n" % catchment_page.text_ID.GetValue())
-        fptr.write("NAME=%s\n" % catchment_page.text_NAME.GetValue())
-        fptr.write("DESCRIPTION=%s\n" % catchment_page.text_DESCRIPTION.GetValue())
-        fptr.write("GISFILELIST=./upload.list")
-        fptr.write("STRECH_TAB=./river2.att")
-        fptr.write("DISCH_TAB=./disch.att")
 
-    upfile = os.path.join(cdir, "catchment.desc")
+    upfile = os.path.join(cdir, "upload.list")
     with open(upfile, "w") as fptr:
         fptr.write(OUTPUT_FILES)
 
@@ -939,6 +932,9 @@
         fptr.write("DESCRIPTION=%s\n" % catchment_page.text_DESCRIPTION.GetValue())
         fptr.write("IN-VERSION=%s\n" % "1.0")
         fptr.write("OUT-VERSION=%s\n" % "2.0")
+        fptr.write("GISFILELIST=./upload.list\n")
+        fptr.write("STRETCH_TAB=./river2.att\n")
+        fptr.write("DISCH_TAB=./disch.att\n")
     return cfile
 
 if __name__ == '__main__':



More information about the Greater-commits mailing list