[GRASS-SVN] r70476 - in grass/trunk: display/d.mon doc/python/script gui/wxpython gui/wxpython/core gui/wxpython/datacatalog gui/wxpython/gmodeler gui/wxpython/gui_core gui/wxpython/iscatt gui/wxpython/lmgr gui/wxpython/location_wizard gui/wxpython/mapdisp gui/wxpython/timeline gui/wxpython/tplot lib/init lib/python/gunittest lib/python/pygrass/tests lib/python/script man raster/r.mapcalc/testsuite scripts/g.extension scripts/g.search.modules scripts/r.in.wms scripts/v.rast.stats tools

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 2 07:41:19 PST 2017


Author: wenzeslaus
Date: 2017-02-02 07:41:19 -0800 (Thu, 02 Feb 2017)
New Revision: 70476

Modified:
   grass/trunk/display/d.mon/render_cmd.py
   grass/trunk/doc/python/script/r.example.py
   grass/trunk/gui/wxpython/core/debug.py
   grass/trunk/gui/wxpython/core/render.py
   grass/trunk/gui/wxpython/core/utils.py
   grass/trunk/gui/wxpython/core/ws.py
   grass/trunk/gui/wxpython/datacatalog/tree.py
   grass/trunk/gui/wxpython/gis_set.py
   grass/trunk/gui/wxpython/gmodeler/dialogs.py
   grass/trunk/gui/wxpython/gmodeler/model.py
   grass/trunk/gui/wxpython/gui_core/ghelp.py
   grass/trunk/gui/wxpython/gui_core/preferences.py
   grass/trunk/gui/wxpython/gui_core/pyedit.py
   grass/trunk/gui/wxpython/iscatt/plots.py
   grass/trunk/gui/wxpython/lmgr/frame.py
   grass/trunk/gui/wxpython/location_wizard/wizard.py
   grass/trunk/gui/wxpython/mapdisp/main.py
   grass/trunk/gui/wxpython/timeline/frame.py
   grass/trunk/gui/wxpython/tplot/frame.py
   grass/trunk/lib/init/grass.py
   grass/trunk/lib/python/gunittest/case.py
   grass/trunk/lib/python/gunittest/reporters.py
   grass/trunk/lib/python/pygrass/tests/benchmark.py
   grass/trunk/lib/python/script/core.py
   grass/trunk/man/build_class_graphical.py
   grass/trunk/man/build_graphical_index.py
   grass/trunk/man/build_manual_gallery.py
   grass/trunk/man/parser_standard_options.py
   grass/trunk/raster/r.mapcalc/testsuite/test_row_above_below_bug.py
   grass/trunk/scripts/g.extension/g.extension.py
   grass/trunk/scripts/g.search.modules/g.search.modules.py
   grass/trunk/scripts/r.in.wms/wms_base.py
   grass/trunk/scripts/v.rast.stats/v.rast.stats.py
   grass/trunk/tools/mkhtml.py
Log:
Python 2.6 does not support ommitting of positional argument specifiers

Fixes ValueError: zero length field name in format


Modified: grass/trunk/display/d.mon/render_cmd.py
===================================================================
--- grass/trunk/display/d.mon/render_cmd.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/display/d.mon/render_cmd.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -11,7 +11,7 @@
     width = height = legfile = None
     fd = open(env_file, 'r')
     if fd is None:
-        grass.fatal("Unable to open file '{}'".format(env_file))
+        grass.fatal("Unable to open file '{0}'".format(env_file))
     lines = fd.readlines()
     for l in lines:
         if l.startswith('#'):
@@ -40,7 +40,7 @@
     try:
         grass.run_command(cmd[0], env=env, **cmd[1])
     except Exception as e:
-        grass.debug(1, "Unable to render: {}".format(e))
+        grass.debug(1, "Unable to render: {0}".format(e))
 
 # update cmd file
 def update_cmd_file(cmd_file, cmd, mapfile):
@@ -54,13 +54,13 @@
     # update cmd file
     fd = open(cmd_file, mode)
     if fd is None:
-        grass.fatal("Unable to open file '{}'".format(cmd_file))
+        grass.fatal("Unable to open file '{0}'".format(cmd_file))
     if mode == 'a':
         frame = os.getenv('GRASS_RENDER_FRAME', None)
         if frame:
