From 653f5b858d5cf926fef7d0620f622bd04d6362c2 Mon Sep 17 00:00:00 2001 From: chriskiehl Date: Sat, 6 Jun 2015 15:27:33 -0400 Subject: [PATCH] Swapped to internal pubsub framework for better cross platform support --- gooey/gui/controller.py | 10 +++++----- gooey/gui/windows/base_window.py | 2 +- gooey/gui/windows/footer.py | 4 ++-- gooey/gui/windows/header.py | 2 +- gooey/gui/windows/layouts.py | 2 +- gooey/gui/windows/sidebar.py | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gooey/gui/controller.py b/gooey/gui/controller.py index 68afae8..30523dc 100644 --- a/gooey/gui/controller.py +++ b/gooey/gui/controller.py @@ -8,7 +8,7 @@ import wx import sys import subprocess -from wx.lib.pubsub import pub +from gooey.gui.pubsub import pub from multiprocessing.dummy import Pool from gooey.gui import events @@ -43,7 +43,7 @@ class Controller(object): pub.subscribe(self.on_edit, events.WINDOW_EDIT) def on_edit(self): - pub.sendMessage(events.WINDOW_CHANGE, view_name=views.CONFIG_SCREEN) + pub.send_message(events.WINDOW_CHANGE, view_name=views.CONFIG_SCREEN) def on_close(self): self.core_gui.Destroy() @@ -71,7 +71,7 @@ class Controller(object): cmd_line_args = self.core_gui.GetOptions() command = '{0} {1}'.format(self.build_spec['target'], cmd_line_args) - pub.sendMessage(events.WINDOW_CHANGE, view_name=views.RUNNING_SCREEN) + pub.send_message(events.WINDOW_CHANGE, view_name=views.RUNNING_SCREEN) self.run_client_code(command) def run_client_code(self, command): @@ -90,10 +90,10 @@ class Controller(object): def process_result(self, process): _stdout, _stderr = process.communicate() if process.returncode == 0: - pub.sendMessage(events.WINDOW_CHANGE, view_name=views.SUCCESS_SCREEN) + pub.send_message(events.WINDOW_CHANGE, view_name=views.SUCCESS_SCREEN) self.success_dialog() else: - pub.sendMessage(events.WINDOW_CHANGE, view_name=views.ERROR_SCREEN) + pub.send_message(events.WINDOW_CHANGE, view_name=views.ERROR_SCREEN) self.error_dialog(_stderr) def skipping_config(self): diff --git a/gooey/gui/windows/base_window.py b/gooey/gui/windows/base_window.py index 2d21b3e..f8b3be1 100644 --- a/gooey/gui/windows/base_window.py +++ b/gooey/gui/windows/base_window.py @@ -4,7 +4,7 @@ Created on Jan 19, 2014 ''' import wx -from wx.lib.pubsub import pub +from gooey.gui.pubsub import pub from gooey.gui.controller import Controller from gooey.gui.lang import i18n diff --git a/gooey/gui/windows/footer.py b/gooey/gui/windows/footer.py index c821ea6..02be256 100644 --- a/gooey/gui/windows/footer.py +++ b/gooey/gui/windows/footer.py @@ -7,7 +7,7 @@ Created on Dec 23, 2013 import wx import wx.animate -from wx.lib.pubsub import pub +from gooey.gui.pubsub import pub from gooey.gui.lang import i18n from gooey.gui import imageutil, image_repository, events @@ -148,7 +148,7 @@ class Footer(AbstractFooter): self.Bind(wx.EVT_BUTTON, self.dispatch_click, button) def dispatch_click(self, event): - pub.sendMessage(str(event.GetId())) + pub.send_message(str(event.GetId())) event.Skip() diff --git a/gooey/gui/windows/header.py b/gooey/gui/windows/header.py index 890541c..b88b5cd 100644 --- a/gooey/gui/windows/header.py +++ b/gooey/gui/windows/header.py @@ -5,7 +5,7 @@ Created on Dec 23, 2013 ''' import wx -from wx.lib.pubsub import pub +from gooey.gui.pubsub import pub from gooey.gui import imageutil, image_repository, events from gooey.gui.util import wx_util diff --git a/gooey/gui/windows/layouts.py b/gooey/gui/windows/layouts.py index dd2ffb4..67393fe 100644 --- a/gooey/gui/windows/layouts.py +++ b/gooey/gui/windows/layouts.py @@ -1,6 +1,6 @@ from collections import OrderedDict import wx -from wx.lib.pubsub import pub +from gooey.gui.pubsub import pub from gooey.gui import events from gooey.gui.windows.advanced_config import ConfigPanel diff --git a/gooey/gui/windows/sidebar.py b/gooey/gui/windows/sidebar.py index c39b60e..b12a2be 100644 --- a/gooey/gui/windows/sidebar.py +++ b/gooey/gui/windows/sidebar.py @@ -1,5 +1,5 @@ import wx -from wx.lib.pubsub import pub +from gooey.gui.pubsub import pub from gooey.gui import events from gooey.gui.util import wx_util @@ -43,5 +43,5 @@ class Sidebar(wx.Panel): self.Bind(wx.EVT_LISTBOX, self.onClick, thing) def onClick(self, evt): - pub.sendMessage(events.PANEL_CHANGE, view_name=evt.GetString()) + pub.send_message(events.PANEL_CHANGE, view_name=evt.GetString()) evt.Skip()