Skip to content

Commit

Permalink
wxGUI/animation: show error and proceed with temporal database mismat…
Browse files Browse the repository at this point in the history
…ch (OSGeo#950)
  • Loading branch information
petrasovaa authored Sep 1, 2020
1 parent a7a7817 commit 6f86e05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 6 additions & 4 deletions gui/wxpython/animation/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@
@author Anna Petrasova <kratochanna gmail.com>
"""
import os
import sys
import wx
import wx.aui
import tempfile
import six

import grass.script as gcore
import grass.temporal as tgis
from grass.exceptions import FatalError
from core import globalvar
from gui_core.widgets import IntegerValidator
from gui_core.wrap import StaticText, TextCtrl
from core.gcmd import RunCommand
from core.gcmd import RunCommand, GWarning

from animation.mapwindow import AnimationWindow
from animation.provider import BitmapProvider, BitmapPool, \
Expand Down Expand Up @@ -65,7 +64,10 @@ def __init__(self, parent, giface, title=_("GRASS GIS Animation tool"),
wx.BITMAP_TYPE_ICO))

# Make sure the temporal database exists
tgis.init()
try:
tgis.init()
except FatalError as e:
GWarning(parent=self, message=str(e))

# create temporal directory and ensure it's deleted after programs ends
# (stored in MAPSET/.tmp/)
Expand Down
6 changes: 5 additions & 1 deletion gui/wxpython/animation/g.gui.animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#%end

import grass.script as gscript
from grass.exceptions import FatalError


def main():
Expand Down Expand Up @@ -94,7 +95,10 @@ def main():
# We need to initialize the temporal framework in case
# a space time dataset was set on the command line so that
# the AnimLayer() class works correctly
tgis.init()
try:
tgis.init()
except FatalError as e:
print(e)

layerList = LayerList()
if rast:
Expand Down

0 comments on commit 6f86e05

Please sign in to comment.