Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Anand Doshi
2012-08-02 18:53:31 +05:30
24 changed files with 107 additions and 594 deletions

View File

@@ -40,39 +40,8 @@ def init():
def respond():
import webnotes
try:
if 'page' in webnotes.form_dict:
html = get_html(webnotes.form_dict['page'])
else:
# show home page
html = get_html('index')
except Exception, e:
html = get_html('404')
print "Content-Type: text/html"
print
print html.encode('utf-8')
def get_html(page_name):
import website.utils
page_name = website.utils.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()
else:
comments = """page: %s""" % page_name
return comments
return website.utils.render(webnotes.form_dict.get('page'))
if __name__=="__main__":
init()