def get_default_viewstate(): from notification import NotificationCentre root = init_controller(DEFAULT_ROOT_COMPONENT) vs = ViewState(root) NotificationCentre(vs) vs.post_setup() return vs
def push_new_controller(self, path, component_name, *args, **kwargs): """ Similar to the push_controller method, however it takes a component name and arguments and will init the controller before pushing it onto the given path. """ controller = init_controller(component_name, *args, **kwargs) self.push_controller(path, controller) return controller
def insert_new_controller(self, path, component_name, *args, **kwargs): """ Similar to the insert_controller method, however it takes a component name and arguments and will init the controller before inserting it at the given path, replacing the existing controller stack with a new stack containing just this controller. """ controller = init_controller(component_name, *args, **kwargs) self.insert_controller(path, controller) return controller