Browse Source

PEP8 fixes (#1317)

* PEP8: fix E101: indentation contains mixed spaces and tabs

* PEP8: fix E116: unexpected indentation (comment)

* PEP8: fix E122: continuation line missing indentation or outdented

* PEP8: fix E123: closing bracket does not match indentation of opening bracket's line

* PEP8: fix E124: closing bracket does not match visual indentation

* PEP8: fix E126: continuation line over-indented for hanging indent

* PEP8: fix E129: visually indented line with same indent as next logical line

* PEP8: fix E131: continuation line unaligned for hanging indent

* PEP8: fix E203: whitespace before ':'

* PEP8: fix E222: multiple spaces after operator

* PEP8: fix E228: missing whitespace around modulo operator

* PEP8: fix E241: multiple spaces after ','

* PEP8: fix E301: expected 1 blank line, found 0

* PEP8: fix E306: expected 1 blank line before a nested definition, found 0

* PEP8: fix E401: multiple imports on one line

* PEP8: fix E502: the backslash is redundant between brackets

* PEP8: fix W291: trailing whitespace

* PEP8: fix W391: blank line at end of file

* PEP8: no longer need to ignore E111, E228
Markus Neteler 4 năm trước cách đây
mục cha
commit
f3483cf55f
100 tập tin đã thay đổi với 581 bổ sung533 xóa
  1. 1 1
      db/db.copy/testsuite/test_dbcopy.py
  2. 1 1
      display/d.mon/render_cmd.py
  3. 1 0
      doc/gui/wxpython/example/dialogs.py
  4. 2 0
      doc/gui/wxpython/example/frame.py
  5. 3 0
      doc/gui/wxpython/example/toolbars.py
  6. 17 16
      doc/python/m.distance.py
  7. 2 2
      doc/python/raster_example_ctypes.py
  8. 4 3
      doc/python/vector_example_ctypes.py
  9. 1 1
      gui/wxpython/animation/controller.py
  10. 1 1
      gui/wxpython/animation/dialogs.py
  11. 3 2
      gui/wxpython/core/settings.py
  12. 1 1
      gui/wxpython/core/workspace.py
  13. 1 0
      gui/wxpython/datacatalog/infomanager.py
  14. 1 1
      gui/wxpython/datacatalog/toolbars.py
  15. 21 19
      gui/wxpython/datacatalog/tree.py
  16. 1 1
      gui/wxpython/dbmgr/base.py
  17. 1 1
      gui/wxpython/dbmgr/sqlbuilder.py
  18. 1 0
      gui/wxpython/dbmgr/vinfo.py
  19. 5 5
      gui/wxpython/gcp/manager.py
  20. 2 2
      gui/wxpython/gmodeler/frame.py
  21. 9 9
      gui/wxpython/gmodeler/model.py
  22. 4 4
      gui/wxpython/gui_core/ghelp.py
  23. 1 1
      gui/wxpython/gui_core/goutput.py
  24. 3 3
      gui/wxpython/gui_core/gselect.py
  25. 1 0
      gui/wxpython/gui_core/infobar.py
  26. 3 3
      gui/wxpython/gui_core/pyedit.py
  27. 38 0
      gui/wxpython/gui_core/wrap.py
  28. 7 7
      gui/wxpython/image2target/g.gui.image2target.py
  29. 1 1
      gui/wxpython/image2target/ii2t_gis_set.py
  30. 8 6
      gui/wxpython/lmgr/frame.py
  31. 4 4
      gui/wxpython/lmgr/layertree.py
  32. 1 1
      gui/wxpython/lmgr/menudata.py
  33. 3 2
      gui/wxpython/location_wizard/wizard.py
  34. 4 4
      gui/wxpython/mapdisp/main.py
  35. 1 1
      gui/wxpython/modules/colorrules.py
  36. 2 2
      gui/wxpython/modules/extensions.py
  37. 1 1
      gui/wxpython/modules/import_export.py
  38. 4 4
      gui/wxpython/modules/mcalc_builder.py
  39. 3 3
      gui/wxpython/nviz/mapwindow.py
  40. 5 5
      gui/wxpython/photo2image/g.gui.photo2image.py
  41. 1 1
      gui/wxpython/photo2image/ip2i_manager.py
  42. 3 3
      gui/wxpython/psmap/dialogs.py
  43. 5 5
      gui/wxpython/psmap/utils.py
  44. 8 6
      gui/wxpython/startup/locdownload.py
  45. 1 1
      gui/wxpython/tplot/frame.py
  46. 1 1
      gui/wxpython/vdigit/dialogs.py
  47. 2 2
      gui/wxpython/vdigit/toolbars.py
  48. 5 5
      gui/wxpython/vnet/vnet_data.py
  49. 87 87
      imagery/i.atcorr/create_iwave.py
  50. 5 7
      lib/gis/testsuite/gis_lib_env_test.py
  51. 1 1
      lib/gis/testsuite/test_parser_json.py
  52. 0 1
      lib/init/.flake8
  53. 9 6
      lib/init/grass.py
  54. 4 4
      lib/python/ctypes/ctypesgencore/parser/parsetab.py
  55. 1 1
      lib/python/gunittest/loader.py
  56. 3 3
      lib/python/gunittest/multireport.py
  57. 2 2
      lib/python/gunittest/multirunner.py
  58. 2 2
      lib/python/gunittest/testsuite/data/samplecode/submodule_errors/subsubmodule_exiting/testsuite/test_segfaut.py
  59. 3 3
      lib/python/pygrass/gis/region.py
  60. 2 2
      lib/python/pygrass/raster/abstract.py
  61. 1 1
      lib/python/pygrass/raster/history.py
  62. 2 2
      lib/python/pygrass/raster/testsuite/test_history.py
  63. 1 1
      lib/python/pygrass/raster/testsuite/test_pygrass_raster.py
  64. 18 18
      lib/python/pygrass/raster/testsuite/test_raster_region.py
  65. 1 1
      lib/python/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py
  66. 3 3
      lib/python/pygrass/vector/testsuite/test_vector.py
  67. 1 1
      lib/python/script/array.py
  68. 1 1
      lib/python/script/db.py
  69. 3 3
      lib/python/script/setup.py
  70. 6 6
      lib/python/script/testsuite/test_utils.py
  71. 2 2
      lib/python/temporal/core.py
  72. 1 1
      lib/python/temporal/list_stds.py
  73. 14 14
      lib/python/temporal/testsuite/unittests_temporal_algebra_grs.py
  74. 2 2
      lib/python/temporal/testsuite/unittests_temporal_raster_algebra_grs.py
  75. 1 1
      lib/python/temporal/testsuite/unittests_temporal_vector_algebra.py
  76. 3 3
      lib/raster/testsuite/rast_parse_color_rule.py
  77. 15 17
      lib/raster3d/testsuite/raster3d_lib_test.py
  78. 0 1
      man/build_class.py
  79. 1 1
      man/build_class_graphical.py
  80. 11 12
      man/build_full_index.py
  81. 4 4
      man/build_full_index_rest.py
  82. 56 56
      man/build_html.py
  83. 26 26
      man/build_rest.py
  84. 2 2
      man/build_topics.py
  85. 2 1
      man/parser_standard_options.py
  86. 8 7
      man/sphinx/conf.py
  87. 6 6
      raster/r.basins.fill/testsuite/testrbf.py
  88. 1 2
      raster/r.contour/testsuite/testrc.py
  89. 4 4
      raster/r.geomorphon/testsuite/test_r_geom.py
  90. 10 12
      raster/r.gwflow/testsuite/validation_7x7_grid.py
  91. 7 9
      raster/r.gwflow/testsuite/validation_excavation.py
  92. 13 13
      raster/r.in.ascii/testsuite/test_r_in_ascii.py
  93. 20 22
      raster/r.in.gdal/testsuite/test_r_in_gdal.py
  94. 1 1
      raster/r.in.poly/testsuite/test_rinpoly.py
  95. 6 6
      raster/r.info/testsuite/test_r_info.py
  96. 1 1
      raster/r.mapcalc/testsuite/test_nmedian_bug_3296.py
  97. 6 6
      raster/r.random/testsuite/testrandom.py
  98. 2 2
      raster/r.reclass/testsuite/test_r_reclass.py
  99. 1 1
      raster/r.recode/testsuite/test_rrecode_ncspm.py
  100. 0 0
      raster/r.report/testsuite/test_r_report.py

+ 1 - 1
db/db.copy/testsuite/test_dbcopy.py

@@ -18,7 +18,7 @@ class TestDbCopy(TestCase):
                       database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db')
 
     def test_fromtable(self):
-        self.runModule('db.copy', from_database=self.orig_mapset, 
+        self.runModule('db.copy', from_database=self.orig_mapset,
                        from_table=self.invect, to_table=self.outable,
                        overwrite=True)
         orig = read_command('db.select', table=self.invect,

+ 1 - 1
display/d.mon/render_cmd.py

@@ -103,7 +103,7 @@ def read_stdin(cmd):
     opt = None
 
     if (cmd[0] == 'd.text' and not 'text' in cmd[1] and
-        (not 'input' in cmd[1] or cmd[1]['input'] == '-')):
+            (not 'input' in cmd[1] or cmd[1]['input'] == '-')):
         if sys.stdin.isatty():
             sys.stderr.write("\nPlease enter text instructions.  Enter EOF (ctrl-d) on last line to quit\n")
         opt = 'input'

+ 1 - 0
doc/gui/wxpython/example/dialogs.py

@@ -32,6 +32,7 @@ class ExampleMapDialog(SimpleDialog):
 
     Dialog can be easily changed to enable to choose vector, imagery groups or other elements.
     """
+
     def __init__(self, parent, title=_("Choose raster map")):
         """!Calls super class constructor.
 

+ 2 - 0
doc/gui/wxpython/example/frame.py

@@ -60,6 +60,7 @@ class ExampleMapFrame(SingleMapFrame):
 
     @see IClassMapFrame in iclass.frame
     """
+
     def __init__(self, parent, giface, title=_("Example Tool"),
                  toolbars=["MiscToolbar", "MapToolbar", "MainToolbar"],
                  size=(800, 600), name='exampleWindow', **kwargs):
@@ -310,6 +311,7 @@ class ExampleInfoTextManager:
 
     Wrraper for wx.TextCtrl.
     """
+
     def __init__(self, parent):
         """!Creates wx.TextCtrl for displaying information.
         """

+ 3 - 0
doc/gui/wxpython/example/toolbars.py

@@ -25,6 +25,7 @@ from icons.icon import MetaIcon
 class ExampleMapToolbar(BaseToolbar):
     """!Map toolbar (to control map zoom and rendering)
     """
+
     def __init__(self, parent, toolSwitcher):
         """!Map toolbar constructor
         """
@@ -74,6 +75,7 @@ class ExampleMapToolbar(BaseToolbar):
 class ExampleMainToolbar(BaseToolbar):
     """!Toolbar with tools related to application functionality
     """
+
     def __init__(self, parent):
         """!Toolbar constructor
         """
@@ -94,6 +96,7 @@ class ExampleMainToolbar(BaseToolbar):
 class ExampleMiscToolbar(BaseToolbar):
     """!Toolbar with miscellaneous tools related to app
     """
+
     def __init__(self, parent):
         """!Toolbar constructor
         """

+ 17 - 16
doc/python/m.distance.py

@@ -44,17 +44,18 @@
 # % suppress_required: yes
 # %end
 
-import os, sys
+import os
+import sys
 
 import grass.script as gs
 
 from grass.lib.gis import *
 
-def main(): 
+def main():
     G_gisinit('m.distance')
 
     # calc distance
-    
+
     proj_type = G_begin_distance_calculations()
     # returns 0 if projection has no metrix (ie. imagery)
     # returns 1 if projection is planimetric
@@ -82,10 +83,10 @@ def main():
                 p.append(c)
                 coords.append(p)
                 p = None
-    
+
     if len(coords) < 2:
-       gs.fatal("A minimum of two input coordinate pairs are needed")
-    
+        gs.fatal("A minimum of two input coordinate pairs are needed")
+
     # init variables
     overall_distance = 0.0
     coord_array = c_double * len(coords)
@@ -103,7 +104,7 @@ def main():
         # plain coordinates
         x[0] = float(coords[0][0])
         y[0] = float(coords[0][1])
-    
+
     for i in range(1, len(coords)):
         if proj_type == 2:
             easting = c_double()
@@ -115,20 +116,20 @@ def main():
         else:
             x[i] = float(coords[i][0])
             y[i] = float(coords[i][1])
-        
+
         segment_distance = G_distance(x[i-1], y[i-1], x[i], y[i])
         overall_distance += segment_distance
-        
+
         print("segment %d distance is %.2f meters" % (i, segment_distance))
-        
+
         # add to the area array
-    
+
     print("\ntotal distance is %.2f meters\n" % overall_distance)
-    
+
     # calc area
     if len(coords) < 3:
-       return 0
-    
+        return 0
+
     G_begin_polygon_area_calculations()
     # returns 0 if the projection is not measurable (ie. imagery or xy)
     # returns 1 if the projection is planimetric (ie. UTM or SP)
@@ -137,12 +138,12 @@ def main():
     # do not need to close polygon (but it doesn't hurt if you do)
     area = G_area_of_polygon(x, y, len(coords))
     print("area is %.2f square meters\n" % area)
-    
+
     # we don't need this, but just to have a look
     if proj_type == 1:
         G_database_units_to_meters_factor()
         gs.message("Location units are %s" % G_database_unit_name(True).lower())
-    
+
     return 0
 
 if __name__ == "__main__":

+ 2 - 2
doc/python/raster_example_ctypes.py

@@ -27,9 +27,9 @@ if not os.environ.has_key("GISBASE"):
 
 # parse command line arguments, prompt user for a raster map name if one wasn't given
 if len(sys.argv) == 2:
-  input = sys.argv[1]
+    input = sys.argv[1]
 else:
-  input = raw_input("Name of raster map? ")
+    input = raw_input("Name of raster map? ")
 
 # initialize GRASS library
 G_gisinit('')

+ 4 - 3
doc/python/vector_example_ctypes.py

@@ -5,7 +5,8 @@ Sample Python script to access vector data using GRASS Ctypes
 interface
 """
 
-import os, sys
+import os
+import sys
 
 from grass.lib.gis    import *
 from grass.lib.vector import *
@@ -14,9 +15,9 @@ if not os.environ.has_key("GISBASE"):
     sys.exit("You must be in GRASS GIS to run this program.")
 
 if len(sys.argv) == 2:
-  input = sys.argv[1]
+    input = sys.argv[1]
 else:
-  input = raw_input("Name of vector map? ")
+    input = raw_input("Name of vector map? ")
 
 # initialize GRASS library
 G_gisinit('')

+ 1 - 1
gui/wxpython/animation/controller.py

@@ -654,7 +654,7 @@ class AnimationController(wx.EvtHandler):
                            inputOptions=exportInfo['options'],
                            bg_task=True,
                            ondone=export_avi_callback,
-                )
+                           )
         except Exception as e:
             del self.busy
             GError(parent=self.frame, message=str(e))

+ 1 - 1
gui/wxpython/animation/dialogs.py

@@ -579,7 +579,7 @@ class InputDialog(wx.Dialog):
 
         self.endRegRadio = RadioButton(
             panel, label=_("End region:"), style=wx.RB_GROUP)
-        gridSizer.Add(self.endRegRadio, pos=(2, 0),  border=10, flag=wx.EXPAND | wx.LEFT)
+        gridSizer.Add(self.endRegRadio, pos=(2, 0), border=10, flag=wx.EXPAND | wx.LEFT)
         self.endRegion = Select(parent=panel, type='region', size=(200, -1))
         gridSizer.Add(
             self.endRegion, pos=(2, 1),

+ 3 - 2
gui/wxpython/core/settings.py

@@ -39,6 +39,7 @@ class SettingsJSONEncoder(json.JSONEncoder):
     to hexadecimal color (tuple is represented as
     list in JSON, however GRASS expects tuple for colors).
     """
+
     def default(self, obj):
         """Encode not automatically serializable objects.
         """
@@ -137,7 +138,7 @@ class Settings:
                 # use default window layout (layer manager, displays, ...)
                 'defWindowPos': {
                     'enabled': True,
-                    'dim' : '1,1,%d,%d,%d,1,%d,%d' % \
+                    'dim': '1,1,%d,%d,%d,1,%d,%d' % \
                     (globalvar.GM_WINDOW_SIZE[0],
                      globalvar.GM_WINDOW_SIZE[1],
                      globalvar.GM_WINDOW_SIZE[0] + 1,
@@ -156,7 +157,7 @@ class Settings:
                 # region
                 'region': {
                     'resAlign': {
-                        'enabled' : False
+                        'enabled': False
                     },
                 },
             },

+ 1 - 1
gui/wxpython/core/workspace.py

@@ -109,7 +109,7 @@ class ProcessWorkspaceFile:
         """Process workspace file"""
 
         self.__processSession()
-        
+
         #
         # layer manager
         #

+ 1 - 0
gui/wxpython/datacatalog/infomanager.py

@@ -24,6 +24,7 @@ from grass.script import gisenv
 
 class DataCatalogInfoManager:
     """Manager for all things related to info bar in Data Catalog"""
+
     def __init__(self, infobar, giface):
         self.infoBar = infobar
         self._giface = giface

+ 1 - 1
gui/wxpython/datacatalog/toolbars.py

@@ -74,7 +74,7 @@ class DataCatalogToolbar(BaseToolbar):
         self.filter.SetSize((150, self.filter.GetBestSize()[1]))
         self.filter.Bind(wx.EVT_TEXT,
                          lambda event: self.parent.Filter(
-                         self.filter.GetValue(), self.filter_element))
+                             self.filter.GetValue(), self.filter_element))
         self.filter.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN,
                          lambda evt: self.parent.Filter(''))
         self.AddControl(self.filter)