-            fd.write('# GRASS_RENDER_FRAME={}\n'.format(frame))
+            fd.write('# GRASS_RENDER_FRAME={0}\n'.format(frame))
         if mapfile:
-            fd.write('# GRASS_RENDER_FILE={}\n'.format(mapfile))
+            fd.write('# GRASS_RENDER_FILE={0}\n'.format(mapfile))
         fd.write(' '.join(gtask.cmdtuple_to_list(cmd)))
         fd.write('\n')
     else:

Modified: grass/trunk/doc/python/script/r.example.py
===================================================================
--- grass/trunk/doc/python/script/r.example.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/doc/python/script/r.example.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -26,7 +26,7 @@
     try:
         stats = gscript.parse_command('r.univar', map=input_raster, flags='g')
     except CalledModuleError as e:
-        gscript.fatal('{}'.format(e))
+        gscript.fatal('{0}'.format(e))
     raster_mean = float(stats['mean'])
     raster_stddev = float(stats['stddev'])
     raster_high = raster_mean + raster_stddev

Modified: grass/trunk/gui/wxpython/core/debug.py
===================================================================
--- grass/trunk/gui/wxpython/core/debug.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/core/debug.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -45,12 +45,12 @@
             self.debuglevel = int(grass.gisenv().get('WX_DEBUG', 0))
             if self.debuglevel < 0 or self.debuglevel > 5:
                 raise ValueError(
-                    _("Wx debug level {}.").format(
+                    _("Wx debug level {0}.").format(
                         self.debuglevel))
         except ValueError as e:
             self.debuglevel = 0
             sys.stderr.write(
-                _("WARNING: Ignoring unsupported wx debug level (must be >=0 and <=5). {}\n").format(e))
+                _("WARNING: Ignoring unsupported wx debug level (must be >=0 and <=5). {0}\n").format(e))
 
     def msg(self, level, message, *args):
         """Print debug message

Modified: grass/trunk/gui/wxpython/core/render.py
===================================================================
--- grass/trunk/gui/wxpython/core/render.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/core/render.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -411,7 +411,7 @@
 
     def Abort(self):
         """Abort rendering process"""
-        Debug.msg(1, "RenderLayerMgr({}).Abort()".format(self.layer))
+        Debug.msg(1, "RenderLayerMgr({0}).Abort()".format(self.layer))
         self.thread.Terminate()
 
         # force rendering layer next time
@@ -1272,7 +1272,7 @@
 
         renderMgr = layer.GetRenderMgr()
         Debug.msg(
-            1, "Map.AddLayer(): ltype={}, command={}".format(
+            1, "Map.AddLayer(): ltype={0}, command={1}".format(
                 ltype, layer.GetCmd(
                     string=True)))
         if renderMgr:
@@ -1333,7 +1333,7 @@
 
     def SetLayers(self, layers):
         self.layers = layers
-        Debug.msg(5, "Map.SetLayers(): layers={}".format([EncodeString(layer.GetCmd(string=True)) for layer in layers]))
+        Debug.msg(5, "Map.SetLayers(): layers={0}".format([EncodeString(layer.GetCmd(string=True)) for layer in layers]))
 
     def ChangeLayer(self, layer, render=False, **kargs):
         """Change map layer properties
