Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGUI: Fixed bare except clause in mapwin/base.py #4980

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ per-file-ignores =
gui/wxpython/mapdisp/main.py: E722
gui/wxpython/mapdisp/test_mapdisp.py: E501
gui/wxpython/mapswipe/g.gui.mapswipe.py: E501
gui/wxpython/mapwin/base.py: E722
gui/wxpython/mapwin/buffered.py: E722
gui/wxpython/timeline/g.gui.timeline.py: E501
# Generated file
Expand Down
6 changes: 3 additions & 3 deletions gui/wxpython/mapwin/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def HandlersCaller(self, event, handlers):
for handler in handlers:
try:
handler(event)
except:
except Exception:
handlers.remove(handler)
GError(
parent=self,
Expand Down Expand Up @@ -308,7 +308,7 @@ def UnregisterAllHandlers(self):
try:
handler("unregistered")
handlers.remove(handler)
except:
except Exception:
GError(
parent=self,
message=_(
Expand Down Expand Up @@ -347,7 +347,7 @@ def UnregisterMouseEventHandler(self, event, handler):
grass.warning(
_("Handler: %s was not registered") % handler.__name__
)
except:
except Exception:
GError(
parent=self,
message=_(
Expand Down
99 changes: 89 additions & 10 deletions gui/wxpython/vdigit/wxdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,102 @@
"""

import locale

import os
import sys
import wx
from ctypes import CFUNCTYPE, UNCHECKED, String, byref, c_double, c_int, pointer

import wx
from core.debug import Debug
from core.settings import UserSettings
from core.gcmd import DecodeString
from core.settings import UserSettings
from grass.lib.gis import (
PORT_DOUBLE_MAX,
G_gisinit,
G_set_error_routine,
G_set_percent_routine,
G_unset_error_routine,
G_unset_percent_routine,
)
from grass.lib.vector import (
GV_BOUNDARY,
GV_BUILD_NONE,
GV_CENTROID,
GV_LINE,
GV_LINES,
GV_MODE_RW,
GV_POINT,
GV_POINTS,
WITHOUT_Z,
Map_info,
Vect_append_point,
Vect_box_copy,
Vect_box_extend,
Vect_build,
Vect_build_partial,
Vect_close,
Vect_destroy_cats_struct,
Vect_destroy_line_struct,
Vect_destroy_list,
Vect_find_line_list,
Vect_get_area_box,
Vect_get_area_centroid,
Vect_get_centroid_area,
Vect_get_line_box,
Vect_get_map_box,
Vect_get_num_areas,
Vect_get_num_lines,
Vect_is_3d,
Vect_line_alive,
Vect_line_check_duplicate,
Vect_line_distance,
Vect_list_append,
Vect_new_cats_struct,
Vect_new_line_struct,
Vect_new_list,
Vect_open_old,
Vect_open_tmp_old,
Vect_open_tmp_update,
Vect_open_update,
Vect_point_in_area,
Vect_point_in_poly,
Vect_points_distance,
Vect_read_line,
Vect_select_lines_by_polygon,
Vect_set_updated,
bound_box,
)
from grass.lib.vedit import (
DRAW_AREA,
DRAW_BOUNDARYNO,
DRAW_BOUNDARYONE,
DRAW_BOUNDARYTWO,
DRAW_CENTROIDDUP,
DRAW_CENTROIDIN,
DRAW_CENTROIDOUT,
DRAW_DIRECTION,
DRAW_LINE,
DRAW_NODEONE,
DRAW_NODETWO,
DRAW_POINT,
DRAW_VERTEX,
TYPE_AREA,
TYPE_BOUNDARYNO,
TYPE_BOUNDARYONE,
TYPE_BOUNDARYTWO,
TYPE_CENTROIDDUP,
TYPE_CENTROIDIN,
TYPE_CENTROIDOUT,
TYPE_DIRECTION,
TYPE_ISLE,
TYPE_LINE,
TYPE_NODEONE,
TYPE_NODETWO,
TYPE_POINT,
TYPE_VERTEX,
Vedit_render_map,
)
from gui_core.wrap import Rect

try:
from grass.lib.gis import *
from grass.lib.vector import *
from grass.lib.vedit import *
except (ImportError, OSError, TypeError) as e:
print("wxdigit.py: {}".format(e), file=sys.stderr)

log = None
progress = None
last_error = ""
Expand Down
Loading