+ 21 - 19
gui/wxpython/datacatalog/tree.py

@@ -147,6 +147,7 @@ class MapWatch(PatternMatchingEventHandler):
     everything. When file/directory change is detected, wx event is dispatched
     to event handler (can't use Signals because this is different thread),
     containing info about the change."""
+
     def __init__(self, patterns, element, event_handler):
         PatternMatchingEventHandler.__init__(self, patterns=patterns)
         self.element = element
@@ -274,6 +275,7 @@ class DataCatalogTree(TreeView):
     takes care of the refresh. At the same time, watchdog (if installed)
     monitors changes in current mapset and refreshes the tree.
     """
+
     def __init__(
             self, parent, model=None, giface=None,
             style=wx.TR_HIDE_ROOT | wx.TR_EDIT_LABELS |
@@ -423,8 +425,8 @@ class DataCatalogTree(TreeView):
                                        mapset)
 
             mapset_node = self._model.AppendNode(
-                                parent=location_node,
-                                data=dict(type='mapset',
+                parent=location_node,
+                data=dict(type='mapset',
                                           name=mapset,
                                           current=False,
                                           lock=is_mapset_locked(mapset_path),
@@ -493,8 +495,8 @@ class DataCatalogTree(TreeView):
                                                    location_nodes[i].data['name'],
                                                    key)
                         mapset_node = self._model.AppendNode(
-                                parent=location_nodes[i],
-                                data=dict(type='mapset',
+                            parent=location_nodes[i],
+                            data=dict(type='mapset',
                                           name=key,
                                           lock=is_mapset_locked(mapset_path),
                                           current=False,
@@ -983,10 +985,10 @@ class DataCatalogTree(TreeView):
         Rename selected mapset
         """
         newmapset = rename_mapset_interactively(
-                self,
-                self.selected_grassdb[0].data['name'],
-                self.selected_location[0].data['name'],
-                self.selected_mapset[0].data['name'])
+            self,
+            self.selected_grassdb[0].data['name'],
+            self.selected_location[0].data['name'],
+            self.selected_mapset[0].data['name'])
         if newmapset:
             self._giface.grassdbChanged.emit(grassdb=self.selected_grassdb[0].data['name'],
                                              location=self.selected_location[0].data['name'],
@@ -1000,9 +1002,9 @@ class DataCatalogTree(TreeView):
         Rename selected location
         """
         newlocation = rename_location_interactively(
-                self,
-                self.selected_grassdb[0].data['name'],
-                self.selected_location[0].data['name'])
+            self,
+            self.selected_grassdb[0].data['name'],
+            self.selected_location[0].data['name'])
         if newlocation:
             self._giface.grassdbChanged.emit(grassdb=self.selected_grassdb[0].data['name'],
                                              location=self.selected_location[0].data['name'],
@@ -1054,9 +1056,9 @@ class DataCatalogTree(TreeView):
 
         elif node.data['type'] == 'mapset':
             message = get_mapset_name_invalid_reason(
-                            self.selected_grassdb[0].data['name'],
-                            self.selected_location[0].data['name'],
-                            new_name)
+                self.selected_grassdb[0].data['name'],
+                self.selected_location[0].data['name'],
+                new_name)
             if message:
                 GError(parent=self, message=message,
                        caption=_("Cannot rename mapset"),
@@ -1075,8 +1077,8 @@ class DataCatalogTree(TreeView):
 
         elif node.data['type'] == 'location':
             message = get_location_name_invalid_reason(
-                            self.selected_grassdb[0].data['name'],
-                            new_name)
+                self.selected_grassdb[0].data['name'],
+                new_name)
             if message:
                 GError(parent=self, message=message,
                        caption=_("Cannot rename location"),
@@ -1326,8 +1328,8 @@ class DataCatalogTree(TreeView):
                     self.selected_location[i].data['name'],
                     self.selected_mapset[i].data['name'])
                 removed, cmd = self._runCommand(
-                        'g.remove', flags='f', type=self.selected_layer[i].data['type'],
-                        name=self.selected_layer[i].data['name'], env=env)
+                    'g.remove', flags='f', type=self.selected_layer[i].data['type'],
+                    name=self.selected_layer[i].data['name'], env=env)
                 gscript.try_remove(gisrc)
                 if removed == 0:
                     self._giface.grassdbChanged.emit(grassdb=self.selected_grassdb[i].data['name'],
@@ -1462,7 +1464,7 @@ class DataCatalogTree(TreeView):
         """Just copy necessary data"""
         self.DefineItems(self.GetSelected())
         if None not in self.selected_layer and not (self._restricted and gisenv()[
-                                        'LOCATION_NAME'] != self.selected_location[0].data['name']):
+            'LOCATION_NAME'] != self.selected_location[0].data['name']):
             event.Allow()
             self.OnCopyMap(event)
             Debug.msg(1, "DRAG")

+ 1 - 1
gui/wxpython/dbmgr/base.py

@@ -259,7 +259,7 @@ class VirtualAttributeList(ListCtrl,
                 self.InsertColumnInfo(i, info)
             i += 1
             if i >= 256:
-                    self.log.write(_("Can display only 256 columns."))
+                self.log.write(_("Can display only 256 columns."))
 
         i = 0
         outFile.seek(0)

+ 1 - 1
gui/wxpython/dbmgr/sqlbuilder.py

@@ -853,7 +853,7 @@ class SQLBuilderWhere(SQLBuilder):
                  layer=1):
 
         title = _("GRASS SQL Builder (%(type)s) - <%(map)s>") % \
-                {'type': "WHERE", 'map': vectmap}
+            {'type': "WHERE", 'map': vectmap}
 
         super(SQLBuilderWhere, self).__init__(
             parent, title, vectmap, id=wx.ID_ANY,

+ 1 - 0
gui/wxpython/dbmgr/vinfo.py

@@ -28,6 +28,7 @@ import grass.script as grass
 
 if sys.version_info.major >= 3:
     unicode = str
+
     def GetUnicodeValue(value):
         """Get unicode value
 

+ 5 - 5
gui/wxpython/gcp/manager.py

@@ -971,7 +971,7 @@ class DispMapPage(TitledPage):
         for layer in self.parent._giface.GetLayerList():
             if layer.type in ltype:
                 layers[str(layer)] = {
-                    'type' : layer.type,
+                    'type': layer.type,
                     'cmd': layer.cmd
                 }
         if name:
@@ -2831,10 +2831,10 @@ class GrSettingsDialog(wx.Dialog):
             parent=panel, id=wx.ID_ANY,
             label=_("Highlight RMS error > M + SD * factor:"))
         rmslabel.SetToolTip(
-                _(
-                    "Highlight GCPs with an RMS error larger than \n"
-                    "mean + standard deviation * given factor. \n"
-                    "Recommended values for this factor are between 1 and 2."))
+            _(
+                "Highlight GCPs with an RMS error larger than \n"
+                "mean + standard deviation * given factor. \n"
+                "Recommended values for this factor are between 1 and 2."))
         rmsgridSizer.Add(
             rmslabel,
             flag=wx.ALIGN_CENTER_VERTICAL,

+ 2 - 2
gui/wxpython/gmodeler/frame.py

@@ -326,7 +326,7 @@ class ModelFrame(wx.Frame):
             if event.pid == self._gconsole.cmdThread.GetId() - 1 and self.start_time:
                 self.goutput.WriteCmdLog('({}) {} ({})'.format(
                     str(time.ctime()), _("Model computation finished"), time_elapsed(self.start_time)),
-                                         notification=event.notification)
+                    notification=event.notification)
                 event = wxModelDone()
                 wx.PostEvent(self, event)
 
@@ -649,7 +649,7 @@ class ModelFrame(wx.Frame):
                 continue
 
             # remove existing map layers first
-            layers =  self._giface.GetLayerList().GetLayersByName(data.GetValue())
+            layers = self._giface.GetLayerList().GetLayersByName(data.GetValue())
             if layers:
                 for layer in layers:
                     self._giface.GetLayerList().DeleteLayer(layer)

+ 9 - 9
gui/wxpython/gmodeler/model.py

@@ -2548,11 +2548,11 @@ class WritePythonFile:
 #
 #{header_end}
 """.format(header_begin='#' * 77,
-           module_name=properties['name'],
-           author=properties['author'],
-           purpose='\n# '.join(properties['description'].splitlines()),
-           date=time.asctime(),
-           header_end='#' * 77))
+                module_name=properties['name'],
+                author=properties['author'],
+                purpose='\n# '.join(properties['description'].splitlines()),
+                date=time.asctime(),
+                header_end='#' * 77))
 
         # UI
         self.fd.write(
@@ -2570,7 +2570,7 @@ class WritePythonFile:
                 else:
                     desc = flag['description']
                 self.fd.write(
-                r"""# %option
+                    r"""# %option
 # % key: {flag_name}
 # % description: {description}
 # % required: yes
@@ -2578,7 +2578,7 @@ class WritePythonFile:
 # % options: True, False
 # % guisection: Flags
 """.format(flag_name=self._getParamName(flag['name'], item),
-           description=desc))
+                        description=desc))
                 if flag['value']:
                     self.fd.write("# % answer: {}\n".format(flag['value']))
                 else:
@@ -2591,12 +2591,12 @@ class WritePythonFile:
                 else:
                     desc = param['description']
                 self.fd.write(
-                r"""# %option
+                    r"""# %option
 # % key: {param_name}
 # % description: {description}
 # % required: yes
 """.format(param_name=self._getParamName(param['name'], item),
-           description=desc))
+                        description=desc))
                 if param['type'] != 'float':
                     self.fd.write('# % type: {}\n'.format(param['type']))
                 else:

+ 4 - 4
gui/wxpython/gui_core/ghelp.py

@@ -262,7 +262,7 @@ class AboutWindow(wx.Frame):
         copyrightwin = ScrolledPanel(self.aboutNotebook)
         copyrighttxt = TextCtrl(
             copyrightwin, id=wx.ID_ANY, value=copytext,
-        style=wx.TE_MULTILINE | wx.TE_READONLY)
+            style=wx.TE_MULTILINE | wx.TE_READONLY)
         copyrightwin.SetAutoLayout(True)
         copyrightwin.sizer = wx.BoxSizer(wx.VERTICAL)
         copyrightwin.sizer.Add(copyrighttxt, proportion=1,
@@ -286,7 +286,7 @@ class AboutWindow(wx.Frame):
         licensewin = ScrolledPanel(self.aboutNotebook)
         licensetxt = TextCtrl(
             licensewin, id=wx.ID_ANY, value=license,
-        style=wx.TE_MULTILINE | wx.TE_READONLY)
+            style=wx.TE_MULTILINE | wx.TE_READONLY)
         licensewin.SetAutoLayout(True)
         licensewin.sizer = wx.BoxSizer(wx.VERTICAL)
         licensewin.sizer.Add(licensetxt, proportion=1,
@@ -312,7 +312,7 @@ class AboutWindow(wx.Frame):
         window = ScrolledPanel(self.aboutNotebook)
         stat_text = TextCtrl(
             window, id=wx.ID_ANY, value=text,
-        style=wx.TE_MULTILINE | wx.TE_READONLY)
+            style=wx.TE_MULTILINE | wx.TE_READONLY)
         window.SetAutoLayout(True)
         window.sizer = wx.BoxSizer(wx.VERTICAL)
         window.sizer.Add(stat_text, proportion=1,
@@ -335,7 +335,7 @@ class AboutWindow(wx.Frame):
         authorwin = ScrolledPanel(self.aboutNotebook)
         authortxt = TextCtrl(
             authorwin, id=wx.ID_ANY, value=authors,
-        style=wx.TE_MULTILINE | wx.TE_READONLY)
+            style=wx.TE_MULTILINE | wx.TE_READONLY)
         authorwin.SetAutoLayout(True)
         authorwin.SetupScrolling()
         authorwin.sizer = wx.BoxSizer(wx.VERTICAL)

+ 1 - 1
gui/wxpython/gui_core/goutput.py

@@ -622,7 +622,7 @@ class GStc(stc.StyledTextCtrl):
 
         # warning
         self.StyleWarning = 4
-        warningColour =  wx.Colour(0, 0, 255)
+        warningColour = wx.Colour(0, 0, 255)
         if isDarkMode:
             warningColour = wx.Colour(0, 102, 255)
         self.StyleSetBackground(self.StyleWarning, defaultBackgroundColour)

+ 3 - 3
gui/wxpython/gui_core/gselect.py

@@ -1858,14 +1858,14 @@ class GdalSelect(wx.Panel):
         self._sourceType = sourceType
         self.changingSizer.Show(
             self.filePanel, show=(
-            sourceType == 'file'))
+                sourceType == 'file'))
         self.changingSizer.Show(
             self.nativePanel, show=(
-            sourceType == 'native'))
+                sourceType == 'native'))
         self.changingSizer.Show(self.dirPanel, show=(sourceType == 'dir'))
         self.changingSizer.Show(
             self.protocolPanel, show=(
-            sourceType == 'pro'))
+                sourceType == 'pro'))
         self.changingSizer.Show(self.dbPanel, show=(sourceType == 'db'))
 
         self.changingSizer.Layout()

+ 1 - 0
gui/wxpython/gui_core/infobar.py

@@ -49,6 +49,7 @@ IB.GetCloseButtonBitmap = GetCloseButtonBitmap
 
 class InfoBar(IB.InfoBar):
     """A customized and specialized info bar to used by default"""
+
     def __init__(self, parent):
         IB.InfoBar.__init__(self, parent)
 

+ 3 - 3
gui/wxpython/gui_core/pyedit.py

@@ -416,8 +416,8 @@ class PyEditController(object):
         """Save current content to a file and set executable permissions"""
         assert self.filename
         file_is_written = self._writeFile(
-                 file_path=self.filename, content=self.body.GetText(),
-             )
+            file_path=self.filename, content=self.body.GetText(),
+            )
         if file_is_written:
             # executable file
             os.chmod(self.filename, stat.S_IRWXU | stat.S_IWUSR)
@@ -575,7 +575,7 @@ class PyEditController(object):
             parent=self.guiparent,
             caption=_("Set parameters for the script"),
             message=_("Specify command line parameters for the script separated by spaces:"),
-            )
+        )
         if self.parameters:
             dlg.SetValue(" ".join(self.parameters))
         # TODO: modality might not be needed here if we bind the events

+ 38 - 0
gui/wxpython/gui_core/wrap.py

@@ -108,6 +108,7 @@ def StockCursor(cursorId):
 class Window(wx.Window):
     """Wrapper around wx.Window to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.Window.__init__(self, *args, **kwargs)
 
@@ -127,6 +128,7 @@ class Window(wx.Window):
 class Panel(wx.Panel):
     """Wrapper around wx.Panel to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.Panel.__init__(self, *args, **kwargs)
 
@@ -184,6 +186,7 @@ class FloatSpin(fs.FloatSpin):
 class Button(wx.Button):
     """Wrapper around wx.Button to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.Button.__init__(self, *args, **kwargs)
 
@@ -197,6 +200,7 @@ class Button(wx.Button):
 class ClearButton(Button):
     """Wrapper around a Button with stock id wx.ID_CLEAR,
     to disable default key binding on certain platforms"""
+
     def __init__(self, *args, **kwargs):
         Button.__init__(self, *args, **kwargs)
         self.SetId(wx.ID_CLEAR)
@@ -209,6 +213,7 @@ class ClearButton(Button):
 class CancelButton(Button):
     """Wrapper around a Button with stock id wx.ID_CANCEL, to disable
     default key binding on certain platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         Button.__init__(self, *args, **kwargs)
         self.SetId(wx.ID_CANCEL)
@@ -220,6 +225,7 @@ class CancelButton(Button):
 class CloseButton(Button):
     """Wrapper around a Close labeled Button with stock id wx.ID_CANCEL
     to disable default key binding on certain platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         Button.__init__(self, *args, **kwargs)
         self.SetId(wx.ID_CANCEL)
@@ -231,6 +237,7 @@ class CloseButton(Button):
 class ApplyButton(Button):
     """Wrapper around a Button with stock id wx.ID_APPLY,
     to disable default key binding on certain platforms"""
+
     def __init__(self, *args, **kwargs):
         Button.__init__(self, *args, **kwargs)
         self.SetId(wx.ID_APPLY)
@@ -243,6 +250,7 @@ class ApplyButton(Button):
 class RadioButton(wx.RadioButton):
     """Wrapper around wx.RadioButton to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.RadioButton.__init__(self, *args, **kwargs)
 
@@ -256,6 +264,7 @@ class RadioButton(wx.RadioButton):
 class BitmapButton(wx.BitmapButton):
     """Wrapper around wx.BitmapButton to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.BitmapButton.__init__(self, *args, **kwargs)
 
@@ -269,6 +278,7 @@ class BitmapButton(wx.BitmapButton):
 class GenBitmapButton(buttons.GenBitmapButton):
     """Wrapper around GenBitmapButton to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         buttons.GenBitmapButton.__init__(self, *args, **kwargs)
 
