# HG changeset patch # User Goffi # Date 1473516093 -7200 # Node ID fd9cbf6ae6636af1270136031ff3cb61f9988bd6 # Parent 028a98983e46180be8b1b4cfc65588f3aa35ecd5 core: postInit() is now called, allowing automatic profile connection diff -r 028a98983e46 -r fd9cbf6ae663 src/cagou/core/cagou_main.py --- a/src/cagou/core/cagou_main.py Sat Sep 10 15:52:30 2016 +0200 +++ b/src/cagou/core/cagou_main.py Sat Sep 10 16:01:33 2016 +0200 @@ -183,7 +183,8 @@ """Kivy App for Cagou""" def build(self): - return CagouRootWidget(ProfileManager()) + self._profile_manager = ProfileManager() + return CagouRootWidget(self._profile_manager) def expand(self, path, *args, **kwargs): """expand path and replace known values @@ -218,8 +219,14 @@ yield w def run(self): + Clock.schedule_once(self.postInit) self.app.run() + def postInit(self, dummy): + profile_manager = self.app._profile_manager + del self.app._profile_manager + super(Cagou, self).postInit(profile_manager) + def _defaultFactory(self, plugin_info, target, profiles): """factory used to create widget instance when PLUGIN_INFO["factory"] is not set""" main_cls = plugin_info['main']