Browse Source

Issue #142 - AttributeError on build_spec

pull/150/head
chriskiehl 8 years ago
parent
commit
b5253652ad
3 changed files with 6 additions and 6 deletions
  1. 1
      gooey/gui/model.py
  2. 2
      gooey/gui/presenter.py
  3. 9
      gooey/gui/windows/base_window.py

1
gooey/gui/model.py

@ -111,6 +111,7 @@ class MyModel(object):
self.auto_start = self.build_spec.get('auto_start') self.auto_start = self.build_spec.get('auto_start')
self.progress_regex = self.build_spec.get('progress_regex') self.progress_regex = self.build_spec.get('progress_regex')
self.progress_expr = self.build_spec.get('progress_expr') self.progress_expr = self.build_spec.get('progress_expr')
self.disable_progress_bar_animation = self.build_spec['disable_progress_bar_animation']
self.program_name = self.build_spec.get('program_name') self.program_name = self.build_spec.get('program_name')
self.default_size = self.build_spec.get('default_size') self.default_size = self.build_spec.get('default_size')

2
gooey/gui/presenter.py

@ -129,7 +129,7 @@ class Presenter(object):
def on_progress_change(self, progress): def on_progress_change(self, progress):
# observes changes coming from the subprocess # observes changes coming from the subprocess
self.view.update_progress_aync(progress)
self.view.update_progress_aync(progress, self.model.disable_progress_bar_animation)
def on_client_done(self): def on_client_done(self):
if self.client_runner.was_success(): if self.client_runner.was_success():

9
gooey/gui/windows/base_window.py

@ -178,8 +178,8 @@ class BaseWindow(wx.Frame):
def update_console_async(self, msg): def update_console_async(self, msg):
wx.CallAfter(self.runtime_display.append_text, msg) wx.CallAfter(self.runtime_display.append_text, msg)
def update_progress_aync(self, progress):
wx.CallAfter(self.UpdateProgressBar, progress)
def update_progress_aync(self, progress, disable_animation=False):
wx.CallAfter(self.UpdateProgressBar, progress, disable_animation)
def onResize(self, evt): def onResize(self, evt):
evt.Skip() evt.Skip()
@ -189,7 +189,7 @@ class BaseWindow(wx.Frame):
evt.Veto() evt.Veto()
pub.send_message(str(events.WINDOW_CLOSE)) pub.send_message(str(events.WINDOW_CLOSE))
def UpdateProgressBar(self, value):
def UpdateProgressBar(self, value, disable_animation=False):
pb = self.foot_panel.progress_bar pb = self.foot_panel.progress_bar
if value < 0: if value < 0:
pb.Pulse() pb.Pulse()
@ -198,8 +198,7 @@ class BaseWindow(wx.Frame):
if pb.GetValue() != value: if pb.GetValue() != value:
# Windows 7 progress bar animation hack # Windows 7 progress bar animation hack
# http://stackoverflow.com/questions/5332616/disabling-net-progressbar-animation-when-changing-value # http://stackoverflow.com/questions/5332616/disabling-net-progressbar-animation-when-changing-value
if self.build_spec["disable_progress_bar_animation"] \
and sys.platform.startswith("win"):
if disable_animation and sys.platform.startswith("win"):
if pb.GetRange() == value: if pb.GetRange() == value:
pb.SetValue(value) pb.SetValue(value)
pb.SetValue(value-1) pb.SetValue(value-1)

Loading…
Cancel
Save