@@ -282,6 +292,7 @@ class GenBitmapButton(buttons.GenBitmapButton):
 class ToggleButton(wx.ToggleButton):
     """Wrapper around wx.ToggleButton to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.ToggleButton.__init__(self, *args, **kwargs)
 
@@ -295,6 +306,7 @@ class ToggleButton(wx.ToggleButton):
 class StaticText(wx.StaticText):
     """Wrapper around wx.StaticText to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.StaticText.__init__(self, *args, **kwargs)
 
@@ -308,6 +320,7 @@ class StaticText(wx.StaticText):
 class StaticBox(wx.StaticBox):
     """Wrapper around wx.StaticBox to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.StaticBox.__init__(self, *args, **kwargs)
 
@@ -321,6 +334,7 @@ class StaticBox(wx.StaticBox):
 class CheckListBox(wx.CheckListBox):
     """Wrapper around wx.CheckListBox to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.CheckListBox.__init__(self, *args, **kwargs)
 
@@ -334,6 +348,7 @@ class CheckListBox(wx.CheckListBox):
 class TextCtrl(wx.TextCtrl):
     """Wrapper around wx.TextCtrl to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.TextCtrl.__init__(self, *args, **kwargs)
 
@@ -347,6 +362,7 @@ class TextCtrl(wx.TextCtrl):
 class SearchCtrl(wx.SearchCtrl):
     """Wrapper around wx.SearchCtrl to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.SearchCtrl.__init__(self, *args, **kwargs)
 
@@ -360,6 +376,7 @@ class SearchCtrl(wx.SearchCtrl):
 class ListCtrl(wx.ListCtrl):
     """Wrapper around wx.ListCtrl to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.ListCtrl.__init__(self, *args, **kwargs)
 
@@ -394,13 +411,16 @@ if CheckWxVersion([4, 1, 0]):
     class CheckListCtrlMixin():
         """This class pretends to be deprecated CheckListCtrlMixin mixin and
         only enables checkboxes in new versions of ListCtrl"""
+
         def __init__(self):
             self.EnableCheckBoxes(True)
             self.AssignImageList(wx.ImageList(16, 16), wx.IMAGE_LIST_SMALL)
 else:
     import wx.lib.mixins.listctrl as listmix
+
     class CheckListCtrlMixin(listmix.CheckListCtrlMixin):
         """Wrapper for deprecated mixin"""
+
         def __init__(self):
             listmix.CheckListCtrlMixin.__init__(self)
 
@@ -408,6 +428,7 @@ else:
 class TreeCtrl(wx.TreeCtrl):
     """Wrapper around wx.TreeCtrl to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.TreeCtrl.__init__(self, *args, **kwargs)
 
@@ -427,6 +448,7 @@ class TreeCtrl(wx.TreeCtrl):
 class CustomTreeCtrl(CT.CustomTreeCtrl):
     """Wrapper around wx.lib.agw.customtreectrl to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         CT.CustomTreeCtrl.__init__(self, *args, **kwargs)
 
@@ -440,6 +462,7 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
 class ToolBar(wx.ToolBar):
     """Wrapper around wx.ToolBar to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.ToolBar.__init__(self, *args, **kwargs)
 
@@ -467,6 +490,7 @@ class ToolBar(wx.ToolBar):
 class Menu(wx.Menu):
     """Wrapper around wx.Menu to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.Menu.__init__(self, *args, **kwargs)
 
@@ -486,6 +510,7 @@ class Menu(wx.Menu):
 class DragImage(wx.GenericDragImage if wxPythonPhoenix else wx.DragImage):
     """Wrapper around wx.DragImage to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         super(DragImage, self).__init__(*args, **kwargs)
 
@@ -493,6 +518,7 @@ class DragImage(wx.GenericDragImage if wxPythonPhoenix else wx.DragImage):
 class PseudoDC(wx.adv.PseudoDC if wxPythonPhoenix else wx.PseudoDC):
     """Wrapper around wx.PseudoDC to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         super(PseudoDC, self).__init__(*args, **kwargs)
 
@@ -520,6 +546,7 @@ class PseudoDC(wx.adv.PseudoDC if wxPythonPhoenix else wx.PseudoDC):
 class ClientDC(wx.ClientDC):
     """Wrapper around wx.ClientDC to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         super(ClientDC, self).__init__(*args, **kwargs)
 
@@ -533,6 +560,7 @@ class ClientDC(wx.ClientDC):
 class Rect(wx.Rect):
     """Wrapper around wx.Rect to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.Rect.__init__(self, *args, **kwargs)
 
@@ -558,6 +586,7 @@ class Rect(wx.Rect):
 class CheckBox(wx.CheckBox):
     """Wrapper around wx.CheckBox to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.CheckBox.__init__(self, *args, **kwargs)
 
@@ -571,6 +600,7 @@ class CheckBox(wx.CheckBox):
 class Choice(wx.Choice):
     """Wrapper around wx.Choice to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.Choice.__init__(self, *args, **kwargs)
 
@@ -584,6 +614,7 @@ class Choice(wx.Choice):
 class TextEntryDialog(wx.TextEntryDialog):
     """Wrapper around wx.TextEntryDialog to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, parent, message, caption="Please enter text", value="",
                  style=wx.OK | wx.CANCEL | wx.CENTRE, pos=wx.DefaultPosition):
         if wxPythonPhoenix:
@@ -597,6 +628,7 @@ class TextEntryDialog(wx.TextEntryDialog):
 class ColourSelect(csel.ColourSelect):
     """Wrapper around wx.lib.colourselect.ColourSelect to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         csel.ColourSelect.__init__(self, *args, **kwargs)
 
@@ -621,6 +653,7 @@ class ComboCtrl(wxComboCtrl):
 class Dialog(wx.Dialog):
     """Wrapper around wx.Dialog to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.Dialog.__init__(self, *args, **kwargs)
 
@@ -628,6 +661,7 @@ class Dialog(wx.Dialog):
 class Notebook(wx.Notebook):
     """Wrapper around NoteBook to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         wx.Notebook.__init__(self, *args, **kwargs)
 
@@ -651,6 +685,7 @@ class OwnerDrawnComboBox(OwnerDrawnComboBox_):
 class BitmapComboBox(BitmapComboBox_):
     """Wrapper around BitmapComboBox to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         BitmapComboBox_.__init__(self, *args, **kwargs)
 
@@ -664,6 +699,7 @@ class BitmapComboBox(BitmapComboBox_):
 class ScrolledPanel(scrolled.ScrolledPanel):
     """Wrapper around scrolled.ScrolledPanel to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         scrolled.ScrolledPanel.__init__(self, *args, **kwargs)
 
@@ -677,6 +713,7 @@ class ScrolledPanel(scrolled.ScrolledPanel):
 class FileBrowseButton(filebrowse.FileBrowseButton):
     """Wrapper around filebrowse.FileBrowseButton to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         filebrowse.FileBrowseButton.__init__(self, *args, **kwargs)
 
@@ -684,6 +721,7 @@ class FileBrowseButton(filebrowse.FileBrowseButton):
 class DirBrowseButton(filebrowse.DirBrowseButton):
     """Wrapper around filebrowse.DirBrowseButton to have more control
     over the widget on different platforms/wxpython versions"""
+
     def __init__(self, *args, **kwargs):
         filebrowse.DirBrowseButton.__init__(self, *args, **kwargs)
 

+ 7 - 7
gui/wxpython/image2target/g.gui.image2target.py

@@ -66,7 +66,7 @@
 ##% required: no
 ##%end
 
-##%option 
+##%option
 ##% key: camera
 ##% type: string
 ##% label: The name of the camera (generated in i.ortho.camera)
@@ -75,17 +75,17 @@
 ###% section: parameters
 ##%end
 
-##%option 
+##%option
 ##% key: order
 ##% type: string
-##% label: The rectification order 
-##% description: The rectification order 
+##% label: The rectification order
+##% description: The rectification order
 ##% required: yes
 ##% answer: 1
 ###% section: parameters
 ##%end
 
-##%option 
+##%option
 ##% key: extension
 ##% type: string
 ##% label: The name of the output files extension
@@ -142,7 +142,7 @@ def main():
 #        src_grp = options['source_group']
 #    else:
 #        gscript.fatal(_("Please provide a source group name to process"))
-    
+
 #    if options['source_image']:
 #        src_ras = options['source_image']
 #    else:
@@ -171,7 +171,7 @@ def main():
 
     app = wx.App()
 
-#    wizard = GCPWizard(parent=None, giface=StandaloneGrassInterface(), 
+#    wizard = GCPWizard(parent=None, giface=StandaloneGrassInterface(),
 #            srcloc=src_loc,srcmpt=src_mpt,srcgrp=src_grp,srcras=src_ras,
 #            tgtras=tgt_ras,camera=camera, order=order, extension=extension)
 

+ 1 - 1
gui/wxpython/image2target/ii2t_gis_set.py

@@ -1131,7 +1131,7 @@ class GListBox(ListCtrl, listmix.ListCtrlAutoWidthMixin):
         self._LoadData(choices, disabled)
 
     def SetSelection(self, item, force=False):
-        if item !=  wx.NOT_FOUND and \
+        if item != wx.NOT_FOUND and \
                 (platform.system() != 'Windows' or force):
             # Windows -> FIXME
             self.SetItemState(

+ 8 - 6
gui/wxpython/lmgr/frame.py

@@ -119,8 +119,10 @@ class GMFrame(wx.Frame):
         self._giface = LayerManagerGrassInterface(self)
 
         menu_errors = []
+
         def add_menu_error(message):
             menu_errors.append(message)
+
         def show_menu_errors(messages):
             if messages:
                 self._gconsole.WriteError(
@@ -1382,7 +1384,7 @@ class GMFrame(wx.Frame):
                       location=gxwXml.location,
                       mapset=gxwXml.mapset,
                       getErrorMsg=True,
-                      )
+                                        )
         if returncode != 0:
             # TODO: use the function from grass.py
             reason = _("Most likely the database, location or mapset"
@@ -1407,7 +1409,7 @@ class GMFrame(wx.Frame):
                 parent=self,
                 message=_("Current location is <%(loc)s>.\n"
                           "Current mapset is <%(mapset)s>.") %
-                          {'loc': gxwXml.location,
+                {'loc': gxwXml.location,
                            'mapset': gxwXml.mapset})
         return True
 
@@ -2137,13 +2139,13 @@ class GMFrame(wx.Frame):
         # set default properties
         mapdisplay.SetProperties(render=UserSettings.Get(
             group='display', key='autoRendering', subkey='enabled'),
-                                 mode=UserSettings.Get(
+            mode=UserSettings.Get(
             group='display', key='statusbarMode', subkey='selection'),
-                                 alignExtent=UserSettings.Get(
+            alignExtent=UserSettings.Get(
             group='display', key='alignExtent', subkey='enabled'),
-                                 constrainRes=UserSettings.Get(
+            constrainRes=UserSettings.Get(
             group='display', key='compResolution', subkey='enabled'),
-                                 showCompExtent=UserSettings.Get(
+            showCompExtent=UserSettings.Get(
             group='display', key='showCompExtent', subkey='enabled'))
 
         self.displayIndex += 1

+ 4 - 4
gui/wxpython/lmgr/layertree.py

@@ -972,7 +972,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
 
         kwargs = {'align': self.GetLayerInfo(selected[0],
                                              key='maplayer').GetName()
-        }
+                  }
 
         if UserSettings.Get(group='general',
                             key='region', subkey=['resAlign', 'enabled']):
@@ -1427,8 +1427,8 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
                     # -> previous sibling of selected layer
                     parent = self.GetItemParent(selectedLayer)
                     layer = self.InsertItem(
-                                parentId=parent, input=self.GetPrevSibling(selectedLayer),
-                                text='', ct_type=1, wnd=ctrl)
+                        parentId=parent, input=self.GetPrevSibling(selectedLayer),
+                        text='', ct_type=1, wnd=ctrl)
             else:  # add first layer to the layer tree (first child of root)
                 layer = self.PrependItem(
                     parent=self.root, text='', ct_type=1, wnd=ctrl)
@@ -1993,7 +1993,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
                 newItem = self.PrependItem(self.root, text=text,
                                            ct_type=1, wnd=newctrl, image=image,
                                            data=data)
-            elif (self.flag &  wx.TREE_HITTEST_BELOW) or (self.flag & wx.TREE_HITTEST_NOWHERE) \
+            elif (self.flag & wx.TREE_HITTEST_BELOW) or (self.flag & wx.TREE_HITTEST_NOWHERE) \
                     or (self.flag & wx.TREE_HITTEST_TOLEFT) or (self.flag & wx.TREE_HITTEST_TORIGHT):
                 newItem = self.AppendItem(self.root, text=text,
                                           ct_type=1, wnd=newctrl, image=image,

+ 1 - 1
gui/wxpython/lmgr/menudata.py

@@ -45,7 +45,7 @@ class LayerManagerMenuData(MenuTreeModelBuilder):
                               "Default main menu will be loaded."))
             fallback = os.path.join(WXGUIDIR, 'xml', 'menudata.xml')
             MenuTreeModelBuilder.__init__(
-                self, fallback,  message_handler=message_handler)
+                self, fallback, message_handler=message_handler)
 
 
 class LayerManagerModuleTree(MenuTreeModelBuilder):

+ 3 - 2
gui/wxpython/location_wizard/wizard.py

@@ -150,6 +150,7 @@ class TitledPage(WizardPageSimple):
 
 class GridBagSizerTitledPage(TitledPage):
     """GridBagSizer declaration for TitledPage class"""
+
     def __init__(self, parent, title):
         super().__init__(parent, title)
 
@@ -344,7 +345,7 @@ class CoordinateSystemPage(TitledPage):
             parent=self, id=wx.ID_ANY, label=_(
                 "Read CRS from a georeferenced data file"))
         self.radioXy = wx.RadioButton(parent=self, id=wx.ID_ANY, label=_(
-                "Create a generic cartesian coordinate system (XY)"))
+            "Create a generic cartesian coordinate system (XY)"))
         self.radioWkt = wx.RadioButton(
             parent=self, id=wx.ID_ANY, label=_(
                 "Specify CRS using WKT string"))
@@ -352,7 +353,7 @@ class CoordinateSystemPage(TitledPage):
             parent=self, id=wx.ID_ANY, label=_(
                 "Specify CRS using PROJ.4 string"))
         self.radioSrs = wx.RadioButton(parent=self, id=wx.ID_ANY, label=_(
-                "Define custom CRS"))
+            "Define custom CRS"))
 
         # layout
         self.sizer.SetVGap(10)

+ 4 - 4
gui/wxpython/mapdisp/main.py