@@ -1483,7 +1483,7 @@
 
         renderMgr = overlay.GetRenderMgr()
         Debug.msg(
-            1, "Map.AddOverlay(): cmd={}".format(EncodeString(
+            1, "Map.AddOverlay(): cmd={0}".format(EncodeString(
                 overlay.GetCmd(
                     string=True))))
         if renderMgr:

Modified: grass/trunk/gui/wxpython/core/utils.py
===================================================================
--- grass/trunk/gui/wxpython/core/utils.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/core/utils.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -532,7 +532,7 @@
         try:
             f = open(path, "r")
         except IOError:
-            raise OpenError(_("failed to open '{}'").format(path))
+            raise OpenError(_("failed to open '{0}'").format(path))
 
         code = None
         for line in f.readlines():
@@ -547,7 +547,7 @@
                 try:
                     code = int(code.replace('<', '').replace('>', ''))
                 except ValueError as e:
-                    raise OpenError('{}'.format(e))
+                    raise OpenError('{0}'.format(e))
 
             if code is not None:
                 epsgCodeDict[code] = (descr, params)
@@ -555,7 +555,7 @@
 
         f.close()
     except Exception as e:
-        raise OpenError('{}'.format(e))
+        raise OpenError('{0}'.format(e))
 
     return epsgCodeDict
 
@@ -1207,7 +1207,7 @@
     if 'GUI_PID' in env:
         guiPid = env['GUI_PID'].split(',')
     guiPid.append(str(pid))
-    grass.run_command('g.gisenv', set='GUI_PID={}'.format(','.join(guiPid)))
+    grass.run_command('g.gisenv', set='GUI_PID={0}'.format(','.join(guiPid)))
 
 
 def unregisterPid(pid):
@@ -1225,7 +1225,7 @@
         guiPid.remove(pid)
         grass.run_command(
             'g.gisenv',
-            set='GUI_PID={}'.format(
+            set='GUI_PID={0}'.format(
                 ','.join(guiPid)))
 
 if __name__ == '__main__':

Modified: grass/trunk/gui/wxpython/core/ws.py
===================================================================
--- grass/trunk/gui/wxpython/core/ws.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/core/ws.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -245,7 +245,7 @@
 
     def Abort(self):
         """Abort rendering process"""
-        Debug.msg(1, "RenderWMSMgr({}).Abort()".format(self.layer))
+        Debug.msg(1, "RenderWMSMgr({0}).Abort()".format(self.layer))
         self.thread.Terminate()
 
         # force rendering layer next time

Modified: grass/trunk/gui/wxpython/datacatalog/tree.py
===================================================================
--- grass/trunk/gui/wxpython/datacatalog/tree.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/datacatalog/tree.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -125,7 +125,7 @@
     else:
         listOfMapsets = mapsets.split(',')
         Debug.msg(
-            4, "Location <{}>: {} mapsets found".format(
+            4, "Location <{0}>: {1} mapsets found".format(
                 location, len(listOfMapsets)))
         for each in listOfMapsets:
             maps_dict[each] = {}
@@ -147,7 +147,7 @@
         # fill dictionary
         listOfMaps = maplist.splitlines()
         Debug.msg(
-            4, "Location <{}>: {} maps found".format(
+            4, "Location <{0}>: {1} maps found".format(
                 location, len(listOfMaps)))
         for each in listOfMaps:
             ltype, wholename = each.split('/')
@@ -298,7 +298,7 @@
         location_nodes = []
         nlocations = len(locations)
         grassdata_node = self._model.AppendNode(
-            parent=self._model.root, label=_('GRASS locations in {}').format(
+            parent=self._model.root, label=_('GRASS locations in {0}').format(
                 genv['GISDBASE']), data=dict(
                 type='grassdata'))
         for location in locations:
@@ -310,7 +310,7 @@
             loc_count += 1
 
             Debug.msg(
-                3, "Scanning location <{}> ({}/{})".format(location, loc_count, nlocations))
+                3, "Scanning location <{0}> ({1}/{2})".format(location, loc_count, nlocations))
 
             q = Queue()
             p = Process(target=getLocationTree,

Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/gis_set.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -772,7 +772,7 @@
         except (UnicodeEncodeError, UnicodeDecodeError) as e:
             GError(parent=self,
                    message=_("Unicode error detected. "
-                             "Check your locale settings. Details: {}").format(e),
+                             "Check your locale settings. Details: {0}").format(e),
                    showTraceback=False)
 
         self.lblocations.Clear()

Modified: grass/trunk/gui/wxpython/gmodeler/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/dialogs.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/gmodeler/dialogs.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -922,7 +922,7 @@
                 options = action.GetParameterizedParams()
                 params = []
                 for f in options['flags']:
-                    params.append('-{}'.format(f['name']))
+                    params.append('-{0}'.format(f['name']))
                 for p in options['params']:
                     params.append(p['name'])
 

Modified: grass/trunk/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/gmodeler/model.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -1862,7 +1862,7 @@
             else:
                 tabName = _("empty")
             raise GException(
-                _("Details: unsupported tag name '{}'.").format(tagName))
+                _("Details: unsupported tag name '{0}'.").format(tagName))
 
         # list of actions, data
         self.properties = dict()

Modified: grass/trunk/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/ghelp.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/gui_core/ghelp.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -299,7 +299,7 @@
         except CalledModuleError as error:
             text = _("Unable to provide citation suggestion,"
                      " see GRASS GIS website instead."
-                     " The error was: {}").format(error)
+                     " The error was: {0}").format(error)
 
         # put text into a scrolling panel
         window = ScrolledPanel(self.aboutNotebook)

Modified: grass/trunk/gui/wxpython/gui_core/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/preferences.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/gui_core/preferences.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -1882,7 +1882,7 @@
             epsgCombo.SetItems([])
             GError(
                 parent=self,
-                message=_("Unable to read EPGS codes: {}").format(e),
+                message=_("Unable to read EPGS codes: {0}").format(e),
                 showTraceback=False)
             return
 

Modified: grass/trunk/gui/wxpython/gui_core/pyedit.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/pyedit.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/gui_core/pyedit.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -234,7 +234,7 @@
     try:
         stats = gscript.parse_command('r.univar', map=input_raster, flags='g')
     except CalledModuleError as e:
-        gscript.fatal('{}'.format(e))
+        gscript.fatal('{0}'.format(e))
     raster_mean = float(stats['mean'])
     raster_stddev = float(stats['stddev'])
     raster_high = raster_mean + raster_stddev

Modified: grass/trunk/gui/wxpython/iscatt/plots.py
===================================================================
--- grass/trunk/gui/wxpython/iscatt/plots.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/iscatt/plots.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -40,7 +40,7 @@
     import matplotlib.cbook as cbook
 except ImportError as e:
     raise ImportError(_('The Scatterplot Tool needs the "matplotlib" '
-                        '(python-matplotlib) package to be installed. {}').format(e))
+                        '(python-matplotlib) package to be installed. {0}').format(e))
 
 import grass.script as grass
 from grass.pydispatch.signal import Signal

Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/lmgr/frame.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -2516,7 +2516,7 @@
             grass.warning(_("Unable to exit GRASS shell: unknown PID"))
             return
 
-        Debug.msg(1, "Exiting shell with pid={}".format(shellPid))
+        Debug.msg(1, "Exiting shell with pid={0}".format(shellPid))
         import signal
         os.kill(shellPid, signal.SIGTERM)
 

Modified: grass/trunk/gui/wxpython/location_wizard/wizard.py
===================================================================
--- grass/trunk/gui/wxpython/location_wizard/wizard.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/location_wizard/wizard.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -1693,7 +1693,7 @@
         except OpenError as e:
             GError(
                 parent=self,
-                message=_("Unable to read EPGS codes: {}").format(e),
+                message=_("Unable to read EPGS codes: {0}").format(e),
                 showTraceback=False)
             self.epsglist.Populate(list(), update=True)
             return
@@ -1940,7 +1940,7 @@
         except OpenError as e:
             GError(
                 parent=self,
-                message=_("Unable to read IAU codes: {}").format(e),
+                message=_("Unable to read IAU codes: {0}").format(e),
                 showTraceback=False)
             self.epsglist.Populate(list(), update=True)
             return

Modified: grass/trunk/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/main.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/mapdisp/main.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -480,9 +480,9 @@
         width, height = self.MapWindow.GetClientSize()
         for line in fileinput.input(monFile['env'], inplace=True):
             if 'GRASS_RENDER_WIDTH' in line:
-                print 'GRASS_RENDER_WIDTH={}'.format(width)
+                print 'GRASS_RENDER_WIDTH={0}'.format(width)
             elif 'GRASS_RENDER_HEIGHT' in line:
-                print 'GRASS_RENDER_HEIGHT={}'.format(height)
+                print 'GRASS_RENDER_HEIGHT={0}'.format(height)
             else:
                 print line.rstrip('\n')
 

Modified: grass/trunk/gui/wxpython/timeline/frame.py
===================================================================
--- grass/trunk/gui/wxpython/timeline/frame.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/timeline/frame.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -37,7 +37,7 @@
     from matplotlib import cbook
 except ImportError as e:
     raise ImportError(_('The Timeline Tool needs the "matplotlib" '
-                        '(python-matplotlib) package to be installed. {}').format(e))
+                        '(python-matplotlib) package to be installed. {0}').format(e))
 
 import grass.script as grass
 from core.utils import _

