def _locateComponentChild(self, ctx, segments): avatar = itub.IAvatar(ctx, None) if avatar is None: return appserver.NotFound try: app, component = avatar.applications.componentByName(segments[0]) except KeyError: return appserver.NotFound # Build a list of skins provided by the application and/or component. skins = [getattr(app, 'skin', None), getattr(component, 'skin', None)] skins = [s for s in skins if s] try: storeSession = util.getStoreSession(ctx) return util.appendSkinsAndCall(ctx, skins, component.resourceFactory, avatar, storeSession, segments[1:]) except TypeError: import warnings warnings.warn( "IApplicationComponent.resourceFactory now takes a storeSession, please update %s."%component.name, DeprecationWarning) return util.appendSkinsAndCall(ctx, skins, component.resourceFactory, avatar, segments[1:])
def renderHTTP(self, ctx): return util.appendSkinsAndCall(ctx, [self.defaultSkin], self.wrapped.renderHTTP, ctx)
def locateChild(self, ctx, segments): return util.appendSkinsAndCall(ctx, [self.defaultSkin], self.wrapped.locateChild, ctx, segments)