[GRASS-SVN] r67530 - grass/trunk/gui/wxpython/datacatalog

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 9 09:19:22 PST 2016


Author: martinl
Date: 2016-01-09 09:19:22 -0800 (Sat, 09 Jan 2016)
New Revision: 67530

Modified:
   grass/trunk/gui/wxpython/datacatalog/tree.py
Log:
wxGUI/datacatalog: add more debug messages

Modified: grass/trunk/gui/wxpython/datacatalog/tree.py
===================================================================
--- grass/trunk/gui/wxpython/datacatalog/tree.py	2016-01-09 16:24:13 UTC (rev 67529)
+++ grass/trunk/gui/wxpython/datacatalog/tree.py	2016-01-09 17:19:22 UTC (rev 67530)
@@ -61,11 +61,12 @@
     try:
         mapsets = gscript.read_command('g.mapsets', flags='l', quiet=True, env=env).strip()
     except CalledModuleError:
-        queue.put((maps_dict, _("Failed to read mapsets from location {l}.").format(l=location)))
+        queue.put((maps_dict, _("Failed to read mapsets from location <{l}>.").format(l=location)))
         gscript.try_remove(tmp_gisrc_file)
         return
     else:
         listOfMapsets = mapsets.split()
+        Debug.msg(4, "Location <{}>: {} mapsets found".format(location, len(listOfMapsets)))
         for each in listOfMapsets:
             maps_dict[each] = {}
             for elem in elements:
@@ -74,12 +75,14 @@
         maplist = gscript.read_command('g.list', flags='mt', type=elements,
                                        mapset=','.join(listOfMapsets), quiet=True, env=env).strip()
     except CalledModuleError:
-        queue.put((maps_dict, _("Failed to read maps from location {l}.").format(l=location)))
+        queue.put((maps_dict, _("Failed to read maps from location <{l}>.").format(l=location)))
         gscript.try_remove(tmp_gisrc_file)
         return
     else:
         # fill dictionary
-        for each in maplist.splitlines():
+        listOfMaps = maplist.splitlines()
+        Debug.msg(4, "Location <{}>: {} maps found".format(location, len(listOfMaps)))
+        for each in listOfMaps:
             ltype, wholename = each.split('/')
             name, mapset = wholename.split('@')
             maps_dict[mapset][ltype].append(name)
@@ -139,6 +142,7 @@
         results = dict()
         errors = []
         location_nodes = []
+        nlocations = len(locations)
         for location in locations:
             results[location] = dict()
             varloc = self._model.AppendNode(parent=self._model.root, label=location,
@@ -146,6 +150,8 @@
             location_nodes.append(varloc)
             loc_count += 1
 
+            Debug.msg(3, "Scanning location <{}> ({}/{})".format(location, loc_count, nlocations))
+
             q = Queue()
             p = Process(target=getLocationTree,
                         args=(self.gisdbase, location, q))
@@ -157,7 +163,8 @@
 
             proc_count += 1
             # Wait for all running processes
-            if proc_count == nprocs or loc_count == len(locations):
+            if proc_count == nprocs or loc_count == nlocations:
+                Debug.msg(4, "Process subresults")
                 for i in range(len(loc_list)):
                     proc_list[i].join()
                     maps, error = queue_list[i].get()



More information about the grass-commit mailing list