[GRASS-SVN] r67924 - grass-addons/grass7/raster/r.green/libgreen
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Feb 23 01:39:11 PST 2016
Author: Giulia
Date: 2016-02-23 01:39:11 -0800 (Tue, 23 Feb 2016)
New Revision: 67924
Modified:
grass-addons/grass7/raster/r.green/libgreen/utils.py
Log:
r.green: move lib sel_columns in utils
Modified: grass-addons/grass7/raster/r.green/libgreen/utils.py
===================================================================
--- grass-addons/grass7/raster/r.green/libgreen/utils.py 2016-02-23 09:18:33 UTC (rev 67923)
+++ grass-addons/grass7/raster/r.green/libgreen/utils.py 2016-02-23 09:39:11 UTC (rev 67924)
@@ -167,6 +167,26 @@
return p_x, p_y
+def sel_columns(element, vector_column):
+ """Return all the element in the opts that are column of the
+ vector. In the GUI the columns start with namevector_column prefix.
+
+ Parameters
+ ----------
+
+ elemet: element to be selected
+ vector_column: prefix with namevector_column
+
+ Returns
+ -------
+
+ False if the element is not present or True if present
+ """
+ if len(element) > 0:
+ return (element[:len(vector_column)] == vector_column)
+ return False
+
+
if __name__ == "__main__":
import doctest
doctest.testmod()
More information about the grass-commit
mailing list