[GRASS-SVN] r70542 - in grass/branches/releasebranch_7_2: display/d.mon 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 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
Sun Feb 12 12:22:30 PST 2017


Author: neteler
Date: 2017-02-12 12:22:30 -0800 (Sun, 12 Feb 2017)
New Revision: 70542

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

Modified: grass/branches/releasebranch_7_2/display/d.mon/render_cmd.py
===================================================================
--- grass/branches/releasebranch_7_2/display/d.mon/render_cmd.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/display/d.mon/render_cmd.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/gui/wxpython/core/debug.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/core/debug.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/core/debug.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/gui/wxpython/core/render.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/core/render.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/core/render.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/gui/wxpython/core/utils.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/core/utils.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/core/utils.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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
 
@@ -1204,7 +1204,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):
@@ -1222,7 +1222,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/branches/releasebranch_7_2/gui/wxpython/core/ws.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/core/ws.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/core/ws.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/gui/wxpython/datacatalog/tree.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/datacatalog/tree.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/datacatalog/tree.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -138,7 +138,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] = {}
@@ -160,7 +160,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('/')
@@ -311,7 +311,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:
@@ -323,7 +323,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/branches/releasebranch_7_2/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/gis_set.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/gis_set.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -775,7 +775,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/branches/releasebranch_7_2/gui/wxpython/gmodeler/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/gmodeler/dialogs.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/gmodeler/dialogs.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/gmodeler/model.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/gmodeler/model.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/gui_core/ghelp.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/gui_core/ghelp.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -295,7 +295,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/branches/releasebranch_7_2/gui/wxpython/gui_core/preferences.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/gui_core/preferences.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/gui_core/preferences.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/gui/wxpython/gui_core/pyedit.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/gui_core/pyedit.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/gui_core/pyedit.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -235,7 +235,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/branches/releasebranch_7_2/gui/wxpython/iscatt/plots.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/iscatt/plots.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/iscatt/plots.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/lmgr/frame.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/lmgr/frame.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -2495,7 +2495,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/branches/releasebranch_7_2/gui/wxpython/location_wizard/wizard.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/location_wizard/wizard.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/location_wizard/wizard.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -1643,7 +1643,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
@@ -1890,7 +1890,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/branches/releasebranch_7_2/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/mapdisp/main.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/mapdisp/main.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/gui/wxpython/timeline/frame.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/timeline/frame.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/timeline/frame.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/gui/wxpython/tplot/frame.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/tplot/frame.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/gui/wxpython/tplot/frame.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_2/lib/init/grass.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/lib/init/grass.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -1055,7 +1055,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
@@ -1383,11 +1383,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"""
@@ -1875,7 +1875,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/branches/releasebranch_7_2/lib/python/gunittest/case.py
===================================================================
--- grass/branches/releasebranch_7_2/lib/python/gunittest/case.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/lib/python/gunittest/case.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/lib/python/gunittest/reporters.py
===================================================================
--- grass/branches/releasebranch_7_2/lib/python/gunittest/reporters.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/lib/python/gunittest/reporters.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/lib/python/pygrass/tests/benchmark.py
===================================================================
--- grass/branches/releasebranch_7_2/lib/python/pygrass/tests/benchmark.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/lib/python/pygrass/tests/benchmark.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/lib/python/script/core.py
===================================================================
--- grass/branches/releasebranch_7_2/lib/python/script/core.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/lib/python/script/core.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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)
@@ -1535,10 +1535,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/branches/releasebranch_7_2/man/build_class_graphical.py
===================================================================
--- grass/branches/releasebranch_7_2/man/build_class_graphical.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/man/build_class_graphical.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/man/build_graphical_index.py
===================================================================
--- grass/branches/releasebranch_7_2/man/build_graphical_index.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/man/build_graphical_index.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -86,7 +86,7 @@
 
 
 def std_img_name(name):
-    return "gi_{}.jpg".format(name)
+    return "gi_{0}.jpg".format(name)
 
 
 index_items = [

Modified: grass/branches/releasebranch_7_2/man/build_manual_gallery.py
===================================================================
--- grass/branches/releasebranch_7_2/man/build_manual_gallery.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/man/build_manual_gallery.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/man/parser_standard_options.py
===================================================================
--- grass/branches/releasebranch_7_2/man/parser_standard_options.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/man/parser_standard_options.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/scripts/g.extension/g.extension.py
===================================================================
--- grass/branches/releasebranch_7_2/scripts/g.extension/g.extension.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/scripts/g.extension/g.extension.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/scripts/g.search.modules/g.search.modules.py
===================================================================
--- grass/branches/releasebranch_7_2/scripts/g.search.modules/g.search.modules.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/scripts/g.search.modules/g.search.modules.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/scripts/r.in.wms/wms_base.py
===================================================================
--- grass/branches/releasebranch_7_2/scripts/r.in.wms/wms_base.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/scripts/r.in.wms/wms_base.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/scripts/v.rast.stats/v.rast.stats.py
===================================================================
--- grass/branches/releasebranch_7_2/scripts/v.rast.stats/v.rast.stats.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/scripts/v.rast.stats/v.rast.stats.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -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/branches/releasebranch_7_2/tools/mkhtml.py
===================================================================
--- grass/branches/releasebranch_7_2/tools/mkhtml.py	2017-02-12 20:07:52 UTC (rev 70541)
+++ grass/branches/releasebranch_7_2/tools/mkhtml.py	2017-02-12 20:22:30 UTC (rev 70542)
@@ -309,7 +309,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