[GRASS-SVN] r65367 - grass/branches/releasebranch_7_0/lib/python/pygrass/vector
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jun 4 22:07:03 PDT 2015
Author: zarch
Date: 2015-06-04 22:07:03 -0700 (Thu, 04 Jun 2015)
New Revision: 65367
Modified:
grass/branches/releasebranch_7_0/lib/python/pygrass/vector/table.py
Log:
pygrass: backport 65076, Add VARCHAR column support on Table
Modified: grass/branches/releasebranch_7_0/lib/python/pygrass/vector/table.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/pygrass/vector/table.py 2015-06-05 05:03:32 UTC (rev 65366)
+++ grass/branches/releasebranch_7_0/lib/python/pygrass/vector/table.py 2015-06-05 05:07:03 UTC (rev 65367)
@@ -405,8 +405,10 @@
:type col_type: str
"""
valid_type = ('DOUBLE PRECISION', 'DOUBLE', 'INT', 'INTEGER',
- 'DATE')
- if 'VARCHAR' in col_type or col_type.upper() not in valid_type:
+ 'DATE', 'VARCHAR')
+ col = col_type.upper()
+ valid = [col.startswith(tp) for tp in valid_type]
+ if not any(valid):
str_err = ("Type: %r is not supported."
"\nSupported types are: %s")
raise TypeError(str_err % (col_type, ", ".join(valid_type)))
More information about the grass-commit
mailing list