Ejemplo n.º 1
0
def render(page_name):
    """render html page"""
    try:
        html = render_page(page_name or "index")
    except PageNotFoundError:
        html = render_page("404")
    except Exception:
        html = render_page('error')

    from webnotes.handler import eprint, print_zip
    eprint("Content-Type: text/html; charset: utf-8")
    print_zip(html)
Ejemplo n.º 2
0
def render(page_name):
    """render html page"""
    try:
        if page_name:
            html = get_html(page_name)
        else:
            html = get_html('index')
    except Exception:
        html = get_html('error')

    from webnotes.handler import eprint, print_zip
    eprint("Content-Type: text/html; charset: utf-8")
    print_zip(html)
Ejemplo n.º 3
0
def render(page_name):
	"""render html page"""
	try:
		if page_name:
			html = get_html(page_name)
		else:
			html = get_html('index')
	except Exception:
		html = get_html('error')

	from webnotes.handler import eprint, print_zip
	eprint("Content-Type: text/html")
	print_zip(html)
Ejemplo n.º 4
0
def render(page_name):
	"""render html page"""
	try:
		html = render_page(page_name or "index")
	except PageNotFoundError:
		html = render_page("404")
	except Exception:
		html = render_page('error')
		

	from webnotes.handler import eprint, print_zip
	eprint("Content-Type: text/html; charset: utf-8")
	print_zip(html)
Ejemplo n.º 5
0
	return '-'.join(name.split()[:4])

def render(page_name):
	"""render html page"""
	import webnotes
	try:
		if page_name:
			html = get_html(page_name)
		else:
			html = get_html('index')
	except Exception, e:
		html = get_html('404')

	from webnotes.handler import eprint, print_zip
	eprint("Content-Type: text/html")
	print_zip(html)
	
def get_html(page_name):
	"""get page html"""
	page_name = scrub_page_name(page_name)
	comments = get_comments(page_name)
	
	import website.web_cache
	html = website.web_cache.get_html(page_name, comments)
	return html

def get_comments(page_name):
	import webnotes
	
	if page_name == '404':
		comments = """error: %s""" % webnotes.getTraceback()