def ready(self): dependencies = OrderedDict() all_apps = list(six.itervalues(sellmo_apps)) for app in all_apps: app_dependencies = set() # Explicit dependencies for dependency in app.dependencies: if dependency not in sellmo_apps: raise ImproperlyConfigured("Missing app %s required " "by %s" % (dependency, app.name)) app_dependencies.add(sellmo_apps[dependency]) dependencies[app] = app_dependencies self.apps = list(topological_sort(dependencies)) # Modules are first imported followed lastly by # extra imports. Module order first, then app order for each # module. # Delayed loading registration is now done. We can now call all # delayed functions in correct order. pre_inject.send(self) self.load_apps_module('inject') post_inject.send(self) pre_load.send(self) loader.load() post_load.send(self) pre_configure.send(self) self.load_apps_module('configure') post_configure.send(self) pre_link.send(self) self.load_apps_module('links') post_link.send(self) # We are done post_init.send(self)
def ready(self): dependencies = OrderedDict() all_apps = list(six.itervalues(sellmo_apps)) for app in all_apps: app_dependencies = set() # Explicit dependencies for dependency in app.dependencies: if dependency not in sellmo_apps: raise ImproperlyConfigured("Missing app %s required " "by %s" % (dependency, app.name)) app_dependencies.add(sellmo_apps[dependency]) dependencies[app] = app_dependencies self.apps = list(topological_sort(dependencies)) # Modules are first imported followed lastly by # extra imports. Module order first, then app order for each # module. # Delayed loading registration is now done. We can now call all # delayed functions in correct order. pre_inject.send(self) self.load_apps_module("inject") post_inject.send(self) pre_load.send(self) loader.load() post_load.send(self) pre_configure.send(self) self.load_apps_module("configure") post_configure.send(self) pre_link.send(self) self.load_apps_module("links") post_link.send(self) # We are done post_init.send(self)
def load(self): for loadable in topological_sort(self._graph): for func in loadable.funcs: func()
def load(self): for loadable in topological_sort(self._graph): if loadable.func: loadable.func()