Modified: grass/trunk/gui/wxpython/tplot/frame.py
===================================================================
--- grass/trunk/gui/wxpython/tplot/frame.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/gui/wxpython/tplot/frame.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -41,7 +41,7 @@
     from matplotlib import cbook
 except ImportError as e:
     raise ImportError(_('The Temporal Plot Tool needs the "matplotlib" '
-                        '(python-matplotlib) package to be installed. {}').format(e))
+                        '(python-matplotlib) package to be installed. {0}').format(e))
 
 from core.utils import _
 

Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/lib/init/grass.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -1071,7 +1071,7 @@
         except:
             continue
 
-        debug("Environmental variable set {}={}".format(k, v))
+        debug("Environmental variable set {0}={1}".format(k, v))
         os.environ[k] = v
 
     # Allow for mixed ISIS-GRASS Environment
@@ -1399,11 +1399,11 @@
         return
     import signal
     for pid in env['GUI_PID'].split(','):
-        debug("Exiting GUI with pid={}".format(pid))
+        debug("Exiting GUI with pid={0}".format(pid))
         try:
             os.kill(int(pid), signal.SIGTERM)
         except OSError as e:
-            message(_("Unable to close GUI. {}").format(e))
+            message(_("Unable to close GUI. {0}").format(e))
         
 def clear_screen():
     """Clear terminal"""