@@ -537,13 +537,13 @@ class MapApp(wx.App):
         # set default properties
         self.mapFrm.SetProperties(render=UserSettings.Get(
             group='display', key='autoRendering', subkey='enabled'),
-                                 mode=UserSettings.Get(
+            mode=UserSettings.Get(
             group='display', key='statusbarMode', subkey='selection'),
-                                 alignExtent=UserSettings.Get(
+            alignExtent=UserSettings.Get(
             group='display', key='alignExtent', subkey='enabled'),
-                                 constrainRes=UserSettings.Get(
+            constrainRes=UserSettings.Get(
             group='display', key='compResolution', subkey='enabled'),
-                                 showCompExtent=UserSettings.Get(
+            showCompExtent=UserSettings.Get(
             group='display', key='showCompExtent', subkey='enabled'))
 
         self.Map.saveToFile.connect(lambda cmd: self.mapFrm.DOutFile(cmd))

+ 1 - 1
gui/wxpython/modules/colorrules.py

@@ -45,7 +45,7 @@ from gui_core.forms import GUI
 from core.debug import Debug as Debug
 from gui_core.widgets import ColorTablesComboBox
 from gui_core.wrap import SpinCtrl, PseudoDC, TextCtrl, Button, CancelButton, \
-     StaticText, StaticBox, EmptyBitmap, BitmapFromImage
+    StaticText, StaticBox, EmptyBitmap, BitmapFromImage
 
 
 class RulesPanel:

+ 2 - 2
gui/wxpython/modules/extensions.py

@@ -192,7 +192,7 @@ class InstallExtensionWindow(wx.Frame):
                 else:
                     flags.append('--%s' % key)
 
-        # 'url=' + self.repo.GetValue().strip()]                    
+        # 'url=' + self.repo.GetValue().strip()]
         return ['g.extension'] + flags + ['extension={}'.format(name) ]
 
     def OnFetch(self, event):
@@ -301,7 +301,7 @@ class ExtensionTreeModelBuilder:
         for prefix in ('display', 'database',
                        'general', 'imagery',
                        'misc', 'postscript', 'paint',
-                       'raster', 'raster3D', 'sites', 'temporal', 'vector', 'wxGUI',  'other'):
+                       'raster', 'raster3D', 'sites', 'temporal', 'vector', 'wxGUI', 'other'):
             node = self.model.AppendNode(parent=self.model.root, label=prefix)
             self.mainNodes[prefix] = node
 

+ 1 - 1
gui/wxpython/modules/import_export.py

@@ -243,7 +243,7 @@ class ImportDialog(wx.Dialog):
         else:
             message = _(
                 "Output map name <%(name)s> exist. "
-                ) % {
+            ) % {
                 'name': layers_list.output_map}
         GError(parent=self, message=message, caption=_("Invalid name"))
 

+ 4 - 4
gui/wxpython/modules/mcalc_builder.py

@@ -261,7 +261,7 @@ class MapCalcFrame(wx.Frame):
         self.newmaptxt = Select(
             parent=self.panel, id=wx.ID_ANY, size=(
                 250, -1), type=element, multiple=False,
-                fullyQualified=False)
+            fullyQualified=False)
         self.mapsellabel = StaticText(parent=self.panel, id=wx.ID_ANY)
         if self.rast3d:
             self.mapsellabel.SetLabel(_('Insert existing 3D raster map'))
@@ -626,16 +626,16 @@ class MapCalcFrame(wx.Frame):
             pass
 
         newmcalcstr += what
-        
+
         # Do not add extra space if there is already one
         try:
             if newmcalcstr[-1] != ' ' and mcalcstr[position] != ' ':
                 newmcalcstr += ' '
         except:
             newmcalcstr += ' '
-        
+
         newmcalcstr += mcalcstr[position:]
-        
+
         self.text_mcalc.SetValue(newmcalcstr)
         if len(what) > 0:
             match = re.search(pattern="\(.*\)", string=what)

+ 3 - 3
gui/wxpython/nviz/mapwindow.py

@@ -506,8 +506,8 @@ class GLWindow(MapWindowBase, glcanvas.GLCanvas):
     def CreateTexture(self, overlay):
         """Create texture from overlay image"""
         texture = wxnviz.ImageTexture(
-                filepath=overlay.layer.mapfile, overlayId=overlay.id,
-                coords=list(overlay.coords), cmd=overlay.GetCmd())
+            filepath=overlay.layer.mapfile, overlayId=overlay.id,
+            coords=list(overlay.coords), cmd=overlay.GetCmd())
 
         if not texture.textureId:  # texture too big
             GMessage(
@@ -2291,7 +2291,7 @@ class GLWindow(MapWindowBase, glcanvas.GLCanvas):
 
         for item in self.layers:
             mapLayer = self.tree.GetLayerInfo(item, key='maplayer')
-            if type !=  mapLayer.GetType() or \
+            if type != mapLayer.GetType() or \
                     name != mapLayer.GetName():
                 continue
 

+ 5 - 5
gui/wxpython/photo2image/g.gui.photo2image.py

@@ -40,7 +40,7 @@
 #% required: yes
 #%end
 
-#%option 
+#%option
 #% key: camera
 #% type: string
 #% label: The name of the camera (generated in i.ortho.camera)
@@ -48,7 +48,7 @@
 #% required: yes
 #%end
 
-#%option 
+#%option
 #% key: order
 #% type: string
 #% label: The rectification order (no of Fiducial=4 -> order=1, no of Fiducial=8 -> order=2)
@@ -57,7 +57,7 @@
 #% answer: 1
 #%end
 
-#%option 
+#%option
 #% key: extension
 #% type: string
 #% label: The name of the output files extension (used in i.rectify)
@@ -96,7 +96,7 @@ def main():
         group = options['group']
     else:
         gscript.fatal(_("Please provide a group name to process"))
-    
+
     if options['raster']:
         raster = options['raster']
     else:
@@ -119,7 +119,7 @@ def main():
 
     app = wx.App()
 
-    wizard = GCPWizard(parent=None, giface=StandaloneGrassInterface(), group=group, 
+    wizard = GCPWizard(parent=None, giface=StandaloneGrassInterface(), group=group,
             raster=raster, raster1=raster, camera=camera, order=order, extension=extension)
     app.MainLoop()
 

+ 1 - 1
gui/wxpython/photo2image/ip2i_manager.py

@@ -387,7 +387,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             fc_count=0
             for line in fc:
                 fc_count+=1
-                if fc_count > storeLine :
+                if fc_count > storeLine:
                     dataFiducialX.append(line.split()[1])
                     dataFiducialY.append(line.split()[2])
 

+ 3 - 3
gui/wxpython/psmap/dialogs.py

@@ -5673,7 +5673,7 @@ class TextDialog(PsmapDialog):
                     self.mapId], x=float(
                     self.textDict['east']), y=float(
                     self.textDict['north']), paperToMap=False,
-                    env=self.env)
+                env=self.env)
         # rotation
         if self.rotCtrl.GetValue():
             self.textDict['rotate'] = self.rotValue.GetValue()
@@ -6168,7 +6168,7 @@ class ImageDialog(PsmapDialog):
                     self.mapId], x=float(
                     self.imageDict['east']), y=float(
                     self.imageDict['north']), paperToMap=False,
-                    env=self.env)
+                env=self.env)
 
         # rotation
         rot = self.imagePanel.image['rotate'].GetValue()
@@ -6613,7 +6613,7 @@ class PointDialog(PsmapDialog):
                     self.mapId], x=float(
                     self.pointDict['east']), y=float(
                     self.pointDict['north']), paperToMap=False,
-                    env=self.env)
+                env=self.env)
 
         # rotation
         self.pointDict['rotate'] = self.rotCtrl.GetValue()

+ 5 - 5
gui/wxpython/psmap/utils.py

@@ -393,11 +393,11 @@ def GetMapBounds(filename, env, portrait=True):
     try:
         bb = list(map(float,
                     grass.read_command(
-                    'ps.map',
-                    flags='b' +
-                    orient,
-                    quiet=True,
-                    input=filename, env=env).strip().split('=')[1].split(',')))
+                        'ps.map',
+                        flags='b' +
+                        orient,
+                        quiet=True,
+                        input=filename, env=env).strip().split('=')[1].split(',')))
     except (grass.ScriptError, IndexError):
         GError(message=_("Unable to run `ps.map -b`"))
         return None

+ 8 - 6
gui/wxpython/startup/locdownload.py

@@ -244,7 +244,7 @@ def reporthook(count, block_size, total_size):
           "{0}%, {1} MB, {2} KB/s, {3:.0f} seconds passed".format(
               percent, progress_size / (1024 * 1024), speed, duration,
           ),
-        ),
+          ),
     )
 
 # based on g.extension, potentially move to library
@@ -268,8 +268,8 @@ def download_and_extract(source):
         except HTTPError as err:
             raise DownloadError(
                 http_error_message.format(
-                        url=source,
-                        code=err,
+                    url=source,
+                    code=err,
                 ),
             )
         except URLError:
@@ -362,6 +362,7 @@ class LocationDownloadPanel(wx.Panel):
     of one panel (perhaps sharing the common background download and
     message logic).
     """
+
     def __init__(self, parent, database, locations=LOCATIONS):
         """
 
@@ -441,7 +442,7 @@ class LocationDownloadPanel(wx.Panel):
     def OnDownload(self, event):
         """Handle user-initiated action of download"""
         button_label = self.parent.download_button.GetLabel()
-        if button_label in (_('Download'), _('Do&wnload')) :
+        if button_label in (_('Download'), _('Do&wnload')):
             self._change_download_btn_label(
                 label=self._abort_btn_label,
                 tooltip=self._abort_btn_tooltip,
@@ -476,7 +477,7 @@ class LocationDownloadPanel(wx.Panel):
                 self._last_downloaded_location_name = dirname
                 self._warning(_("Download completed. The downloaded sample data is listed "
                                 "in the location/mapset tabs upon closing of this window")
-                )
+                              )
             self._change_download_btn_label()
 
         def terminate_download_callback(event):
@@ -557,6 +558,7 @@ class LocationDownloadDialog(wx.Dialog):
 
     Contains the panel and Cancel button.
     """
+
     def __init__(self, parent, database,
                  title=_("Location Download")):
         """
@@ -609,7 +611,7 @@ class LocationDownloadDialog(wx.Dialog):
                                    message=_("Do you want to cancel location download?"),
                                    caption=_("Abort download"),
                                    style=wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION | wx.CENTRE
-            )
+                                   )
 
             ret = dlg.ShowModal()
             dlg.Destroy()

+ 1 - 1
gui/wxpython/tplot/frame.py

@@ -645,7 +645,7 @@ class TplotFrame(wx.Frame):
             self.axes2d.set_xlabel(self.drawX)
         else:
             if self.temporalType == 'absolute':
-                self.axes2d.set_xlabel(_("Temporal resolution: %s" %  x ))
+                self.axes2d.set_xlabel(_("Temporal resolution: %s" % x ))
             else:
                 self.axes2d.set_xlabel(_("Time [%s]") % self.unit)
         if self.drawY != '':

+ 1 - 1
gui/wxpython/vdigit/dialogs.py

@@ -261,7 +261,7 @@ class VDigitCategoryDialog(wx.Dialog, listmix.ColumnSorterMixin):
         y = event.GetY()
         item, flags = self.list.HitTest((x, y))
 
-        if item !=  wx.NOT_FOUND and \
+        if item != wx.NOT_FOUND and \
                 flags & wx.LIST_HITTEST_ONITEM:
             self.list.Select(item)
 

+ 2 - 2
gui/wxpython/vdigit/toolbars.py

@@ -820,8 +820,8 @@ class VDigitToolbar(BaseToolbar):
                 # add layer to map layer tree/map display
                 mapName = dlg.GetName() + '@' + grass.gisenv()['MAPSET']
                 self._giface.GetLayerList().AddLayer(
-                        ltype='vector', name=mapName, checked=True,
-                        cmd=['d.vect', 'map=%s' % mapName])
+                    ltype='vector', name=mapName, checked=True,
+                    cmd=['d.vect', 'map=%s' % mapName])
 
                 vectLayers = self.UpdateListOfLayers(updateTool=True)
                 selection = vectLayers.index(mapName)

+ 5 - 5
gui/wxpython/vnet/vnet_data.py

@@ -177,11 +177,11 @@ class VNETData:
 
         errLayerStr = ""
         vals = {
-                'arc_layer': _("arc layer"),
-                'node_layer': _("node layer"),
-                'turn_layer': _("turntable layer"),
-                'turn_cat_layer': _("unique categories layer")
-                }
+            'arc_layer': _("arc layer"),
+            'node_layer': _("node layer"),
+            'turn_layer': _("turntable layer"),
+            'turn_cat_layer': _("unique categories layer")
+            }
         for layer, layerLabel in six.iteritems(vals):
 
             if layer in ["turn_layer", "turn_cat_layer"] and not flags["t"]:

+ 87 - 87
imagery/i.atcorr/create_iwave.py

@@ -2,7 +2,7 @@
 """
 Created on Sat Mar 27 11:35:32 2010
 
-Program to interpolate filter function to correct 
+Program to interpolate filter function to correct
 step. Should be 2.5 nm
 Then output filter function in a format similar to
 what is needed in the Iwave.cpp file
@@ -107,25 +107,25 @@ def interpolate_band(values, step = 2.5):
     start = 0
     i = 0
     while i < nvalues - 1 and responses[i] <= rthresh:
-	i += 1
+        i += 1
     start = wavelengths[i] - step
     # align to multiple of step
     nsteps = int(start / step)
     start = step * nsteps
     while start < wavelengths[0]:
-	start += step
+        start += step
 
     # find last response > rthresh
     stop = 0
     i = nvalues - 1
     while i > 0 and responses[i] <= rthresh:
-	i -= 1
+        i -= 1
     stop = wavelengths[i] + step
     # align to multiple of step
     nsteps = np.ceil(stop / step)
     stop = step * nsteps
     while stop > wavelengths[nvalues - 1]:
-	stop -= step
+        stop -= step
 
     assert start < stop, "Empty spectral responses!"
 
@@ -133,7 +133,7 @@ def interpolate_band(values, step = 2.5):
     f = interpolate.interp1d(wavelengths, responses)
 
     filter_f = f(np.arange(start, stop, step))
-   
+
     # how many spectral responses?
     expected = np.ceil((stop - start) / step)
     assert len(filter_f) == expected, "Number of interpolated spectral responses not equal to expected number of interpolations"
@@ -151,14 +151,14 @@ def plot_filter(values):
     function has to be used inside Spyder python environment
     """
     filter_f, limits = interpolate_band(values)
-    
+
     # removing nodata
     w = values[:,1] >= 0
     response = values[w]
-    
+
     plot(response[:,0],response[:,1], 'ro')
     plot(arange(limits[0], limits[1], 2.5), filter_f)
-    
+
     return
 
 def pretty_print(filter_f):
@@ -168,22 +168,22 @@ def pretty_print(filter_f):
     """
     pstring = ''
     for i in range(len(filter_f)+1):
-        if i%8 is 0:
+        if i %8 is 0:
             if i is not 0:
                 value_wo_leading_zero = ('%.4f' % (filter_f[i-1])).lstrip('0')
                 pstring += value_wo_leading_zero
-	    if i > 1 and i < len(filter_f):
+            if i > 1 and i < len(filter_f):
                 pstring += ', '
-            if i is not 1: 
+            if i is not 1:
                 # trim the trailing whitespace at the end of line
                 pstring = pstring.rstrip()
             pstring += "\n        "
         else:
             value_wo_leading_zero = ('%.4f' % (filter_f[i-1])).lstrip('0')
             pstring += value_wo_leading_zero
-	    if i < len(filter_f):
-		pstring += ', '
-    # trim starting \n and trailing , 
+            if i < len(filter_f):
+                pstring += ', '
+    # trim starting \n and trailing ,
     pstring = pstring.lstrip("\n").rstrip(", ")
     return pstring
 
@@ -193,10 +193,10 @@ def write_cpp(bands, values, sensor, folder):
     create output file in cpp style
     needs other functions: interpolate_bands, pretty_print
     """
-    
+
     # keep in sync with IWave::parse()
     rthresh = 0.01
-    print 
+    print
     print(" > Response peaks from interpolation to 2.5 nm steps:")
 
     # getting necessary data
@@ -204,21 +204,21 @@ def write_cpp(bands, values, sensor, folder):
     if len(bands) == 1:
         filter_f, limits = interpolate_band(values)
 
-	fi = filter_f
-	li = limits
-	# Get wavelength range for spectral response in band
- 	maxresponse_idx = np.argmax(fi)
- 	# Get minimum wavelength with spectral response
- 	c = maxresponse_idx
- 	while c > 0 and fi[c - 1] > rthresh:
-	    c = c - 1
- 	min_wavelength = np.ceil(li[0] * 1000 + (2.5 * c))
- 	# Get maximum wavelength with spectral response
- 	c = maxresponse_idx
- 	while c < len(fi) - 1 and fi[c + 1] > rthresh:
-	    c = c + 1
- 	max_wavelength = np.floor(li[0] * 1000 + (2.5 * c))
- 	print("   %s (%inm - %inm)" % (bands[b], min_wavelength, max_wavelength))
+        fi = filter_f
+        li = limits
+        # Get wavelength range for spectral response in band
+        maxresponse_idx = np.argmax(fi)
+        # Get minimum wavelength with spectral response
+        c = maxresponse_idx
+        while c > 0 and fi[c - 1] > rthresh:
+            c = c - 1
+        min_wavelength = np.ceil(li[0] * 1000 + (2.5 * c))
+        # Get maximum wavelength with spectral response
+        c = maxresponse_idx
+        while c < len(fi) - 1 and fi[c + 1] > rthresh:
+            c = c + 1
+        max_wavelength = np.floor(li[0] * 1000 + (2.5 * c))
+        print("   %s (%inm - %inm)" % (bands[b], min_wavelength, max_wavelength))
 
     else:
         filter_f = []
@@ -228,40 +228,40 @@ def write_cpp(bands, values, sensor, folder):
             filter_f.append(fi)
             limits.append(li)
 
-	    # Get wavelength range for spectral response in band
-	    maxresponse_idx = np.argmax(fi)
-	    # Get minimum wavelength with spectral response
-	    c = maxresponse_idx
-	    while c > 0 and fi[c - 1] > rthresh:
-		c = c - 1
-	    min_wavelength = np.ceil(li[0] * 1000 + (2.5 * c))
-	    # Get maximum wavelength with spectral response
-	    c = maxresponse_idx
-	    while c < len(fi) - 1 and fi[c + 1] > rthresh:
-		c = c + 1
-	    max_wavelength = np.floor(li[0] * 1000 + (2.5 * c))
-	    print("   %s (%inm - %inm)" % (bands[b], min_wavelength, max_wavelength))
-    
+            # Get wavelength range for spectral response in band
+            maxresponse_idx = np.argmax(fi)
+            # Get minimum wavelength with spectral response
+            c = maxresponse_idx
+            while c > 0 and fi[c - 1] > rthresh:
+                c = c - 1
+            min_wavelength = np.ceil(li[0] * 1000 + (2.5 * c))
+            # Get maximum wavelength with spectral response
+            c = maxresponse_idx
+            while c < len(fi) - 1 and fi[c + 1] > rthresh:
+                c = c + 1
+            max_wavelength = np.floor(li[0] * 1000 + (2.5 * c))
+            print("   %s (%inm - %inm)" % (bands[b], min_wavelength, max_wavelength))
+
     # writing...
     outfile = open(os.path.join(folder, sensor+"_cpp_template.txt"), 'w')
     outfile.write('/* Following filter function created using create_iwave.py */\n\n')
