Skip to content

Commit

Permalink
Load invariant state correctly (fixes #615)
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisodriscoll committed Aug 24, 2016
1 parent e9f8208 commit cb93b40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/sas/sasgui/perspectives/invariant/invariant_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ def set_state(self, state=None, data=None):
self.state.file = data.name

num = self.state.saved_state['state_num']
if num > 0:
if int(num) > 0:
self._set_undo_flag(True)
if num < len(state.state_list) - 1:
if int(num) < len(state.state_list) - 1:
self._set_redo_flag(True)

# get bookmarks
Expand Down Expand Up @@ -1859,7 +1859,7 @@ def _layout_button(self):
(self.button_details, 0, wx.ALL, 10),
(self.button_calculate, 0,
wx.RIGHT | wx.TOP | wx.BOTTOM, 10),
(self.button_help, 0,
(self.button_help, 0,
wx.RIGHT | wx.TOP | wx.BOTTOM, 10),])
def _do_layout(self):
"""
Expand All @@ -1881,10 +1881,10 @@ def _do_layout(self):
wx.LEFT | wx.RIGHT | wx.BOTTOM, 10)])
self.SetSizer(self.main_sizer)
self.SetAutoLayout(True)

def on_help(self, event):
"""
Bring up the Invariant Documentation whenever the HELP button is
Bring up the Invariant Documentation whenever the HELP button is
clicked.
Calls DocumentationWindow with the path of the location within the
Expand Down
3 changes: 1 addition & 2 deletions src/sas/sasgui/perspectives/invariant/invariant_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def fromXML(self, file=None, node=None):
val = str(input_field.text.strip())
if input_field is not None:
temp_state[item] = val
self.state_list[ind] = temp_state
self.state_list[str(ind)] = temp_state

# Parse current state (ie, saved_state)
entry = get_content('ns:state', node)
Expand Down Expand Up @@ -789,4 +789,3 @@ def write_toXML(self, datainfo=None, state=None):
if state is not None:
doc = state.toXML(datainfo.name, doc=doc, entry_node=sasentry)
return doc

0 comments on commit cb93b40

Please sign in to comment.