浏览代码

add opt to save capabilities XML file (merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@31699 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 17 年之前
父节点
当前提交
d58152dd22
共有 2 个文件被更改,包括 19 次插入4 次删除
  1. 16 1
      scripts/r.in.wms/r.in.wms
  2. 3 3
      scripts/r.in.wms/wms.request

+ 16 - 1
scripts/r.in.wms/r.in.wms

@@ -169,6 +169,14 @@
 #% guisection: Import
 #% guisection: Import
 #%end
 #%end
 #%option
 #%option
+#% key: cap_file
+#% type: string
+#% label: Filename to save capabilities XML file to
+#% description: Requires list available layers flag
+#% required: no
+#% guisection: Request
+#%end
+#%option
 #% key: v
 #% key: v
 #% type: integer
 #% type: integer
 #% description: Verbosity level
 #% description: Verbosity level
@@ -426,7 +434,14 @@ listLayers() {
 	g.message message=""
 	g.message message=""
 
 
 	if [ -e "$CAPABILITIES_FILE" ] ; then
 	if [ -e "$CAPABILITIES_FILE" ] ; then
-	    \rm -f "$CAPABILITIES_FILE" "${TMP}capabilities.txt" "$TMP"
+	    \rm -f "${TMP}capabilities.txt" "$TMP"
+
+	    if [ -n "$GIS_OPT_CAP_FILE" ] ; then
+		mv "$CAPABILITIES_FILE" "$GIS_OPT_CAP_FILE"
+	    else
+		\rm -f "$CAPABILITIES_FILE"
+	    fi
+    
         fi
         fi
         exit 1;
         exit 1;
 }
 }

+ 3 - 3
scripts/r.in.wms/wms.request

@@ -150,7 +150,7 @@ fi
 defaultIFS="$IFS"
 defaultIFS="$IFS"
 
 
 
 
-#####################
+####################################
 # name:     message
 # name:     message
 # purpose:  displays messages to the user
 # purpose:  displays messages to the user
 # usage: message level text
 # usage: message level text
@@ -166,7 +166,7 @@ message () {
 BC="bc"
 BC="bc"
 BCARGS="-l"
 BCARGS="-l"
 
 
-#####################3
+####################################
 # name: calculate
 # name: calculate
 # purpose: perform calculations
 # purpose: perform calculations
 # usage: varname "expr"
 # usage: varname "expr"
@@ -177,7 +177,7 @@ calculate() {
 	eval $1=$c_tmp
 	eval $1=$c_tmp
 }
 }
 
 
-################################################################
+####################################
 # Calculate the number of tiles!!
 # Calculate the number of tiles!!
 # Download and them
 # Download and them
 GetTiles() {
 GetTiles() {