-    
+
     if len(bands) == 1:
         outfile.write('void IWave::%s()\n{\n\n' % (sensor.lower()))
     else:
         outfile.write('void IWave::%s(int iwa)\n{\n\n' % (sensor.lower()))
-        
+
     # single band case
     if len(bands) == 1:
         outfile.write('    /* %s of %s */\n' % (bands[0], sensor))
         outfile.write('    static const float sr[%i] = {' % (len(filter_f)))
         filter_text = pretty_print(filter_f)
         outfile.write(filter_text)
-        
+
         # calculate wl slot for band start
         # slots range from 250 to 4000 at 2.5 increments (total 1500)
         s_start = int((limits[0]*1000 - 250)/2.5)
-        
+
         outfile.write('\n')
         outfile.write('    ffu.wlinf = %.4ff;\n' % (limits[0]))
         outfile.write('    ffu.wlsup = %.4ff;\n' % (limits[1]))
@@ -270,7 +270,7 @@ def write_cpp(bands, values, sensor, folder):
         outfile.write('    for(i = 0; i < %i; i++)\tffu.s[%i+i] = sr[i];\n' % (len(filter_f), s_start))
         outfile.write('    for(i = %i; i < 1501; i++)\tffu.s[i] = 0;\n' % (s_start + len(filter_f)))
         outfile.write('}\n')
-        
+
     else: # more than 1 band
         # writing bands
         for b in range(len(bands)):
@@ -278,85 +278,85 @@ def write_cpp(bands, values, sensor, folder):
             outfile.write('    static const float sr%i[%i] = {\n' % (b+1,len(filter_f[b])))
             filter_text = pretty_print(filter_f[b])
             outfile.write(filter_text+'\n    };\n\t\n')
-        
+
         # writing band limits
         for b in range(len(bands)):
             inf = ", ".join(["%.4f" % i[0] for i in limits])
             sup = ", ".join(["%.4f" % i[1] for i in limits])
-        
+
         outfile.write('    static const float wli[%i] = {%s};\n' % (len(bands), inf))
         outfile.write('    static const float wls[%i] = {%s};\n' % (len(bands), sup))
-        
+
         outfile.write('\n')
         outfile.write('    ffu.wlinf = (float)wli[iwa-1];\n')
         outfile.write('    ffu.wlsup = (float)wls[iwa-1];\n\n')
-        
+
         outfile.write('    int i;\n')
         outfile.write('    for(i = 0; i < 1501; i++) ffu.s[i] = 0;\n\n')
-        
+
         outfile.write('    switch(iwa)\n    {\n')
-        
+
         # now start of case part...
         for b in range(len(bands)):
             s_start = int((limits[b][0]*1000 - 250)/2.5)
             outfile.write('    case %i: for(i = 0; i < %i; i++)  ffu.s[%i+i] = sr%i[i];\n' % ((b+1), len(filter_f[b]), s_start, (b+1)))
             outfile.write('        break;\n')
         outfile.write('    }\n}\n')
-        
+
     return
 
 def main():
     """ control function """
-    
+
     inputfile = sys.argv[1]
-    
+
     # getting sensor name from full csv file name
     sensor = os.path.splitext(os.path.basename(inputfile))[0]
-    
+
     print
     print(" > Getting sensor name from csv file: %s" % (sensor))
-    
+
     # getting data from file
     bands, values = read_input(inputfile)
-    
+
     # print spectral ranges from input file
-    # consider only wavelengths with a reasonably large response 
+    # consider only wavelengths with a reasonably large response
     # around the peak response, keep in sync with IWave::parse()
     rthresh = 0.01
     print
     print(" > Response peaks from input file:")
     for b in range(1, len(bands) + 1):
-	lowl = 0
-	hiwl = 0
-	maxr = 0
-	maxi = 0
-	for i in range(len(values[:,0])):
-	    if maxr < values[i,b]:
-		maxr = values[i,b]
-		maxi = i
-	
-	i = maxi
-	while i >= 0 and values[i,b] > rthresh:
-	    lowl = values[i,0]
-	    i -= 1
-
-	i = maxi
-	nvalues = len(values[:,0])
-	while i < nvalues and values[i,b] > rthresh:
-	    hiwl = values[i,0]
-	    i += 1
-	
-	print("   %s (%inm - %inm)" % (bands[b - 1], lowl, hiwl))
+        lowl = 0
+        hiwl = 0
+        maxr = 0
+        maxi = 0
+        for i in range(len(values[:,0])):
+            if maxr < values[i,b]:
+                maxr = values[i,b]
+                maxi = i
+
+        i = maxi
+        while i >= 0 and values[i,b] > rthresh:
+            lowl = values[i,0]
+            i -= 1
+
+        i = maxi
+        nvalues = len(values[:,0])
+        while i < nvalues and values[i,b] > rthresh:
+            hiwl = values[i,0]
+            i += 1
+
+        print("   %s (%inm - %inm)" % (bands[b - 1], lowl, hiwl))
 
     # writing file in same folder of input file
     write_cpp(bands, values, sensor, os.path.dirname(inputfile))
-    
+
     print
     print(" > Filter functions exported to %s" % ("sensors_csv/"+sensor+"_cpp_template.txt"))
     print(" > Please check this file for possible errors before inserting the code into file iwave.cpp")
     print(" > Don't forget to add the necessary data to the files iwave.h, geomcond.h, geomcond.cpp, and to i.atcorr.html")
     print
-    
+
     return
 
 if __name__ == '__main__':

+ 5 - 7
lib/gis/testsuite/gis_lib_env_test.py

@@ -3,14 +3,14 @@
 @author Soeren Gebbert
 """
 from grass.gunittest.case import TestCase
-import grass.lib.gis as libgis 
+import grass.lib.gis as libgis
 
 class GisLibraryTestEnv(TestCase):
 
     @classmethod
     def setUpClass(cls):
         libgis.G_gisinit("GisLibraryTestEnv")
-        
+
     def test_gisrc(self):
         # File access
         libgis.G_setenv("TEST", "A");
@@ -19,7 +19,7 @@ class GisLibraryTestEnv(TestCase):
         self.assertEqual(value, b"A")
         value = libgis.G_getenv2("TEST", libgis.G_VAR_GISRC)
         self.assertEqual(value, b"A")
-        
+
         # In memory management
         libgis.G_setenv_nogisrc("TEST", "B");
 
@@ -57,7 +57,7 @@ class GisLibraryTestEnv(TestCase):
         libgis.G_setenv2("TEST", "C", libgis.G_VAR_MAPSET);
         value = libgis.G_getenv2("TEST", libgis.G_VAR_MAPSET)
         self.assertEqual(value, b"C")
- 
+
         libgis.G_setenv_nogisrc2("TEST", "D", libgis.G_VAR_MAPSET);
         value = libgis.G_getenv_nofatal2("TEST", libgis.G_VAR_MAPSET)
         self.assertEqual(value, b"D")
@@ -65,11 +65,9 @@ class GisLibraryTestEnv(TestCase):
         libgis.G__read_mapset_env()
         value = libgis.G_getenv2("TEST", libgis.G_VAR_MAPSET)
         self.assertEqual(value, b"C")
-        
+
 
 
 if __name__ == '__main__':
     from grass.gunittest.main import test
     test()
-
-

+ 1 - 1
lib/gis/testsuite/test_parser_json.py

@@ -83,7 +83,7 @@ class TestParserJson(TestCase):
         inputs = [
          {"param": "map", "value": "hospitals@PERMANENT"},
          {"param": "layer", "value": "1"}
-       ]
+            ]
 
         stdout, stderr = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()
         print(stdout)

+ 0 - 1
lib/init/.flake8

@@ -1,6 +1,5 @@
 [flake8]
 ignore =
-    E111, # indentation is not a multiple of four
     E125, # continuation line...
     E126, # continuation line...
     E127, # continuation line...

+ 9 - 6
lib/init/grass.py

@@ -430,7 +430,7 @@ def get_grass_config_dir():
     else:
         grass_config_dirname = ".grass7"
         directory = os.path.join(os.getenv('HOME'), grass_config_dirname)
-    if not os.path.isdir(directory) :
+    if not os.path.isdir(directory):
         try:
             os.mkdir(directory)
         except OSError as e:
@@ -1132,6 +1132,7 @@ class MapsetSettings(object):
 
     Provides few convenient functions.
     """
+
     def __init__(self):
         self.gisdbase = None
         self.location = None
@@ -1604,6 +1605,7 @@ def run_batch_job(batch_job):
         # for messages only
         batch_job_string = ' '.join(batch_job)
     message(_("Executing <%s> ...") % batch_job_string)
+
     def script_path(batch_job):
         """Adjust script path
 
@@ -1633,7 +1635,7 @@ def run_batch_job(batch_job):
                             "{error}").format(
                                 cmd=batch_job_string,
                                 error=error,
-                            )
+            )
         # No such file or directory
         if error.errno == errno.ENOENT:
             if script and os.access(batch_job[0], os.X_OK):
@@ -1896,7 +1898,7 @@ PROMPT_COMMAND=grass_prompt\n""".format(
             mask3d=_("3D raster MASK present"),
             mask2d_test=mask2d_test, mask3d_test=mask3d_test,
             specific_addition=specific_addition
-            ))
+        ))
 
     if sh == 'zsh':
         f.write('precmd() { eval "$PROMPT_COMMAND" }\n')
@@ -2021,10 +2023,10 @@ def print_params(params):
             linerev = filerev.readline().rstrip('\n')
             filerev.close()
             try:
-               revision = linerev.split(' ')[1]
-               sys.stdout.write("%s\n" % revision[1:])
+                revision = linerev.split(' ')[1]
+                sys.stdout.write("%s\n" % revision[1:])
             except:
-               sys.stdout.write("No SVN revision defined\n")
+                sys.stdout.write("No SVN revision defined\n")
         elif arg == 'version':
             sys.stdout.write("%s\n" % GRASS_VERSION)
         elif arg == 'date':
@@ -2070,6 +2072,7 @@ class Parameters(object):
     """Structure to hold standard part of command line parameters"""
     # we don't need to define any methods
     # pylint: disable=R0903
+
     def __init__(self):
         self.grass_gui = None
         self.create_new = None

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 4 - 4
lib/python/ctypes/ctypesgencore/parser/parsetab.py


+ 1 - 1
lib/python/gunittest/loader.py

