Skip to content

Commit

Permalink
wxGUI/wx.metadata: fix lazy import of GRASS GIS wxPy 'core.gcmd', 'gu…
Browse files Browse the repository at this point in the history
…i_core.forms' module classes (#614)

Fix compilation errors on the OS MS Windows.
  • Loading branch information
tmszi committed Sep 25, 2021
1 parent fb049de commit 0e26601
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
from core.debug import Debug

# from datacatalog.tree import LocationMapTree
from core.utils import GetListOfLocations, ListOfMapsets

grass.utils.set_path(modulename="wx.metadata", dirname="mdlib", path="..")

Expand Down Expand Up @@ -82,9 +81,10 @@ def __init__(
super(LocationMapTree, self).__init__(parent, id=wx.ID_ANY, style=style)

try:
global RunCommand
global GetListOfLocations, ListOfMapsets, RunCommand

from core.gcmd import RunCommand
from core.utils import GetListOfLocations, ListOfMapsets
except ModuleNotFoundError as e:
msg = e.msg
sys.exit(
Expand Down
5 changes: 2 additions & 3 deletions src/gui/wxpython/wx.metadata/mdlib/cswlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

set_gui_path()

from gui_core.forms import GUI

import wx
import wx.html as html
from wx import SplitterWindow
Expand Down Expand Up @@ -105,7 +103,7 @@ def __init__(self, parent, main, giface=None):
wx.Panel.__init__(self, parent)

try:
global BBox, CatalogueServiceWeb, Environment, ExceptionReport, FileSystemLoader, GError, GMessage, GWarning, HtmlFormatter, PropertyIsLike, XmlLexer, highlight
global BBox, CatalogueServiceWeb, Environment, ExceptionReport, FileSystemLoader, GError, GMessage, GUI, GWarning, HtmlFormatter, PropertyIsLike, XmlLexer, highlight

from jinja2 import Environment, FileSystemLoader

Expand All @@ -118,6 +116,7 @@ def __init__(self, parent, main, giface=None):
from pygments.lexers import XmlLexer

from core.gcmd import GError, GMessage, GWarning
from gui_core.forms import GUI
except ModuleNotFoundError as e:
msg = e.msg
sys.exit(
Expand Down

0 comments on commit 0e26601

Please sign in to comment.