def __init__(self, *content, **attrs): if attrs and 0: print "\nMyDocument attrs parameters:" for key in attrs.keys(): print "\t%s: %s" % (key, attrs[key]) print "" if attrs.has_key("title"): self.mytitle = attrs["title"] del attrs["title"] if attrs.has_key("stylesheet"): ## self.style is added to head automatically by Document # self.style = LINK (rel="stylesheet", type="text/css", href=attrs["stylesheet"]) self.stylesheet = attrs['stylesheet'] del attrs["stylesheet"] if attrs.has_key("javascript"): # self.javascript must added manually after call to Document.__init__ self.javascript = attrs["javascript"] del attrs["javascript"] Document.__init__(self, *content, **attrs) ## if hasattr (self, "javascript"):self.head.append(self.javascript) if hasattr(self, "javascript"): self.addJavascript(self.javascript) if hasattr(self, "stylesheet"): self.addStylesheet(self.stylesheet) if hasattr(self, "mytitle"): self.head.append(TITLE(self.mytitle))
def __init__(self,title,*args,**kw): self.title=html.TITLE(title) Document.__init__(self,*args,**kw)
def __init__(self, title, *args, **kw): self.title = html.TITLE(title) Document.__init__(self, *args, **kw)