Commit 6b9fe392 authored by sumpfralle's avatar sumpfralle

don't try to get statistics, if the server is not enabled


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@771 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 572a93cc
...@@ -1468,10 +1468,12 @@ class ProjectGui: ...@@ -1468,10 +1468,12 @@ class ProjectGui:
not is_available) not is_available)
self.gui.get_object("ProcessPoolStatisticsBox").set_visible( self.gui.get_object("ProcessPoolStatisticsBox").set_visible(
is_available) is_available)
interval = int(max(1, self.gui.get_object( if is_available:
"ProcessPoolRefreshInterval").get_value())) # start the refresh function
gobject.timeout_add_seconds(interval, interval = int(max(1, self.gui.get_object(
self.update_process_pool_statistics, interval) "ProcessPoolRefreshInterval").get_value()))
gobject.timeout_add_seconds(interval,
self.update_process_pool_statistics, interval)
self.process_pool_window.show() self.process_pool_window.show()
else: else:
self.process_pool_window.hide() self.process_pool_window.hide()
......
...@@ -65,7 +65,10 @@ def is_pool_available(): ...@@ -65,7 +65,10 @@ def is_pool_available():
def get_pool_statistics(): def get_pool_statistics():
global __manager global __manager
return __manager.statistics().get_worker_statistics() if __manager is None:
return []
else:
return __manager.statistics().get_worker_statistics()
def init_threading(number_of_processes=None, enable_server=False, remote=None, run_server=False, def init_threading(number_of_processes=None, enable_server=False, remote=None, run_server=False,
server_credentials=""): server_credentials=""):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment