Mercurial > MadButterfly
changeset 1419:3519f43da037
Check old component before hiding it for a component switching.
Ref: ticket #37 in assembla
- Scribboo try to hide old component before switching to new one.
But, old one was already removed. It cause an error.
- This is fixed by checking old component if it is still existed
before hiding it.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Thu, 07 Apr 2011 13:45:07 +0800 |
parents | 485cca025a77 |
children | 41190d180b97 |
files | pyink/domview.py |
diffstat | 1 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/pyink/domview.py Thu Apr 07 11:56:18 2011 +0800 +++ b/pyink/domview.py Thu Apr 07 13:45:07 2011 +0800 @@ -474,7 +474,17 @@ first_name = comp.all_timeline_names()[0] self.switch_timeline(first_name) - self.hide_component(old_comp.name()) + try: + comp_grp = self.get_component_group(old_comp.name()) + old_comp_existed = True + except ValueError: + old_comp_existed = False + pass + + if old_comp_existed: + self.hide_component(old_comp.name()) + pass + self.show_component(comp.name()) pass