@@ -68,7 +68,7 @@ def discover_modules(start_dir, skip_dirs, testsuite_dir,
         if testsuite_dir in dirs:
             dirs.remove(testsuite_dir)  # do not recurse to testsuite
             full = os.path.join(root, testsuite_dir)
-            
+
             all_files = os.listdir(full)
             if file_pattern:
                 files = fnmatch.filter(all_files, file_pattern)

+ 3 - 3
lib/python/gunittest/multireport.py

@@ -84,7 +84,7 @@ def plot_percents(x, xticks, xlabels, successes, failures, filename, style):
 def plot_percent_successful(x, xticks, xlabels, successes, filename, style):
     fig = plt.figure()
     graph = fig.add_subplot(111)
-   
+
     def median(values):
         n = len(values)
         if n == 1:
@@ -94,7 +94,7 @@ def plot_percent_successful(x, xticks, xlabels, successes, filename, style):
             return (sorted_values[n / 2 - 1] + sorted_values[n / 2]) / 2
         else:
             return sorted_values[n / 2]
-    
+
     # this is useful for debugging or some other stat
     # cmeans = []
     # cmedians = []
@@ -431,7 +431,7 @@ def main():
         else:
             title = ('Test reports for &lt;{type}&gt; location type'
                      .format(type=location_type))
-        
+
         x = [date2num(result.timestamp) for result in results]
         # the following would be an alternative but it does not work with
         # labels and automatic axis limits even after removing another date fun

+ 2 - 2
lib/python/gunittest/multirunner.py

@@ -92,7 +92,7 @@ def main():
     if len(locations) != len(locations_types):
         print("ERROR: Number of locations and their tags must be the same", file=sys.stderr)
         return 1
-    
+
 
     main_report = args.main_report
     grasssrc = args.grasssrc  # TODO: can be guessed from dist
@@ -123,7 +123,7 @@ def main():
 
     ########### DATA
     # define GRASS DATABASE
-    
+
     # Set GISDBASE environment variable
     os.environ['GISDBASE'] = text_to_string(gisdb)
 

+ 2 - 2
lib/python/gunittest/testsuite/data/samplecode/submodule_errors/subsubmodule_exiting/testsuite/test_segfaut.py

@@ -14,8 +14,8 @@ class TestSegfault(TestCase):
         j = ctypes.pointer(i)
         c = 0
         while True:
-                j[c] = 'a'
-                c += 1
+            j[c] = 'a'
+            c += 1
         j
 
 

+ 3 - 3
lib/python/pygrass/gis/region.py

@@ -426,12 +426,12 @@ class Region(object):
 
     def set_raster_region(self):
         """Set the computational region (window) for all raster maps in the current process.
-           
+
            Attention: All raster objects must be closed or the
                       process will be terminated.
-                      
+
            The Raster library C function Rast_set_window() is called.
-        
+
         """
         libraster.Rast_set_window(self.byref())
 

+ 2 - 2
lib/python/pygrass/raster/abstract.py

@@ -236,10 +236,10 @@ class Info(object):
 
     def items(self):
         return [(k, self.__getattribute__(k)) for k in self.keys()]
-        
+
     def __iter__(self):
         return ((k, self.__getattribute__(k)) for k in self.keys())
-        
+
     def _repr_html_(self):
         return dict2html(dict(self.items()), keys=self.keys(),
                          border='1', kdec='b')

+ 1 - 1
lib/python/pygrass/raster/history.py

@@ -40,7 +40,7 @@ class History(object):
     def __del__(self):
         """Rast_free_history"""
         pass
-        
+
     def __eq__(self, hist):
         for attr in self.attrs:
             if getattr(self, attr) != getattr(hist, attr):

+ 2 - 2
lib/python/pygrass/raster/testsuite/test_history.py

@@ -62,7 +62,7 @@ class RasterHistoryTestCate(TestCase):
         hist1.src1 = "No such source 1"
         hist1.src2 = "No such source 2"
         hist1.write()
-        
+
         r.open("r")
         hist = r.hist
 
@@ -73,7 +73,7 @@ class RasterHistoryTestCate(TestCase):
         self.assertEqual(decode(hist.src1), "No such source 1")
         self.assertEqual(decode(hist.src2), "No such source 2")
         r.close()
-        
+
         hist1 = History("no_map")
         hist1.command()
         self.assertEqual(decode(hist1.line(0)), "test_history.py")

+ 1 - 1
lib/python/pygrass/raster/testsuite/test_pygrass_raster.py

@@ -76,7 +76,7 @@ class RasterRowTestCase(TestCase):
         r.open(mode='w', mtype='DCELL', overwrite=True)
         self.assertTrue(r.mtype, 'DCELL')
         r.close()
-    
+
     def test_row_range(self):
         r = RasterRow(self.name)
         with self.assertRaises(IndexError):

+ 18 - 18
lib/python/pygrass/raster/testsuite/test_raster_region.py

@@ -28,9 +28,9 @@ class RasterRowRegionTestCase(TestCase):
         cls.del_temp_region()
 
     def test_resampling_1(self):
-        
+
         region = Region()
-        
+
         region.ewres = 4
         region.nsres = 4
         region.north = 30
@@ -38,20 +38,20 @@ class RasterRowRegionTestCase(TestCase):
         region.east = 30
         region.west = 10
         region.adjust(rows=True, cols=True)
-        
+
         rast = RasterRow(self.name)
         rast.set_region(region)
         rast.open(mode='r')
-        
+
         six.assertCountEqual(self, rast[0].tolist(), [22, 22, 22, 22, 22, 32, 32, 32, 32, 32])
         six.assertCountEqual(self, rast[5].tolist(), [23, 23, 23, 23, 23, 33, 33, 33, 33, 33])
-        
+
         rast.close()
 
     def test_resampling_2(self):
-        
+
         region = Region()
-        
+
         region.ewres = 5
         region.nsres = 5
         region.north = 60
@@ -59,11 +59,11 @@ class RasterRowRegionTestCase(TestCase):
         region.east = 60
         region.west = -20
         region.adjust(rows=True, cols=True)
-        
+
         rast = RasterRow(self.name)
         rast.set_region(region)
         rast.open(mode='r')
-        
+
         """
         [nan, nan, nan, nan, nan, nan, nan, nan]
         [nan, nan, nan, nan, nan, nan, nan, nan]
@@ -77,37 +77,37 @@ class RasterRowRegionTestCase(TestCase):
 
         six.assertCountEqual(self, rast[2].tolist()[2:6], [11., 21., 31., 41.])
         six.assertCountEqual(self, rast[5].tolist()[2:6], [14., 24., 34., 44.])
-        
+
         rast.close()
 
     def test_resampling_to_numpy(self):
-        
+
         region = Region()
         region.ewres = 0.1
         region.nsres = 0.1
         region.adjust()
         region.set_raster_region()
-        
+
         a = raster2numpy(self.name)
-        
+
         self.assertEqual(len(a), 400)
-        
+
         region.ewres = 1
         region.nsres = 1
         region.adjust()
         region.set_raster_region()
-        
+
         a = raster2numpy(self.name)
-        
+
         self.assertEqual(len(a), 40)
 
         region.ewres = 5
         region.nsres = 5
         region.adjust()
         region.set_raster_region()
-        
+
         a = raster2numpy(self.name)
-        
+
         self.assertEqual(len(a), 8)
 
 if __name__ == '__main__':

+ 1 - 1
lib/python/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py

@@ -38,7 +38,7 @@ def load_tests(loader, tests, ignore):
     Module("r.mapcalc", expression="%s = row() + (10 * col())" % (pygrpc.test_raster_name),
                              overwrite=True)
     utils.create_test_vector_map(pygrpc.test_vector_name)
-    
+
 
     tests.addTests(doctest.DocTestSuite(pygrpc))
     tests.addTests(doctest.DocTestSuite(pygrpc.base))

+ 3 - 3
lib/python/pygrass/vector/testsuite/test_vector.py

@@ -17,10 +17,10 @@ class VectorTopoTestCase(TestCase):
 
     @classmethod
     def setUpClass(cls):
-        
+
         from grass.pygrass import utils
         utils.create_test_vector_map(cls.tmpname)
-        
+
         cls.vect = None
         cls.vect = VectorTopo(cls.tmpname)
         cls.vect.open('r')
@@ -54,7 +54,7 @@ class VectorTopoTestCase(TestCase):
                 for feature in vect.viter(name):
                     count += 1
                 self.assertEqual(count, vect.number_of(name))
-                
+
             self.vect.close()
 
     def test_getitem_raise(self):

+ 1 - 1
lib/python/script/array.py

@@ -302,7 +302,7 @@ class array3d(numpy.memmap):
         if mapname:
             kind = numpy.dtype(dtype).kind
             size = numpy.dtype(dtype).itemsize
-    
+
             if kind == 'f':
                 flags = None # default is double
             elif kind in 'biu':

+ 1 - 1
lib/python/script/db.py

@@ -117,7 +117,7 @@ def db_connection(force=False, env=None):
         nuldev.close()
     except CalledModuleError:
         conn = None
-    
+
     if not conn and force:
         run_command('db.connect', flags='c', env=env)
         conn = parse_command('db.connect', flags='g', env=env)

+ 3 - 3
lib/python/script/setup.py

@@ -151,7 +151,7 @@ def init(gisbase, dbase='', location='demolocation', mapset='PERMANENT'):
     :param dbase: path to GRASS database (default: '')
     :param location: location name (default: 'demolocation')
     :param mapset: mapset within given location (default: 'PERMANENT')
-    
+
     :returns: path to ``gisrc`` file (to be deleted later)
     """
     # Set GISBASE
@@ -191,7 +191,7 @@ def init(gisbase, dbase='', location='demolocation', mapset='PERMANENT'):
             os.environ['GRASS_PYTHON'] = "python3.exe"
         else:
             os.environ['GRASS_PYTHON'] = "python3"
-    
+
     path = os.getenv('PYTHONPATH')
     etcpy = os.path.join(gisbase, 'etc', 'python')
     if path:
@@ -256,7 +256,7 @@ def finish():
 
     GRASS commands can no longer be used after this function has been
     called
-    
+
     Basic usage::
         import grass.script as gs
 

+ 6 - 6
lib/python/script/testsuite/test_utils.py

@@ -16,15 +16,15 @@ class EnvironChange(TestCase):
         self.original_env = {k: os.environ.get(k, self.NOT_FOUND)
                              for k in self.env.keys()}
         for k, v in self.env.items():
-                os.environ[k] = v
+            os.environ[k] = v
 
     def tearDown(self):
         for k, v in self.env.items():
-                oval = self.original_env[k]
-                if oval == self.NOT_FOUND:
-                    os.environ.pop(k)
-                else:
-                    os.environ[k] = oval
+            oval = self.original_env[k]
+            if oval == self.NOT_FOUND:
+                os.environ.pop(k)
+            else:
+                os.environ[k] = oval
 
 
 class LcAllC(EnvironChange):

+ 2 - 2
lib/python/temporal/core.py

@@ -448,7 +448,7 @@ def get_available_temporal_mapsets():
     global message_interface
 
     mapsets = c_library_interface.available_mapsets()
-    
+
     tgis_mapsets = {}
 
     for mapset in mapsets:
@@ -1187,7 +1187,7 @@ class DBConnection(object):
         # Connection in the current mapset
         if dbstring is None:
             dbstring = self.dbstring
-        
+
         dbstring = decode(dbstring)
 
         try:

+ 1 - 1
lib/python/temporal/list_stds.py

@@ -253,7 +253,7 @@ def list_maps_of_stds(type, input, columns, order, where, separator,
                 columns = "id"
 
         rows = sp.get_registered_maps(columns, where, order, dbif)
-        
+
         if not rows:
             dbif.close()
             err = "Space time %(sp)s dataset <%(i)s> is empty"

+ 14 - 14
lib/python/temporal/testsuite/unittests_temporal_algebra_grs.py

@@ -93,7 +93,7 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(len(maplist), 6)
         maplist = ta.check_stds("B")
         self.assertEqual(len(maplist), 6)
-        
+
         ta.parse(expression=expr, basename="r", overwrite=True)
 
         D = tgis.open_old_stds("R", type="strds")
@@ -106,13 +106,13 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(end, datetime.datetime(2001, 7, 1))
         self.assertEqual(D.check_temporal_topology(), True)
         self.assertEqual(D.get_granularity(), u'1 month')
-       
+
     def test_common_granularity_2(self):
         """Testing the common granularity function year to month samping. """
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = 'R = A : C'
         ret = ta.setup_common_granularity(expression=expr)
-        
+
         ta.parse(expression=expr, basename="r", overwrite=True)
 
         D = tgis.open_old_stds("R", type="strds")
@@ -125,14 +125,14 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(end, datetime.datetime(2001, 7, 1))
         self.assertEqual(D.check_temporal_topology(), True)
         self.assertEqual(D.get_granularity(), u'1 month')
-       
+
 
     def test_common_granularity_3(self):
         """Testing the common granularity function with gaps. """
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = 'R = A : D'
         ret = ta.setup_common_granularity(expression=expr)
-        
+
         ta.parse(expression=expr, basename="r", overwrite=True)
 
         D = tgis.open_old_stds("R", type="strds")
@@ -145,14 +145,14 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(end, datetime.datetime(2001, 6, 1))
         self.assertEqual(D.check_temporal_topology(), True)
         self.assertEqual(D.get_granularity(), u'1 month')
-       
+
 
     def test_common_granularity_4(self):
         """Testing the common granularity function year to month with gaps. """
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = 'R = C : D'
         ret = ta.setup_common_granularity(expression=expr)
-        
+
         ta.parse(expression=expr, basename="r", overwrite=True)
 
         D = tgis.open_old_stds("R", type="strds")
@@ -165,13 +165,13 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(end, datetime.datetime(2001, 6, 1))
         self.assertEqual(D.check_temporal_topology(), True)
         self.assertEqual(D.get_granularity(), u'1 month')
-       
+
     def test_common_granularity_4(self):
         """Testing the common granularity function year to month with gaps. """
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = 'R = C : D'
         ret = ta.setup_common_granularity(expression=expr)
-        
+
         ta.parse(expression=expr, basename="r", overwrite=True)
 
         D = tgis.open_old_stds("R", type="strds")
@@ -184,13 +184,13 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(end, datetime.datetime(2001, 6, 1))
         self.assertEqual(D.check_temporal_topology(), True)
         self.assertEqual(D.get_granularity(), u'1 month')
-       
+
     def test_common_granularity_5(self):
         """Testing the common granularity function year to month with gaps. """
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = 'R = A : C : D'
         ret = ta.setup_common_granularity(expression=expr)
-        
+
         ta.parse(expression=expr, basename="r", overwrite=True)
 
         D = tgis.open_old_stds("R", type="strds")
@@ -203,13 +203,13 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(end, datetime.datetime(2001, 6, 1))
         self.assertEqual(D.check_temporal_topology(), True)
         self.assertEqual(D.get_granularity(), u'1 month')
-         
+
     def test_common_granularity_6(self):
         """Testing the common granularity function year to month with gaps. """
         ta = tgis.TemporalAlgebraParser(run=True, debug=True)
         expr = 'R = if(start_month(A) > 2, A : C : D)'
         ret = ta.setup_common_granularity(expression=expr)
-        
+
         ta.parse(expression=expr, basename="r", overwrite=True)
 
         D = tgis.open_old_stds("R", type="strds")
@@ -222,7 +222,7 @@ class TestTemporalAlgebraGranularity(TestCase):
         self.assertEqual(end, datetime.datetime(2001, 6, 1))
         self.assertEqual(D.check_temporal_topology(), True)
         self.assertEqual(D.get_granularity(), u'1 month')
-       
+
 
 
 if __name__ == '__main__':

+ 2 - 2
lib/python/temporal/testsuite/unittests_temporal_raster_algebra_grs.py

@@ -64,7 +64,7 @@ class TestTemporalRasterAlgebra(TestCase):
                                                 start="2001-03-01", end="2001-04-01")
         tgis.register_maps_in_space_time_dataset(type="raster", name=None, maps="nullmap",
                                                 start="2001-01-01", end="2001-07-01")
-        
+
     def tearDown(self):
         return
         self.runModule("t.remove", flags="rf", inputs="R", quiet=True)
@@ -84,7 +84,7 @@ class TestTemporalRasterAlgebra(TestCase):
         expr = "R = if(C == 9,  A - 1)"
         ret = tra.setup_common_granularity(expression=expr, lexer = tgis.TemporalRasterAlgebraLexer())
         self.assertEqual(ret, True)
-        
+
         tra.parse(expression=expr, basename="r", overwrite=True)
 
         D = tgis.open_old_stds("R", type="strds")

+ 1 - 1
lib/python/temporal/testsuite/unittests_temporal_vector_algebra.py

@@ -56,7 +56,7 @@ class TestTemporalVectorAlgebra(TestCase):
                                                  start="2001-01-03", increment="1 day", interval=True)
         tgis.register_maps_in_space_time_dataset(type="vector", name=None, maps="singletmap",
                                                 start="2001-01-03", end="2001-01-04")
-    
+
     def tearDown(self):
         self.runModule("t.remove", type="stvds", inputs="R", quiet=True)
 

+ 3 - 3
lib/raster/testsuite/rast_parse_color_rule.py

@@ -4,8 +4,8 @@
 
 @copyright 2016 by Vaclav Petras and the GRASS Development Team
 
-@license This program is free software under the 
-GNU General Public License (>=v2). 
+@license This program is free software under the
+GNU General Public License (>=v2).
 Read the file COPYING that comes with GRASS
 for details
 """
@@ -39,7 +39,7 @@ class ParseSingleColorRuleColorsTestCase(TestCase):
         norm = c_int()
         nv = c_int()
         default = c_int()
-        ret = Rast_parse_color_rule(min_val, max_val, string, 
+        ret = Rast_parse_color_rule(min_val, max_val, string,
                                     byref(v), byref(r), byref(g), byref(b),
                                     byref(norm), byref(nv), byref(default))
         colors = ("{string} -> "

+ 15 - 17
lib/raster3d/testsuite/raster3d_lib_test.py

@@ -9,32 +9,30 @@ class Raster3dLibraryTest(TestCase):
     @classmethod
     def setUpClass(cls):
         cls.runModule("g.gisenv", set="OVERWRITE=1")
-        
+
     def test_coordinates(self):
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="coord")
-        self.assertModule("test.raster3d.lib",  unit="coord")
+        self.assertModule("test.raster3d.lib", flags="l", unit="coord")
+        self.assertModule("test.raster3d.lib", unit="coord")
 
     def test_putget(self):
-        self.assertModule("test.raster3d.lib",  unit="putget")
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="putget")
+        self.assertModule("test.raster3d.lib", unit="putget")
+        self.assertModule("test.raster3d.lib", flags="l", unit="putget")
 
     def test_large_tilesizes(self):
         """Test for different tile sizes"""
-        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87)
-        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=8)
-        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=512)
-        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=1024)
-        self.assertModule("test.raster3d.lib",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=32768)
+        self.assertModule("test.raster3d.lib", unit="large", depths=91, rows=89, cols=87)
+        self.assertModule("test.raster3d.lib", unit="large", depths=91, rows=89, cols=87, tile_size=8)
+        self.assertModule("test.raster3d.lib", unit="large", depths=91, rows=89, cols=87, tile_size=512)
+        self.assertModule("test.raster3d.lib", unit="large", depths=91, rows=89, cols=87, tile_size=1024)
+        self.assertModule("test.raster3d.lib", unit="large", depths=91, rows=89, cols=87, tile_size=32768)
 
         # Enable zlib compression
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87)
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=8)
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=512)
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=1024)
-        self.assertModule("test.raster3d.lib",  flags="l",  unit="large",  depths=91,  rows=89,  cols=87,  tile_size=32768)
+        self.assertModule("test.raster3d.lib", flags="l", unit="large", depths=91, rows=89, cols=87)
+        self.assertModule("test.raster3d.lib", flags="l", unit="large", depths=91, rows=89, cols=87, tile_size=8)
+        self.assertModule("test.raster3d.lib", flags="l", unit="large", depths=91, rows=89, cols=87, tile_size=512)
+        self.assertModule("test.raster3d.lib", flags="l", unit="large", depths=91, rows=89, cols=87, tile_size=1024)
+        self.assertModule("test.raster3d.lib", flags="l", unit="large", depths=91, rows=89, cols=87, tile_size=32768)
 
 if __name__ == '__main__':
     from grass.gunittest.main import test
     test()
-
-

+ 0 - 1
man/build_class.py

@@ -52,4 +52,3 @@ write_html_footer(f, "index.html", year)
 
 f.close()
 replace_file(filename)
-

+ 1 - 1
man/build_class_graphical.py

@@ -23,7 +23,7 @@ from build_html import (
     default_year, header1_tmpl, grass_version,
     modclass_intro_tmpl, to_title, html_files,
     check_for_desc_override, get_desc, write_html_footer, replace_file,
-    )
+)
 
 
 header_graphical_index_tmpl = """\

+ 11 - 12
man/build_full_index.py

@@ -17,16 +17,16 @@ os.chdir(html_dir)
 
 # TODO: create some master function/dict somewhere
 class_labels = {
-    'd' : 'display',
-    'db' : 'database',
-    'g' : 'general',
-    'i' : 'imagery',
-    'm' : 'miscellaneous',
-    'ps' : 'PostScript',
-    'r' : 'raster',
-    'r3' : '3D raster',
-    't' : 'temporal',
-    'v' : 'vector'
+    'd': 'display',
+    'db': 'database',
+    'g': 'general',
+    'i': 'imagery',
+    'm': 'miscellaneous',
+    'ps': 'PostScript',
+    'r': 'raster',
+    'r3': '3D raster',
+    't': 'temporal',
+    'v': 'vector'
 }
 
 classes = []
@@ -50,7 +50,7 @@ f.write(toc)
 #for all module groups:
 for cls, cls_label in classes:
     f.write(cmd2_tmpl.substitute(cmd_label=to_title(cls_label), cmd=cls))
-    #for all modules:  
+    #for all modules:
     for cmd in html_files(cls):
         basename = os.path.splitext(cmd)[0]
         desc = check_for_desc_override(basename)
@@ -67,4 +67,3 @@ f.close()
 replace_file(filename)
 
 # done full index
-

+ 4 - 4
man/build_full_index_rest.py

@@ -29,16 +29,16 @@ f.write(full_index_header)
 #"
 
 #for cls in classes:
-    #f.write(cmd1_tmpl.substitute(cmd = cls))
-    #if cls != classes[-1]:
-        #f.write(" | ")
+#f.write(cmd1_tmpl.substitute(cmd = cls))
+#if cls != classes[-1]:
+#f.write(" | ")
 
 f.write(sections)
 
 #for all module groups:
 for cls in classes:
     f.write(cmd2_tmpl.substitute(cmd = cls))
-    #for all modules:  
+    #for all modules:
     for cmd in rest_files(cls):
         basename = os.path.splitext(cmd)[0]
         desc = check_for_desc_override(basename)

+ 56 - 56
man/build_html.py

@@ -25,12 +25,12 @@ exclude_mods = [
 desc_override = {
     "g.parser": "Provides automated parser, GUI, and help support for GRASS scipts.",
     "r.li.daemon": "Support module for r.li landscape index calculations."
-    }
+}
 
 ############################################################################
 
-header1_tmpl = string.Template(\
-r"""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+header1_tmpl = string.Template(
+    r"""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
@@ -38,15 +38,15 @@ r"""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  <meta name="Author" content="GRASS Development Team">
 """)
 
