瀏覽代碼

added page response to server.py requests

version-14
Rushabh Mehta 13 年之前
父節點
當前提交
7c6c2bc2ca
共有 1 個檔案被更改,包括 12 行新增4 行删除
  1. +12
    -4
      py/webnotes/handler.py

+ 12
- 4
py/webnotes/handler.py 查看文件

@@ -188,11 +188,11 @@ def handle():
except:
webnotes.errprint(webnotes.utils.getTraceback())
webnotes.conn and webnotes.conn.rollback()
print_response()

if webnotes.conn:
webnotes.conn.close()
print_response()

def execute_cmd(cmd):
"""execute a request as python module"""
@@ -259,9 +259,17 @@ def print_response():
print_iframe()
elif webnotes.response.get('type')=='download':
print_raw()
elif webnotes.response.get('type')=='page':
print_page()
else:
print_json()

def print_page():
"""print web page"""
from website.utils import render
render(webnotes.response['page_name'])

def print_csv():
print "Content-Type: text/csv"
print "Content-Disposition: attachment; filename="+webnotes.response['doctype'].replace(' ', '_')+".csv"


Loading…
取消
儲存