def begin_get_report(self):
"""Begin getting data for the weather report to display it on
the main_canvas.
The call goes to the Controller first. Then to the Model.
Returns:
None
"""
# Do nothing if no location is entered or an active sub thread
# is running.
if (self.v_link["var_loc"].get() == "") \
or (threading.active_count() > 1):
return
# Clear any error status message.
self.v_link["error_message"] = ""
self.v_link["var_status"].set("Gathering data, please wait...")
# Request a report using a Mediating Controller in a new thread.
report_thread = threading.Thread(target=self.controller.get_report)
report_thread.start()
评论列表
文章目录