浏览代码

Wrong order - where positioning in the sql string

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49291 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 13 年之前
父节点
当前提交
ced52384b5
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. 7 6
      temporal/t.list/t.list.py

+ 7 - 6
temporal/t.list/t.list.py

@@ -24,7 +24,7 @@
 #%option
 #% key: type
 #% type: string
-#% description: Type of the space time dataset, default is strds
+#% description: Type of the space time dataset or map, default is strds
 #% required: no
 #% options: strds, str3ds, stvds, rast, rast3d, vect
 #% answer: strds
@@ -36,17 +36,17 @@
 #% description: Sort the space time dataset by category. Columns number_of_maps and granularity only available fpr space time datasets
 #% required: no
 #% multiple: yes
-#% options: id, name, creator, mapset, number_of_maps, creation_time, modification_time, start_time, end_time, interval, north, south, west, east, granularity
+#% options: id, name, creator, mapset, number_of_maps, creation_time, start_time, end_time, interval, north, south, west, east, granularity
 #% answer: id
 #%end
 
 #%option
 #% key: columns
 #% type: string
-#% description: Which columns should be printed to stdout. Columns number_of_maps and granularity only available fpr space time datasets
+#% description: Which columns should be printed to stdout. Columns number_of_maps and granularity only available for space time datasets
 #% required: no
 #% multiple: yes
-#% options: id, name, creator, mapset, number_of_maps, creation_time, modification_time, revision, start_time, end_time, north, south, west, east, granularity, all
+#% options: id, name, creator, mapset, number_of_maps, creation_time, start_time, end_time, north, south, west, east, granularity, all
 #% answer: id
 #%end
 
@@ -116,11 +116,12 @@ def main():
     else:
         sql = "SELECT * FROM " + table
 
+    if where:
+        sql += " WHERE " + where
+
     if order:
         sql += " ORDER BY " + order
 
-    if where:
-        sql += " WHERE " + where
 
     dbif.cursor.execute(sql)
     rows = dbif.cursor.fetchall()