Permalink
Browse files

screenmanager: raise exception if start() is called twice. closes #618

  • Loading branch information...
1 parent b3999f3 commit bdc4c131198b9df0a44701aefeb2919e129a1e79 @tito tito committed Aug 10, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 kivy/uix/screenmanager.py
@@ -243,6 +243,8 @@ def start(self, manager):
'''(internal) Start the transition. This is automatically called by the
:class:`ScreenManager`.
'''
+ if self.is_active:
+ raise ScreenManagerException('start() is called twice!')
self.manager = manager
self._anim = Animation(d=self.duration, s=0)
self._anim.bind(on_progress=self._on_progress,
@@ -564,16 +566,16 @@ class ScreenManager(FloatLayout):
def _get_screen_names(self):
return [s.name for s in self.screens]
- screen_names = AliasProperty(_get_screen_names, None, bind=('screens',))
+ screen_names = AliasProperty(_get_screen_names,
+ None, bind=('screens', ))
'''List of the names of all the :class:`Screen` widgets added. The list
is read only.
- :data:`screens_names` is a :class:`~kivy.properties.AliasProperty`,
+ :data:`screens_names` is a :class:`~kivy.properties.AliasProperty`,
it is read-only and updated if the screen list changes, or the name
of a screen changes.
'''
-
def __init__(self, **kwargs):
super(ScreenManager, self).__init__(**kwargs)
self.bind(pos=self._update_pos)

0 comments on commit bdc4c13

Please sign in to comment.