[GRASS-SVN] r61825 - sandbox/martinl

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 7 02:58:10 PDT 2014


Author: martinl
Date: 2014-09-07 02:58:10 -0700 (Sun, 07 Sep 2014)
New Revision: 61825

Added:
   sandbox/martinl/print_module_parameters.py
Log:
add simple script to print modules option keys and descriptions


Added: sandbox/martinl/print_module_parameters.py
===================================================================
--- sandbox/martinl/print_module_parameters.py	                        (rev 0)
+++ sandbox/martinl/print_module_parameters.py	2014-09-07 09:58:10 UTC (rev 61825)
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+
+# prints for each GRASS module list of option keys and descriptions
+
+from grass.script import task as gtask
+from grass.script.core import get_commands
+
+def main():
+    print '-' * 80
+    for cmd in sorted(get_commands()[0]):
+        task = gtask.grassTask(cmd)
+        print task.get_name()
+        for f in task.get_options()['flags']:
+            if len(f.get('name')) > 1: # skip overwrite, ...
+                continue
+            print '\t' + f.get('name') + ': ' + f.get('description')
+        for p in task.get_options()['params']:
+            print '\t' + p.get('name') + ': ' + p.get('description')
+        print '-' * 80
+
+if __name__ == "__main__":
+    main()


Property changes on: sandbox/martinl/print_module_parameters.py
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/x-python
Added: svn:eol-style
   + native



More information about the grass-commit mailing list