@@ -1891,7 +1891,7 @@
         # User selects LOCATION and MAPSET if not set
         if not set_mapset_interactive(grass_gui):
             # No GUI available, update gisrc file
-            fatal(_("<{}> requested, but not available. Run GRASS in text "
+            fatal(_("<{0}> requested, but not available. Run GRASS in text "
                     "mode (-text) or install missing package (usually "
                     "'grass-gui').").format(grass_gui))
     else:

Modified: grass/trunk/lib/python/gunittest/case.py
===================================================================
--- grass/trunk/lib/python/gunittest/case.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/lib/python/gunittest/case.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -1140,7 +1140,7 @@
         module = _module_from_parameters(module, **kwargs)
         _check_module_run_parameters(module)
         if not shutil_which(module.name):
-            stdmsg = "Cannot find the module '{}'".format(module.name)
+            stdmsg = "Cannot find the module '{0}'".format(module.name)
             self.fail(self._formatMessage(msg, stdmsg))
         try:
             module.run()

Modified: grass/trunk/lib/python/gunittest/reporters.py
===================================================================
--- grass/trunk/lib/python/gunittest/reporters.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/lib/python/gunittest/reporters.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -721,7 +721,7 @@
             if type(modules) is not list:
                 modules = [modules]
             file_index.write(
-                '<tr><td>Tested modules</td><td>{}</td></tr>'.format(
+                '<tr><td>Tested modules</td><td>{0}</td></tr>'.format(
                     ', '.join(sorted(set(modules)))))
         file_index.write('</tbody></table>')
 

Modified: grass/trunk/lib/python/pygrass/tests/benchmark.py
===================================================================
--- grass/trunk/lib/python/pygrass/tests/benchmark.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/lib/python/pygrass/tests/benchmark.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -282,7 +282,7 @@
             for oper, operdict in operation.items():
                 operdict['time'], operdict['times'] = mytimer(operdict['func'],runs)
                 if profile:
-                    filename = '{}_{}_{}'.format(execmode, oper, profile)
+                    filename = '{0}_{1}_{2}'.format(execmode, oper, profile)
                     cProfile.runctx(operdict['func'].__name__ + '()',
                                     globals(), locals(), filename = filename)
                 print(('    {0}: {1: 40.6f}s'.format(oper, operdict['time'])))

Modified: grass/trunk/lib/python/script/core.py
===================================================================
--- grass/trunk/lib/python/script/core.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/lib/python/script/core.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -64,7 +64,7 @@
             and kwargs.get('executable') is None):
             cmd = shutil_which(args[0])
             if cmd is None:
-                raise OSError(_("Cannot find the executable {}")
+                raise OSError(_("Cannot find the executable {0}")
                               .format(args[0]))
             args = [cmd] + args[1:]
             name, ext = os.path.splitext(cmd)
@@ -1592,10 +1592,10 @@
         try:
             _debug_level = int(gisenv().get('DEBUG', 0))
             if _debug_level < 0 or _debug_level > 5:
-                raise ValueError(_("Debug level {}").format(_debug_level))
+                raise ValueError(_("Debug level {0}").format(_debug_level))
         except ValueError as e:
             _debug_level = 0
-            sys.stderr.write(_("WARNING: Ignoring unsupported debug level (must be >=0 and <=5). {}\n").format(e))
+            sys.stderr.write(_("WARNING: Ignoring unsupported debug level (must be >=0 and <=5). {0}\n").format(e))
             
     return _debug_level
 

Modified: grass/trunk/man/build_class_graphical.py
===================================================================
--- grass/trunk/man/build_class_graphical.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/man/build_class_graphical.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -148,7 +148,7 @@
     elif module_family == 'guimodules':
         output.write("<h3>g.gui.* modules:</h3>")
     else:
-        output.write("<h3>{} modules:</h3>".format(to_title(module_family)))
+        output.write("<h3>{0} modules:</h3>".format(to_title(module_family)))
     output.write('<ul class="img-list">')
 
     #for all modules:

Modified: grass/trunk/man/build_graphical_index.py
===================================================================
--- grass/trunk/man/build_graphical_index.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/man/build_graphical_index.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -86,7 +86,7 @@
 
 
 def std_img_name(name):
-    return "gi_{}.jpg".format(name)
+    return "gi_{0}.jpg".format(name)
 
 
 index_items = [

Modified: grass/trunk/man/build_manual_gallery.py
===================================================================
--- grass/trunk/man/build_manual_gallery.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/man/build_manual_gallery.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -32,7 +32,7 @@
 img_blacklist = ['grass_logo.png', 'grass_icon.png']
 # circles with numbers from helptext.html (unfortunate we have to list it here)
 # perhaps some general name ending would be good, like *_noindex.png
-img_blacklist.extend(['circle_{}.png'.format(num) for num in range(1, 6)])
+img_blacklist.extend(['circle_{0}.png'.format(num) for num in range(1, 6)])
 
 year = os.getenv("VERSION_DATE")
 
@@ -97,7 +97,7 @@
 def img_in_html(filename, imagename):
     # for some reason, calling search just once is much faster
     # than calling it on every line (time is spent in _compile)
-    pattern = re.compile('<img .*src=.{}.*>'.format(imagename))
+    pattern = re.compile('<img .*src=.{0}.*>'.format(imagename))
     with open(filename) as file:
         if re.search(pattern, file.read()):
             return True

Modified: grass/trunk/man/parser_standard_options.py
===================================================================
--- grass/trunk/man/parser_standard_options.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/man/parser_standard_options.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -107,7 +107,7 @@
 
     def html(self, endline='\n', indent='  ', toptions='border=1'):
         """Return a HTML table with the options"""
-        html = ['<table{}>'.format(' ' + toptions if toptions else '')]
+        html = ['<table{0}>'.format(' ' + toptions if toptions else '')]
         # write headers
         html.append(indent + "<thead>")
         html.append(indent + "<tr>")

Modified: grass/trunk/raster/r.mapcalc/testsuite/test_row_above_below_bug.py
===================================================================
--- grass/trunk/raster/r.mapcalc/testsuite/test_row_above_below_bug.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/raster/r.mapcalc/testsuite/test_row_above_below_bug.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -73,7 +73,7 @@
     def r_mapcalc_with_test(self, expression):
         """Expects just RHS and inputs as ``{m}`` for format function"""
         expression = expression.format(m=self.input)
-        expression = "{} = {}".format(self.output, expression)
+        expression = "{0} = {1}".format(self.output, expression)
         self.assertModule('r.mapcalc', expression=expression, overwrite=True)
         self.assertRasterExists(self.output)
         self.to_remove.append(self.output)

Modified: grass/trunk/scripts/g.extension/g.extension.py
===================================================================
--- grass/trunk/scripts/g.extension/g.extension.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/scripts/g.extension/g.extension.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -307,10 +307,10 @@
     for tnode in tree.findall('task'):
         if flags['g']:
             desc, keyw = get_optional_params(tnode)
-            ret.append('name={}'.format(tnode.get('name').strip()))
-            ret.append('description={}'.format(desc))
-            ret.append('keywords={}'.format(keyw))
-            ret.append('executables={}'.format(','.join(
+            ret.append('name={0}'.format(tnode.get('name').strip()))
+            ret.append('description={0}'.format(desc))
+            ret.append('keywords={0}'.format(keyw))
+            ret.append('executables={0}'.format(','.join(
                 get_module_executables(tnode))
             ))
         else:
@@ -326,7 +326,7 @@
 
     For toolboxes it lists also all modules.
     """
-    gscript.debug("list_available_extensions(url={})".format(url))
+    gscript.debug("list_available_extensions(url={0})".format(url))
     if flags['t']:
         grass.message(_("List of available extensions (toolboxes):"))
         tlist = get_available_toolboxes(url)
@@ -808,10 +808,10 @@
         tree = etree_fromurl(url, proxies=PROXIES)
     except (HTTPError, URLError, IOError, OSError) as error:
         grass.error(_("Unable to read addons metadata file"
-                      " from the remote server: {}").format(error))
+                      " from the remote server: {0}").format(error))
         return data, bin_list
     except ETREE_EXCEPTIONS as error:
-        grass.warning(_("Unable to parse '%s': {}").format(error) % url)
+        grass.warning(_("Unable to parse '%s': {0}").format(error) % url)
         return data, bin_list
     for mnode in tree.findall('task'):
         name = mnode.get('name')
@@ -938,7 +938,7 @@
                 'patch': version[2]}
 
     # resolve ZIP URL
-    source, url = resolve_source_code(url='{}/{}.zip'.format(base_url, name))
+    source, url = resolve_source_code(url='{0}/{1}.zip'.format(base_url, name))
 
     # to hide non-error messages from subprocesses
     if grass.verbosity() <= 2:
@@ -995,7 +995,7 @@
     a different directory in the way that if there was one directory extracted,
     the contained files are moved.
     """
-    gscript.debug("move_extracted_files({})".format(locals()))
+    gscript.debug("move_extracted_files({0})".format(locals()))
     if len(files) == 1:
         shutil.copytree(os.path.join(extract_dir, files[0]), target_dir)
     else:
@@ -1056,7 +1056,7 @@
         move_extracted_files(extract_dir=extract_dir,
                              target_dir=directory, files=files)
     except zipfile.BadZipfile as error:
-        gscript.fatal(_("ZIP file is unreadable: {}").format(error))
+        gscript.fatal(_("ZIP file is unreadable: {0}").format(error))
 
 
 # TODO: solve the other related formats
@@ -1075,7 +1075,7 @@
         move_extracted_files(extract_dir=extract_dir,
                              target_dir=directory, files=files)
     except tarfile.TarError as error:
-        gscript.fatal(_("Archive file is unreadable: {}").format(error))
+        gscript.fatal(_("Archive file is unreadable: {0}").format(error))
 
 extract_tar.supported_formats = ['tar.gz', 'gz', 'bz2', 'tar', 'gzip', 'targz']
 
@@ -1116,7 +1116,7 @@
         fix_newlines(directory)
     else:
         # probably programmer error
-        grass.fatal(_("Unknown extension (addon) source type '{}'."
+        grass.fatal(_("Unknown extension (addon) source type '{0}'."
                       " Please report this to the grass-user mailing list.")
                     .format(source))
     assert os.path.isdir(directory)
@@ -1459,8 +1459,8 @@
             path = os.environ['GRASS_ADDON_BASE']
     if os.path.exists(path) and \
        not os.access(path, os.W_OK):
-        grass.fatal(_("You don't have permission to install extension to <{}>."
-                      " Try to run {} with administrator rights"
+        grass.fatal(_("You don't have permission to install extension to <{0}>."
+                      " Try to run {1} with administrator rights"
                       " (su or sudo).")
                     .format(path, 'g.extension'))
     # ensure dir sep at the end for cases where path is used as URL and pasted
@@ -1481,7 +1481,7 @@
     >>> resolve_xmlurl_prefix('http://grass.osgeo.org/addons/')
     'http://grass.osgeo.org/addons/'
     """
-    gscript.debug("resolve_xmlurl_prefix(url={}, source={})".format(url, source))
+    gscript.debug("resolve_xmlurl_prefix(url={0}, source={1})".format(url, source))
     if source == 'official':
         # use pregenerated modules XML file
         url = 'http://grass.osgeo.org/addons/grass%s/' % version[0]
@@ -1541,7 +1541,7 @@
             if url.startswith(start + value['domain']):
                 match = value
                 actual_start = start
-                gscript.verbose(_("Identified {} as known hosting service")
+                gscript.verbose(_("Identified {0} as known hosting service")
                                 .format(key))
                 for suffix in value['ignored_suffixes']:
                     if url.endswith(suffix):
@@ -1558,7 +1558,7 @@
         url = '{prefix}{base}{suffix}'.format(prefix=actual_start,
                                               base=url.rstrip('/'),
                                               suffix=match['url_end'])
-        gscript.verbose(_("Will use the following URL for download: {}")
+        gscript.verbose(_("Will use the following URL for download: {0}")
                         .format(url))
         return 'remote_zip', url
     else:

Modified: grass/trunk/scripts/g.search.modules/g.search.modules.py
===================================================================
--- grass/trunk/scripts/g.search.modules/g.search.modules.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/scripts/g.search.modules/g.search.modules.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -146,9 +146,9 @@
     import textwrap
 
     for item in data:
-        print('\n{}'.format(colorize(item['name'], attrs=['bold'])))
+        print('\n{0}'.format(colorize(item['name'], attrs=['bold'])))
         for attr in item['attributes']:
-            out = '{}: {}'.format(attr, item['attributes'][attr])
+            out = '{0}: {1}'.format(attr, item['attributes'][attr])
             out = textwrap.wrap(out, width=79, initial_indent=4 * ' ',
                                 subsequent_indent=4 * ' ' + len(attr) * ' ' + '  ')
             for line in out:

Modified: grass/trunk/scripts/r.in.wms/wms_base.py
===================================================================
--- grass/trunk/scripts/r.in.wms/wms_base.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/scripts/r.in.wms/wms_base.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -246,13 +246,13 @@
                     _("Authorization failed to <%s> when fetching capabilities") %
                     options['url'])
             else:
-                msg = _("Unable to fetch capabilities from <{}>. Reason: ").format(
+                msg = _("Unable to fetch capabilities from <{0}>. Reason: ").format(
                     options['url'])
 
                 if hasattr(e, 'reason'):
-                    msg += '{}'.format(e.reason)
+                    msg += '{0}'.format(e.reason)
                 else:
-                    msg += '{}'.format(e)
+                    msg += '{0}'.format(e)
 
                 grass.fatal(msg)
 

Modified: grass/trunk/scripts/v.rast.stats/v.rast.stats.py
===================================================================
--- grass/trunk/scripts/v.rast.stats/v.rast.stats.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/scripts/v.rast.stats/v.rast.stats.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -240,7 +240,7 @@
 
     first_line = 1
 
-    f.write("{}\n".format(grass.db_begin_transaction(fi['driver'])))
+    f.write("{0}\n".format(grass.db_begin_transaction(fi['driver'])))
     for line in p.stdout:
         if first_line:
             first_line = 0
@@ -267,7 +267,7 @@
             f.write(" %s=%s" % (colname, value))
 
         f.write(" WHERE %s=%s;\n" % (fi['key'], vars[0]))
-    f.write("{}\n".format(grass.db_commit_transaction(fi['driver'])))
+    f.write("{0}\n".format(grass.db_commit_transaction(fi['driver'])))
     p.wait()
     f.close()
 

Modified: grass/trunk/tools/mkhtml.py
===================================================================
--- grass/trunk/tools/mkhtml.py	2017-02-02 09:31:05 UTC (rev 70475)
+++ grass/trunk/tools/mkhtml.py	2017-02-02 15:41:19 UTC (rev 70476)
@@ -319,7 +319,7 @@
     # addons
     pgmname = os.path.basename(pgmdir)
     classname = index_names[pgmname[:pgmname.find('.')]]
-    url_source = urlparse.urljoin('{}{}/'.format(os.environ['SOURCE_URL'], classname),
+    url_source = urlparse.urljoin('{0}{1}/'.format(os.environ['SOURCE_URL'], classname),
                                   pgmname)
 else:
     url_source = urlparse.urljoin(source_url, pgmdir)



More information about the grass-commit mailing list