def main(): webframe.addHeader('Content-type', 'text/html') webframe.setTitle('Hello, webframe!'); webframe.addCss('/data/style.css') webframe.addScript('/data/script/script.js') webframe.addContent(webframe.util.template('data/template/site.html.pyt', {'content': 'Hello, world!'})) webframe.site()
def setCookie(name, value, expires=False, path='/', domain=False, comment=False): cookies[name] = value import webframe string = urllib.quote_plus(name) + '=' + urllib.quote_plus(value) if comment is not False: string += '; Comment=' + urllib.quote_plus(comment) if domain is not False: string += '; Domain=' + urllib.quote_plus(domain) if expires is not False: string += '; expires=' + expires.strftime('%a, %d-%b-%Y %H:%M:%S GMT') if path is not False: string += '; Path=' + path webframe.addHeader('Set-Cookie', string)