[GRASS-SVN] r61381 - in grass/branches/releasebranch_7_0: . scripts/m.proj

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 23 16:15:15 PDT 2014


Author: neteler
Date: 2014-07-23 16:15:15 -0700 (Wed, 23 Jul 2014)
New Revision: 61381

Modified:
   grass/branches/releasebranch_7_0/
   grass/branches/releasebranch_7_0/scripts/m.proj/m.proj.py
Log:
m.proj: use grass.separator and allow multi-character separators (trunk, r60625)


Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
   - /grass/trunk:59505,59646,60100-60101,60215,60219,60278,60376,60610,60807,60835,60936-60937,61159-61160,61165,61275,61288,61290,61292,61294,61301
   + /grass/trunk:59505,59646,60100-60101,60215,60219,60278,60376,60610,60625,60807,60835,60936-60937,61159-61160,61165,61275,61288,61290,61292,61294,61301

Modified: grass/branches/releasebranch_7_0/scripts/m.proj/m.proj.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/m.proj/m.proj.py	2014-07-23 21:06:07 UTC (rev 61380)
+++ grass/branches/releasebranch_7_0/scripts/m.proj/m.proj.py	2014-07-23 23:15:15 UTC (rev 61381)
@@ -46,7 +46,6 @@
 #%end
 #%option G_OPT_F_SEP
 #% label: Field separator (format: input[,output])
-#% description: Valid field separators are also "space", "tab", or "comma"
 #% required : no
 #% guisection: Input coordinates
 #%end
@@ -159,34 +158,8 @@
 	except ValueError:
 	    ifs = ofs = fs
 
-    ifs = ifs.lower()
-    ofs = ofs.lower()
-    
-    if ifs in ('space', 'tab'):
-	ifs = ' '
-    elif ifs == 'comma':
-        ifs = ','
-    else:
-        if len(ifs) > 1:
-            grass.warning(_("Invalid field separator, using '%s'") % ifs[0])
-        try:
-            ifs = ifs[0]
-        except IndexError:
-            grass.fatal(_("Invalid field separator '%s'") % ifs)
-   
-    if ofs.lower() == 'space':
-        ofs = ' '
-    elif ofs.lower() == 'tab':
-        ofs = '\t'
-    elif ofs.lower() == 'comma':
-        ofs = ','
-    else:
-        if len(ofs) > 1:
-            grass.warning(_("Invalid field separator, using '%s'") % ofs[0])
-        try:
-            ofs = ofs[0]
-        except IndexError:
-            grass.fatal(_("Invalid field separator '%s'") % ifs)
+    ifs = grass.separator(ifs)
+    ofs = grass.separator(ofs)
 
     #### set up projection params
     s = grass.read_command("g.proj", flags='j')



More information about the grass-commit mailing list