def root(self, request: IRequest, tag: Tag) -> KleinRenderable: """ Root element. """ user = getattr(request, "user", None) if user is None: username = "******" else: try: username = user.shortNames[0] except IndexError: username = "******" slots = dict(user=username) tag.fillSlots(**slots) return tag
def destination(self, request: IRequest, tag: Tag) -> str: """ JSON string: URL for the redirect destination. """ return cast(str, tag.fillSlots(destination_url=self.location.asText()))
def renderMethod( self, request: Optional[IRequest], tag: Tag ) -> Flattenable: return tag.fillSlots(test2="world.")
def fillSlot(tag: Tag) -> Tag: return tag.fillSlots(stuff=toss.pop())
def sourceLink(self, request: object, tag: Tag) -> "Flattenable": if self.ob.sourceHref: return tag.fillSlots(sourceHref=self.ob.sourceHref) else: return ()
def destination(self, request: IRequest, tag: Tag) -> str: """ JSON string: URL for the redirect destination. """ return tag.fillSlots(destination_url=self.location.asText())