-macosx_tmpl = string.Template(\
-r"""
+macosx_tmpl = string.Template(
+    r"""
  <meta name="AppleTitle" content="GRASS GIS ${grass_version} Help">
  <meta name="AppleIcon" content="GRASS-${grass_mmver}/grass_icon.png">
  <meta name="robots" content="anchors">
 """)
 
-header2_tmpl = string.Template(\
-r""" <link rel="stylesheet" href="grassdocs.css" type="text/css">
+header2_tmpl = string.Template(
+    r""" <link rel="stylesheet" href="grassdocs.css" type="text/css">
 </head>
 <body style="width: ${body_width}">
 <div id="container">
@@ -74,8 +74,8 @@ processing and geographic information system (GIS).</p>
 """)
 #"
 
-overview_tmpl = string.Template(\
-r"""<!-- the files grass${grass_version_major}.html & helptext.html file live in lib/init/ -->
+overview_tmpl = string.Template(
+    r"""<!-- the files grass${grass_version_major}.html & helptext.html file live in lib/init/ -->
 
 <table align="center" border="0" cellspacing="8">
   <tbody>
@@ -194,32 +194,32 @@ r"""<!-- the files grass${grass_version_major}.html & helptext.html file live in
 #"
 
 footer_tmpl = string.Template(\
-## TODO: https://trac.osgeo.org/grass/ticket/3987
-#r"""<a name="wxGUI"></a>
-#<h3>wxGUI: Graphical user interface</h3>
-#<table><tbody>
-#<tr><td valign="top"><a href="wxGUI.html">wxGUI Graphical User Interface</a></td> <td>wxGUI Graphical User Interface</td></tr>
-#<tr><td valign="top"><a href="wxGUI.nviz.html">3D visualization suite</a></td>    <td>wxGUI.nviz 3D visualization suite</td></tr>
-#</tbody></table>
-#<p>
-#<a name="further"></a>
-#<h3>Further pages</h3>
-#<table><tbody>
-#<tr><td valign="top"><a href="databaseintro.html">database intro</a></td> <td>database intro</td></tr>
-#<tr><td valign="top"><a href="imageryintro.html">imagery intro</a></td> <td>imagery intro</td></tr>
-#<tr><td valign="top"><a href="projectionintro.html">projection intro</a></td> <td>projection intro</td></tr>
-#<tr><td valign="top"><a href="raster3dintro.html">raster3D intro</a></td> <td>raster3D intro</td></tr>
-#<tr><td valign="top"><a href="rasterintro.html">raster intro</a></td> <td>raster intro</td></tr>
-#<tr><td valign="top"><a href="temporalintro.html">temporal intro</a></td> <td>temporal intro</td></tr>
-#<tr><td valign="top"><a href="vectorintro.html">vector intro</a></td> <td>vector intro</td></tr>
-#<tr><td valign="top"> </td> <td> </td></tr>
-#<tr><td valign="top"><a href="sql.html">SQL</a></td> <td>SQL</td></tr>
-#<tr><td valign="top"><a href="variables.html">Variables</a></td> <td>Variables</td></tr>
-#</tbody></table>
-#
-#<p>
-#<hr class="header">
-r"""<hr class="header">
+    ## TODO: https://trac.osgeo.org/grass/ticket/3987
+    #r"""<a name="wxGUI"></a>
+    #<h3>wxGUI: Graphical user interface</h3>
+    #<table><tbody>
+    #<tr><td valign="top"><a href="wxGUI.html">wxGUI Graphical User Interface</a></td> <td>wxGUI Graphical User Interface</td></tr>
+    #<tr><td valign="top"><a href="wxGUI.nviz.html">3D visualization suite</a></td>    <td>wxGUI.nviz 3D visualization suite</td></tr>
+    #</tbody></table>
+    #<p>
+    #<a name="further"></a>
+    #<h3>Further pages</h3>
+    #<table><tbody>
+    #<tr><td valign="top"><a href="databaseintro.html">database intro</a></td> <td>database intro</td></tr>
+    #<tr><td valign="top"><a href="imageryintro.html">imagery intro</a></td> <td>imagery intro</td></tr>
+    #<tr><td valign="top"><a href="projectionintro.html">projection intro</a></td> <td>projection intro</td></tr>
+    #<tr><td valign="top"><a href="raster3dintro.html">raster3D intro</a></td> <td>raster3D intro</td></tr>
+    #<tr><td valign="top"><a href="rasterintro.html">raster intro</a></td> <td>raster intro</td></tr>
+    #<tr><td valign="top"><a href="temporalintro.html">temporal intro</a></td> <td>temporal intro</td></tr>
+    #<tr><td valign="top"><a href="vectorintro.html">vector intro</a></td> <td>vector intro</td></tr>
+    #<tr><td valign="top"> </td> <td> </td></tr>
+    #<tr><td valign="top"><a href="sql.html">SQL</a></td> <td>SQL</td></tr>
+    #<tr><td valign="top"><a href="variables.html">Variables</a></td> <td>Variables</td></tr>
+    #</tbody></table>
+    #
+    #<p>
+    #<hr class="header">
+    r"""<hr class="header">
 <p>
 <a href="${index_url}">Main index</a> |
 <a href="topics.html">Topics index</a> |
@@ -239,20 +239,20 @@ GRASS GIS ${grass_version} Reference Manual
 """)
 #"
 
-cmd2_tmpl = string.Template(\
-r"""<a name="${cmd}"></a>
+cmd2_tmpl = string.Template(
+    r"""<a name="${cmd}"></a>
 <h3>${cmd_label} commands (${cmd}.*)</h3>
 <table>
 """)
 #"
 
-desc1_tmpl = string.Template(\
-r"""<tr><td valign="top"><a href="${cmd}">${basename}</a></td> <td>${desc}</td></tr>
+desc1_tmpl = string.Template(
+    r"""<tr><td valign="top"><a href="${cmd}">${basename}</a></td> <td>${desc}</td></tr>
 """)
 #"
 
 toc = \
-r"""
+    r"""
 <div class="toc">
 <h4 class="toc">Table of contents</h4>
 <ul class="toc">
@@ -273,47 +273,47 @@ r"""
 """
 #"
 
-modclass_intro_tmpl = string.Template(\
-r"""Go to <a href="${modclass_lower}intro.html">${modclass} introduction</a> | <a href="topics.html">topics</a> <p>
+modclass_intro_tmpl = string.Template(
+    r"""Go to <a href="${modclass_lower}intro.html">${modclass} introduction</a> | <a href="topics.html">topics</a> <p>
 """)
 #"
 
-modclass_tmpl = string.Template(\
-r"""Go <a href="index.html">back to help overview</a>
+modclass_tmpl = string.Template(
+    r"""Go <a href="index.html">back to help overview</a>
 <h3>${modclass} commands:</h3>
 <table>
 """)
 #"
 
-desc2_tmpl = string.Template(\
-r"""<tr><td valign="top"><a href="${cmd}">${basename}</a></td> <td>${desc}</td></tr>
+desc2_tmpl = string.Template(
+    r"""<tr><td valign="top"><a href="${cmd}">${basename}</a></td> <td>${desc}</td></tr>
 """)
 #"
 
 
 full_index_header = \
-r"""
+    r"""
 Go <a href="index.html">back to help overview</a>
 """
 #"
 
 
-message_tmpl = string.Template(\
-r"""Generated HTML docs in ${html_dir}/index.html
+message_tmpl = string.Template(
+    r"""Generated HTML docs in ${html_dir}/index.html
 ----------------------------------------------------------------------
 Following modules are missing the 'modulename.html' file in src code:
 """)
 #"
 
-moduletopics_tmpl = string.Template(\
-r"""
+moduletopics_tmpl = string.Template(
+    r"""
 <li> <a href="topic_${key}.html">${name}</a></li>
 """
 )
 #"
 
 headertopics_tmpl = \
-r"""
+    r"""
 <link rel="stylesheet" href="grassdocs.css" type="text/css">
 </head>
 <body style="width: 99%">
@@ -327,7 +327,7 @@ r"""
 #"
 
 headerkeywords_tmpl = \
-r"""
+    r"""
 <link rel="stylesheet" href="grassdocs.css" type="text/css">
 </head>
 <body style="width: 99%">
@@ -339,8 +339,8 @@ r"""
 """
 #"
 
-headerkey_tmpl = string.Template(\
-r"""
+headerkey_tmpl = string.Template(
+    r"""
 <link rel="stylesheet" href="grassdocs.css" type="text/css">
 </head>
 <body bgcolor="white">
@@ -356,7 +356,7 @@ r"""
 #"
 
 headerpso_tmpl = \
-r"""
+    r"""
 <link rel="stylesheet" href="grassdocs.css" type="text/css">
 <link rel="stylesheet" href="parser_standard_options.css" type="text/css">
 <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>

+ 26 - 26
man/build_rest.py

@@ -29,12 +29,12 @@ exclude_mods = [
 desc_override = {
     "g.parser": "Provides automated parser, GUI, and help support for GRASS scipts.",
     "r.li.daemon": "Support module for r.li landscape index calculations."
-    }
+}
 
 ############################################################################
 
-header2_tmpl = string.Template(\
-r"""
+header2_tmpl = string.Template(
+    r"""
 ==================================================================
 GRASS GIS ${grass_version} Reference Manual
 ==================================================================
@@ -48,9 +48,9 @@ GRASS GIS ${grass_version} Reference Manual
 **Geographic Resources Analysis Support System**, commonly
 referred to as `GRASS GIS <https://grass.osgeo.org>`_, is a `Geographic
 Information System <https://en.wikipedia.org/wiki/Geographic_information_system>`_
-(GIS) used for geospatial data management and analysis, image processing, 
-graphics/maps production, spatial modeling, and visualization. GRASS is 
-currently used in academic and commercial settings around the world, as 
+(GIS) used for geospatial data management and analysis, image processing,
+graphics/maps production, spatial modeling, and visualization. GRASS is
+currently used in academic and commercial settings around the world, as
 well as by many governmental agencies and environmental consulting companies.
 
 This reference manual details the use of modules distributed with
@@ -59,8 +59,8 @@ Geographic Resources Analysis Support System (GRASS), an open source
 processing and geographic information system (GIS).
 """)
 
-overview_tmpl = string.Template(\
-r"""
+overview_tmpl = string.Template(
+    r"""
 Quick Introduction
 ~~~~~~~~~~~~~~~~~~~~
 
@@ -161,8 +161,8 @@ Printing
 """)
 
 #TODO add copyright symbol
-footer_tmpl = string.Template(\
-r"""
+footer_tmpl = string.Template(
+    r"""
 
 --------------
 
@@ -170,11 +170,11 @@ r"""
  2003-2021 `GRASS Development Team <https://grass.osgeo.org>`_, GRASS GIS ${grass_version} Reference Manual
 """)
 
-cmd1_tmpl = string.Template(\
-r"""*`$cmd.\* <${cmd}>` *""")
+cmd1_tmpl = string.Template(
+    r"""*`$cmd.\* <${cmd}>` *""")
 
-cmd2_tmpl = string.Template(\
-r"""
+cmd2_tmpl = string.Template(
+    r"""
 
 ${cmd}.* commands:
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -185,12 +185,12 @@ ${cmd}.* commands:
 
 """)
 
-desc1_tmpl = string.Template(\
-r"""        ${basename} - ${desc} <${basename}>
+desc1_tmpl = string.Template(
+    r"""        ${basename} - ${desc} <${basename}>
 """)
 
 sections = \
-r""" 
+    r"""
 
 +-----------------------------+-------------------------------+
 |`d.* <full_index.html#d>`_   | `display commands`            |
@@ -220,13 +220,13 @@ r"""
 
 """
 
-modclass_intro_tmpl = string.Template(\
-r"""Go to :doc:`${modclass} introduction <${modclass_lower}intro>`
+modclass_intro_tmpl = string.Template(
+    r"""Go to :doc:`${modclass} introduction <${modclass_lower}intro>`
 """)
 #"
 
-modclass_tmpl = string.Template(\
-r"""Go :doc:`back to help overview<index>`
+modclass_tmpl = string.Template(
+    r"""Go :doc:`back to help overview<index>`
 
 
 
@@ -239,14 +239,14 @@ r"""Go :doc:`back to help overview<index>`
 """)
 #"
 
-desc2_tmpl = string.Template(\
-r"""        ${basename} - ${desc} <${basename}>
+desc2_tmpl = string.Template(
+    r"""        ${basename} - ${desc} <${basename}>
 """)
 #"
 
 
 full_index_header = \
-r"""Go :doc:`back to help overview<index>`
+    r"""Go :doc:`back to help overview<index>`
 
 
 Full command index:
@@ -255,8 +255,8 @@ Full command index:
 #"
 
 
-message_tmpl = string.Template(\
-r"""Generated HTML docs in ${rest_dir}/index.txt
+message_tmpl = string.Template(
+    r"""Generated HTML docs in ${rest_dir}/index.txt
 ----------------------------------------------------------------------
 Following modules are missing the 'modulename.txt' file in src code:
 """)

+ 2 - 2
man/build_topics.py

@@ -43,13 +43,13 @@ for fname in htmlfiles:
         keywords[key][fname] = desc
 
 topicsfile = open(os.path.join(path, 'topics.html'), 'w')
-topicsfile.write(header1_tmpl.substitute(title = "GRASS GIS " \
+topicsfile.write(header1_tmpl.substitute(title = "GRASS GIS "
                         "%s Reference Manual: Topics index" % grass_version))
 topicsfile.write(headertopics_tmpl)
 
 for key, values in sorted(keywords.items(), key=lambda s: s[0].lower()):
     keyfile = open(os.path.join(path, 'topic_%s.html' % key), 'w')
-    keyfile.write(header1_tmpl.substitute(title = "GRASS GIS " \
+    keyfile.write(header1_tmpl.substitute(title = "GRASS GIS "
                         "%s Reference Manual: Topic %s" % (grass_version,
                                                     key.replace('_', ' '))))
     keyfile.write(headerkey_tmpl.substitute(keyword=key.replace('_', ' ')))

+ 2 - 1
man/parser_standard_options.py

@@ -103,6 +103,7 @@ def parse_options(lines, startswith='Opt'):
 
 class OptTable(object):
     """"""
+
     def __init__(self, list_of_dict):
         self.options = list_of_dict
         self.columns = sorted(set([key for _, d in self.options
@@ -181,7 +182,7 @@ if __name__ == "__main__":
         name = args.output.name
         args.output.close()
         topicsfile = open(name, 'w')
-        topicsfile.write(header1_tmpl.substitute(title="GRASS GIS " \
+        topicsfile.write(header1_tmpl.substitute(title="GRASS GIS "
                         "%s Reference Manual: Parser standard options index" % grass_version))
         topicsfile.write(headerpso_tmpl)
         topicsfile.write(options.html(toptions=args.htmlparmas))

+ 8 - 7
man/sphinx/conf.py

@@ -11,7 +11,8 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys, os
+import sys
+import os
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
@@ -170,14 +171,14 @@ htmlhelp_basename = 'grass79Documentationdoc'
 # -- Options for LaTeX output --------------------------------------------------
 
 latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
+    # The paper size ('letterpaper' or 'a4paper').
+    #'papersize': 'letterpaper',
 
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
+    # The font size ('10pt', '11pt' or '12pt').
+    #'pointsize': '10pt',
 
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
+    # Additional stuff for the LaTeX preamble.
+    #'preamble': '',
 }
 
 # Grouping the document tree into LaTeX files. List of tuples

+ 6 - 6
raster/r.basins.fill/testsuite/testrbf.py

@@ -27,12 +27,12 @@ class TestRasterbasin(TestCase):
         cls.runModule('r.geomorphon', elevation=cls.celevation, forms=cls.tgeology, overwrite=True)
         cls.runModule('r.mapcalc', seed=seed, expression='rand_cell = rand(1, 200)', overwrite=True)
         cls.runModule('r.thin', input=cls.input, output=cls.output)
-        
+
 
     @classmethod
     def tearDownClass(cls):
         cls.del_temp_region()
-        
+
     def tearDown(cls):
         cls.runModule('g.remove', flags='f', type='raster', name=cls.output)
 
@@ -40,25 +40,25 @@ class TestRasterbasin(TestCase):
         lakes='lakes'
         self.assertModule('r.basins.fill', cnetwork=self.celevation, tnetwork=self.tgeology, output=self.output, number='1', overwrite=True)
         self.assertRasterMinMax(map=lakes, refmin=34300, refmax=43600,
-	                        msg="lakes in degrees must be between 34300 and 43600")
+                                msg="lakes in degrees must be between 34300 and 43600")
 
     def test_no2(self):
         soils='soils'
         self.assertModule('r.basins.fill', cnetwork=self.celevation, tnetwork=self.tgeology, output=self.output, number='3')
         self.assertRasterMinMax(map=soils, refmin=18683, refmax=46555,
-	                        msg="soils in degrees must be between 18683 and 46555")
+                                msg="soils in degrees must be between 18683 and 46555")
 
     def test_no3(self):
         landuse='landuse'
         self.assertModule('r.basins.fill', cnetwork=self.celevation, tnetwork=self.tgeology, output=self.output, number='4')
         self.assertRasterMinMax(map=landuse, refmin=1, refmax=7,
-	                        msg="landuse in degrees must be between 1 and 7")
+                                msg="landuse in degrees must be between 1 and 7")
 
     def test_no4(self):
         rand_cell='rand_cell'
         self.assertModule('r.basins.fill', cnetwork=self.celevation, tnetwork=self.tgeology, output=self.output, number='5')
         self.assertRasterMinMax(map=rand_cell, refmin=1, refmax=199,
-	                        msg="rand_cell in degrees must be between 1 and 199")
+                                msg="rand_cell in degrees must be between 1 and 199")
 
 if __name__ == '__main__':
     from grass.gunittest.main import test

+ 1 - 2
raster/r.contour/testsuite/testrc.py

@@ -74,7 +74,7 @@ class Testrr(TestCase):
     def setUpClass(cls):
         cls.use_temp_region()
         cls.runModule('g.region', raster=cls.input)
-    
+
     @classmethod
     def tearDownClass(cls):
         cls.del_temp_region()
@@ -109,4 +109,3 @@ class Testrr(TestCase):
 if __name__ == '__main__':
     from grass.gunittest.main import test
     test()
-

+ 4 - 4
raster/r.geomorphon/testsuite/test_r_geom.py

@@ -15,7 +15,7 @@ from grass.gunittest.main import test
 from grass.script.core import read_command
 
 synth_out = \
-"""1	flat
+    """1	flat
 3	ridge
 4	shoulder
 6	slope
@@ -24,7 +24,7 @@ synth_out = \
 """
 
 ele_out = \
-"""1	flat
+    """1	flat
 2	summit
 3	ridge
 4	shoulder
@@ -55,7 +55,7 @@ class TestClipling(TestCase):
         cls.runModule('g.remove', flags='f', type='raster',
                       name=(cls.insint, cls.outele, cls.outsint))
         cls.del_temp_region()
-    
+
     def test_ele(self):
         self.runModule('r.geomorphon', elevation=self.inele, forms=self.outele,
                       search=10)
@@ -67,6 +67,6 @@ class TestClipling(TestCase):
                        forms=self.outsint, search=10)
         category = read_command('r.category', map=self.outsint)
         self.assertEqual(first=synth_out, second=category)
-    
+
 if __name__ == '__main__':
     test()

+ 10 - 12
raster/r.gwflow/testsuite/validation_7x7_grid.py

@@ -38,15 +38,15 @@ class Validation7x7Grid(TestCase):
 
     def test_transient(self):
         #First compute the groundwater flow after 500 seconds to have initial conditions
-        self.assertModule("r.gwflow", flags="f", solver="cholesky", top="top_conf", bottom="bottom", phead="phead",\
-         status="status", hc_x="hydcond", hc_y="hydcond", q="well", s="s",\
-         recharge="recharge", output="gwresult_conf", dtime=500, type="confined", budget="water_budget",  overwrite=True)
+        self.assertModule("r.gwflow", flags="f", solver="cholesky", top="top_conf", bottom="bottom", phead="phead",
+         status="status", hc_x="hydcond", hc_y="hydcond", q="well", s="s",
+         recharge="recharge", output="gwresult_conf", dtime=500, type="confined", budget="water_budget", overwrite=True)
 
         # loop over the timesteps each 500 seconds
         for i in range(20):
-            self.assertModule("r.gwflow",  flags="f", solver="cholesky", top="top_conf", bottom="bottom", phead="gwresult_conf",\
-             status="status", hc_x="hydcond", hc_y="hydcond", q="well", s="s",\
-             recharge="recharge", output="gwresult_conf", dtime=500, type="confined", budget="water_budget",  overwrite=True)
+            self.assertModule("r.gwflow", flags="f", solver="cholesky", top="top_conf", bottom="bottom", phead="gwresult_conf",
+             status="status", hc_x="hydcond", hc_y="hydcond", q="well", s="s",
+             recharge="recharge", output="gwresult_conf", dtime=500, type="confined", budget="water_budget", overwrite=True)
 
         # Output of r.univar
         univar_string="""n=49
@@ -61,7 +61,7 @@ class Validation7x7Grid(TestCase):
         variance=0.825479291487849
         coeff_var=1.85111794326975
         sum=2405.00000082079"""
-        
+
         # Output of r.info, only a subset of the output is needed
         info_string="""north=700
         south=0
@@ -77,13 +77,11 @@ class Validation7x7Grid(TestCase):
         min=45.1219899394172
         max=50
         map=gwresult_conf"""
-        
-        self.assertRasterFitsUnivar(raster="gwresult_conf",  reference=univar_string,  precision=3)
-        self.assertRasterFitsInfo(raster="gwresult_conf",  reference=info_string,  precision=3)
+
+        self.assertRasterFitsUnivar(raster="gwresult_conf", reference=univar_string, precision=3)
+        self.assertRasterFitsInfo(raster="gwresult_conf", reference=info_string, precision=3)
 
 
 if __name__ == '__main__':
     from grass.gunittest.main import test
     test()
-
-

+ 7 - 9
raster/r.gwflow/testsuite/validation_excavation.py

@@ -16,7 +16,7 @@ class ValidationExcavation(TestCase):
     def setUpClass(cls):
         """Use temporary region settings"""
         cls.use_temp_region()
-        cls.runModule("g.region", flags="p",  res=50, n=950, s=0, w=0, e=2000)
+        cls.runModule("g.region", flags="p", res=50, n=950, s=0, w=0, e=2000)
 
     @classmethod
     def tearDownClass(cls):
@@ -43,10 +43,10 @@ class ValidationExcavation(TestCase):
 
     def test_steady_state(self):
         #compute a steady state groundwater flow
-        self.assertModule("r.gwflow", flags="f", solver="cholesky", top="top", bottom="bottom", phead="phead", \
-            status="status", hc_x="hydcond", hc_y="hydcond", s="poros", \
+        self.assertModule("r.gwflow", flags="f", solver="cholesky", top="top", bottom="bottom", phead="phead",
+            status="status", hc_x="hydcond", hc_y="hydcond", s="poros",
             recharge="recharge", output="gwresult", dtime=864000000000, type="unconfined", budget="water_budget")
-        
+
         # Output of r.univar -g
         univar_string="""n=760
         null_cells=0
@@ -76,12 +76,10 @@ class ValidationExcavation(TestCase):
         min=3
         max=5.3976262918968
         map=gwresult"""
-        
-        self.assertRasterFitsUnivar(raster="gwresult",  reference=univar_string,  precision=3)
-        self.assertRasterFitsInfo(raster="gwresult",  reference=info_string,  precision=3)
+
+        self.assertRasterFitsUnivar(raster="gwresult", reference=univar_string, precision=3)
+        self.assertRasterFitsInfo(raster="gwresult", reference=info_string, precision=3)
 
 if __name__ == '__main__':
     from grass.gunittest.main import test
     test()
-
-

+ 13 - 13
raster/r.in.ascii/testsuite/test_r_in_ascii.py

@@ -16,9 +16,9 @@ INPUT_NOQUOTES="""north:                   4299000.00
 south:                   4247000.00
 east:                     528000.00
 west:                     500000.00
-rows:                         10   
-cols:                         15   
-null:                      -9999   
+rows:                         10
+cols:                         15
+null:                      -9999
 
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
@@ -35,9 +35,9 @@ INPUT_TSV="""north:                   4299000.00
 south:                   4247000.00
 east:                     528000.00
 west:                     500000.00
-rows:                         10   
-cols:                         15   
-null:                      -9999   
+rows:                         10
+cols:                         15
+null:                      -9999
 
 1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9\ 10\ 11\ 12\ 13\ 14\ 15
 1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9\ 10\ 11\ 12\ 13\ 14\ 15
@@ -54,9 +54,9 @@ INPUT_UNCOMMON="""north:                   4299000.00
 south:                   4247000.00
 east:                     528000.00
 west:                     500000.00
-rows:                         10   
-cols:                         15   
-null:                      -9999   
+rows:                         10
+cols:                         15
+null:                      -9999
 
 1@ 2@ 3@ 4@ 5@ 6@ 7@ 8@ 9@ 10@ 11@ 12@ 13@ 14@ 15
 1@ 2@ 3@ 4@ 5@ 6@ 7@ 8@ 9@ 10@ 11@ 12@ 13@ 14@ 15
@@ -91,28 +91,28 @@ class SimpleCsvTestCase(TestCase):
         self.assertModule('r.in.ascii', input='-', output=self.ascii_test,
                           type='CELL', stdin_=INPUT_NOQUOTES)
         self.assertRasterMinMax(map=self.ascii_test, refmin=1, refmax=15,
-	                        msg="ascii_test in degrees must be between 1 and 15")
+                                msg="ascii_test in degrees must be between 1 and 15")
 
     def test_text_delimeter(self):
         """Testing with external file"""
         self.assertModule('r.in.ascii', input='data/input_ascii.txt', output=self.ascii_test,
                           type='CELL')
         self.assertRasterMinMax(map=self.ascii_test, refmin=1, refmax=5,
-	                        msg="ascii_test in degrees must be between 1 and 5")
+                                msg="ascii_test in degrees must be between 1 and 5")
 
     def test_tsv(self):
         """Test loading TSV"""
         self.assertModule('r.in.ascii', input='-', output=self.ascii_test,
                           type='CELL', stdin_=INPUT_TSV)
         self.assertRasterMinMax(map=self.ascii_test, refmin=1, refmax=15,
-	                        msg="ascii_test in degrees must be between 1 and 15")
+                                msg="ascii_test in degrees must be between 1 and 15")
 
     def test_uncommon_delims(self):
         """Test loading with uncommon delimiters"""
         self.assertModule('r.in.ascii', input='-', output=self.ascii_test,
                           type='CELL', stdin_=INPUT_UNCOMMON)
         self.assertRasterMinMax(map=self.ascii_test, refmin=1, refmax=15,
-	                        msg="ascii_test in degrees must be between 1 and 15")
+                                msg="ascii_test in degrees must be between 1 and 15")
 
 if __name__ == '__main__':
     test()

+ 20 - 22
raster/r.in.gdal/testsuite/test_r_in_gdal.py

@@ -44,7 +44,7 @@ class TestGdalImport(TestCase):
                          coeff_var=18.4170719597623
                          sum=2234751.09436035"""
 
-        self.assertRasterFitsUnivar(raster="test_gdal_import_map",  reference=univar_string,
+        self.assertRasterFitsUnivar(raster="test_gdal_import_map", reference=univar_string,
                                     precision=3)
 
     def test_2(self):
@@ -69,7 +69,7 @@ class TestGdalImport(TestCase):
                          coeff_var=18.4170719597623
                          sum=2234751.09436035"""
 
-        self.assertRasterFitsUnivar(raster="test_gdal_import_map",  reference=univar_string,
+        self.assertRasterFitsUnivar(raster="test_gdal_import_map", reference=univar_string,
                                     precision=3)
 
     def test_3(self):
@@ -94,7 +94,7 @@ class TestGdalImport(TestCase):
                          coeff_var=18.4170719597623
                          sum=2234751.09436035"""
 
-        self.assertRasterFitsUnivar(raster="test_gdal_import_map",  reference=univar_string,
+        self.assertRasterFitsUnivar(raster="test_gdal_import_map", reference=univar_string,
                                     precision=3)
 
     def test_4(self):
@@ -119,7 +119,7 @@ class TestGdalImport(TestCase):
                          coeff_var=18.4170719597623
                          sum=2234751.09436035"""
 
-        self.assertRasterFitsUnivar(raster="test_gdal_import_map",  reference=univar_string,
+        self.assertRasterFitsUnivar(raster="test_gdal_import_map", reference=univar_string,
                                     precision=3)
 
     def test_netCDF_3d_1(self):
@@ -143,15 +143,15 @@ class TestGdalImport(TestCase):
                        datatype=FCELL
                        ncats=0"""
 
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.001",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.001", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.002",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.002", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.003",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.003", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.004",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.004", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.005",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.005", reference=info_string,
                                     precision=3)
 
     def test_netCDF_3d_2(self):
@@ -176,15 +176,15 @@ class TestGdalImport(TestCase):
                        datatype=FCELL
                        ncats=0"""
 
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.101",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.101", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.102",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.102", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.103",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.103", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.104",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.104", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.105",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.105", reference=info_string,
                                     precision=3)
 
     def test_netCDF_3d_3(self):
@@ -209,15 +209,15 @@ class TestGdalImport(TestCase):
                        datatype=FCELL
                        ncats=0"""
 
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.00101",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.00101", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.00102",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.00102", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.00103",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.00103", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.00104",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.00104", reference=info_string,
                                     precision=3)
-        self.assertRasterFitsInfo(raster="test_gdal_import_map.00105",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map.00105", reference=info_string,
                                     precision=3)
 
     def test_netCDF_3d_4(self):
@@ -242,7 +242,7 @@ class TestGdalImport(TestCase):
                        datatype=FCELL
                        ncats=0"""
 
-        self.assertRasterFitsInfo(raster="test_gdal_import_map",  reference=info_string,
+        self.assertRasterFitsInfo(raster="test_gdal_import_map", reference=info_string,
                                     precision=3)
 
     def test_netCDF_3d_5(self):
@@ -287,5 +287,3 @@ class TestGdalImportFails(TestCase):
 if __name__ == '__main__':
     from grass.gunittest.main import test
     test()
-
-

+ 1 - 1
raster/r.in.poly/testsuite/test_rinpoly.py

@@ -6,7 +6,7 @@ from grass.script.core import read_command
 
 
 input1 = \
-b"""
+    b"""
 A
 634308.630394 223320.356473
 640640.712946 223092.401501

+ 6 - 6
raster/r.info/testsuite/test_r_info.py

@@ -11,12 +11,12 @@ Licence:    This program is free software under the GNU General Public
 from grass.gunittest.case import TestCase
 from grass.gunittest.gmodules import SimpleModule
 class TestReport(TestCase):
-    
+
     @classmethod
     def setUpClass(cls):
         """Use temporary region settings"""
         cls.use_temp_region()
-        
+
     @classmethod
     def tearDownClass(cls):
         """!Remove the temporary region"""
@@ -36,14 +36,14 @@ class TestReport(TestCase):
         datatype=CELL
         ncats=43600"""
         self.assertModuleKeyValue(module='r.info', map='lakes', flags='g', reference=output_str,
-	                          precision=2, sep="=")
+                                  precision=2, sep="=")
 
     def test_flagr(self):
         """Testing flag r with map landcover_1m using simple module"""
         output_str="""min=34300
         max=43600"""
         self.assertModuleKeyValue(module='r.info', map='lakes', flags='r', reference=output_str,
-	                          precision=2, sep="=")
+                                  precision=2, sep="=")
 
     def test_flage(self):
         """Testing flag e with map lsat7_2002_50"""
@@ -51,8 +51,8 @@ class TestReport(TestCase):
 
     def test_flagh(self):
         """Testing flag h with map zipcodes"""
-        self.assertModule('r.info', map='lakes', flags='h') 
+        self.assertModule('r.info', map='lakes', flags='h')
 
 if __name__ == '__main__':
     from grass.gunittest.main import test
-    test()    
+    test()

+ 1 - 1
raster/r.mapcalc/testsuite/test_nmedian_bug_3296.py

@@ -90,7 +90,7 @@ class TestNmedianBug(TestCase):
         self.to_remove.append(self.output)
         self.assertRastersNoDifference(actual=self.output,
             reference=self.output_ref, precision=0)
-    
+
     def test_dcell(self):
         expression = "{o}=nmedian(double(({i}[0,-1] - {i})^2), double(({i}[0,1] - {i})^2))".format(o=self.output, i=self.input)
         self.assertModule('r.mapcalc', expression=expression, overwrite=True)

+ 6 - 6
raster/r.random/testsuite/testrandom.py

@@ -22,12 +22,12 @@ class Testrr(TestCase):
     @classmethod
     def setUpClass(cls):
         cls.use_temp_region()
-        cls.runModule('g.region', raster=cls.input) 
+        cls.runModule('g.region', raster=cls.input)
 
     @classmethod
     def tearDownClass(cls):
         cls.del_temp_region()
-    
+
     def tearDown(self):
         """Remove the vector map after each test method"""
 
@@ -61,17 +61,17 @@ class Testrr(TestCase):
         self.assertModule('r.random', input=self.input, cover=self.cover, npoints=100, vector=self.vector, flags='d')
         self.assertModule('v.info', map=self.vector, flags='t')
         topology = dict(points=100, lines=0, areas=0, map3d=1)
-        self.assertVectorFitsTopoInfo(self.vector, topology)  
+        self.assertVectorFitsTopoInfo(self.vector, topology)
 
     def test_flag_b(self):
         """Testing flag b"""
         self.assertModule('r.random', input=self.input, cover=self.cover,
                           npoints=36011, vector=self.vector, flags='b',
                           overwrite=True)
-        self.assertModule('v.info', map=self.vector, flags='t') 
+        self.assertModule('v.info', map=self.vector, flags='t')
         topology = dict(points=36011, lines=0, areas=0)
-        self.assertVectorFitsTopoInfo(self.vector, topology) 
-        
+        self.assertVectorFitsTopoInfo(self.vector, topology)
+
 
 
 if __name__ == '__main__':

+ 2 - 2
raster/r.reclass/testsuite/test_r_reclass.py

@@ -33,12 +33,12 @@ rules3="""
 class Testrr(TestCase):
     output='reclass'
     input='elevation_shade'
- 
+
     @classmethod
     def setUpClass(cls):
         cls.use_temp_region()
         cls.runModule('g.region', raster=cls.input)
-	
+
     @classmethod
     def tearDownClass(cls):
         cls.del_temp_region()

+ 1 - 1
raster/r.recode/testsuite/test_rrecode_ncspm.py

@@ -28,7 +28,7 @@ rules3 = """
 0:1:0:255
 """
 
-# landuse has 7 classes (in nc_spm_08 it is landclass96, not landuse96_28m) 
+# landuse has 7 classes (in nc_spm_08 it is landclass96, not landuse96_28m)
 rules4 = """
 *:3:1
 4:5:2

+ 0 - 0
raster/r.report/testsuite/test_r_report.py


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác