Преглед на файлове

wxGUI/colorrules: fix preview

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44151 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa преди 14 години
родител
ревизия
21ba6f5281
променени са 1 файла, в които са добавени 9 реда и са изтрити 2 реда
  1. 9 2
      gui/wxpython/gui_modules/colorrules.py

+ 9 - 2
gui/wxpython/gui_modules/colorrules.py

@@ -586,9 +586,16 @@ class ColorTable(wx.Frame):
             # find existing color table and copy to temp file
             try:
                 name, mapset = self.inmap.split('@')
+            except ValueError:
+                name = self.inmap
+                mapset = grass.find_file(self.inmap, element = 'cell')['mapset']
+                if not mapset:
+                    return
+            old_colrtable = None
+            if mapset == grass.gisenv()['MAPSET']:
+                old_colrtable = grass.find_file(name=name, element='colr')['file']
+            else:
                 old_colrtable = grass.find_file(name=name, element='colr2/' + mapset)['file']
-            except (TypeError, ValueError):
-                old_colrtable = None
             
             if old_colrtable:
                 colrtemp = utils.GetTempfile()