Skip to content

Commit

Permalink
Apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix committed Oct 5, 2024
1 parent 5ed67b0 commit 46352ab
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 25 deletions.
14 changes: 6 additions & 8 deletions gui/wxpython/core/gconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,7 @@ def RunCmd(
import importlib.machinery

def load_source(modname, filename):
loader = importlib.machinery.SourceFileLoader(
modname, filename
)
loader = importlib.machinery.SourceFileLoader(modname, filename)
spec = importlib.util.spec_from_file_location(
modname, filename, loader=loader
)
Expand Down Expand Up @@ -625,9 +623,9 @@ def load_source(modname, filename):
if hasParams and not isinstance(self._guiparent, FormNotebook):
# also parent must be checked, see #3135 for details
try:
GUI(
parent=self._guiparent, giface=self._giface
).ParseCommand(command)
GUI(parent=self._guiparent, giface=self._giface).ParseCommand(
command
)
self.UpdateHistory(status=Status.SUCCESS)
except GException as e:
print(e, file=sys.stderr)
Expand Down Expand Up @@ -657,8 +655,8 @@ def load_source(modname, filename):
)
self.cmdOutputTimer.Start(50)

# we don't need to change computational region settings
# because we work on a copy
# we don't need to change computational region settings
# because we work on a copy
else:
# Send any other command to the shell. Send output to
# console output window
Expand Down
4 changes: 1 addition & 3 deletions gui/wxpython/history/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,7 @@ def GetHistoryNode(self, entry, command_index=None):
# If no command index is specified, return the first found day node
return day_nodes[0]
# Search for command nodes under the first day node
command_nodes = self._model.SearchNodes(
parent=day_nodes[0], type=COMMAND
)
command_nodes = self._model.SearchNodes(parent=day_nodes[0], type=COMMAND)
if 0 <= command_index < len(command_nodes):
return command_nodes[command_index]

Expand Down
5 changes: 1 addition & 4 deletions gui/wxpython/location_wizard/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -1918,10 +1918,7 @@ def OnPageChanging(self, event):
# splitting on space alone would break for grid files with
# space in pathname
for projterm in projlabel.split(" +"):
if (
projterm.find("towgs84=") != -1
or projterm.find("nadgrids=") != -1
):
if projterm.find("towgs84=") != -1 or projterm.find("nadgrids=") != -1:
self.custom_dtrans_string = " +%s" % projterm
break

Expand Down
8 changes: 2 additions & 6 deletions python/grass/pygrass/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ def mapinfo_must_be_set(method):
def wrapper(self, *args, **kargs):
if self.c_mapinfo:
return method(self, *args, **kargs)
raise GrassError(
_("The self.c_mapinfo pointer must be correctly initiated")
)
raise GrassError(_("The self.c_mapinfo pointer must be correctly initiated"))

return wrapper

Expand All @@ -34,8 +32,6 @@ def must_be_in_current_mapset(method):
def wrapper(self, *args, **kargs):
if self.mapset == libgis.G_mapset().decode():
return method(self, *args, **kargs)
raise GrassError(
_("Map <{}> not found in current mapset").format(self.name)
)
raise GrassError(_("Map <{}> not found in current mapset").format(self.name))

return wrapper
5 changes: 1 addition & 4 deletions python/grass/temporal/abstract_map_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,7 @@ def set_absolute_time(self, start_time, end_time=None):
)
return False
self.msgr.error(
_(
"Start time must be of type datetime for "
"%(type)s map <%(id)s>"
)
_("Start time must be of type datetime for %(type)s map <%(id)s>")
% {"type": self.get_type(), "id": self.get_map_id()}
)
return False
Expand Down

0 comments on commit 46352ab

Please sign in to comment.