本文整理汇总了Python中view.View.output方法的典型用法代码示例。如果您正苦于以下问题:Python View.output方法的具体用法?Python View.output怎么用?Python View.output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view.View
的用法示例。
在下文中一共展示了View.output方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import output [as 别名]
def main():
if password_changed():
config = Configuration()
indexView=View(config.system.actions)
indexView.output()
else:
redirect()
示例2: main
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import output [as 别名]
def main():
'''
generates an error page
'''
config=Configuration()
fs=cgi.FieldStorage()
view = View(config.system.actions)
view.setContent('Page not found', 'The requested page was not found. Did you type the url manually?')
view.output()
示例3: main
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import output [as 别名]
def main():
if password_changed():
config = Configuration()
view = View(config.system.actions)
main_view_file = open(MAIN_VIEW)
content = main_view_file.read()
main_view_file.close()
view.setContent("Welcome", content)
view.output()
else:
redirect()
示例4: main
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import output [as 别名]
def main():
form = cgi.FieldStorage()
config=Configuration()
updMgr = UpdateManager()
view = View(config.system.actions)
if 'action' in form:
if form['action'] == 'update':
view.setContent('Update Manager', updMgr.doTransaction())
else:
view.setContent('Update Manager', updMgr.getDefaultView())
view.output()
示例5: main
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import output [as 别名]
def main():
'''
generates an error page
'''
config=Configuration()
fs=cgi.FieldStorage()
view = View(config.system.actions)
view.setContent('Timeout error',
'We are sorry that a timeout occured. '+\
'We probably know that this task takes time and ' +\
'we are working to fix it!')
view.output()
示例6: main
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import output [as 别名]
def main():
'''
gets the ID from the url as key/value=page/action_id
and through the adapter displays the result of
the action with ID=action_id. This functionality composed
with the GenericAdapter help in the portability and API design
as importing new functions depends now solely on the xml
'''
config=Configuration()
fs=cgi.FieldStorage()
ID=fs["page"].value
view = View(config.system.actions)
try:
action=config.system.actions[ID]
except KeyError as ke:
view.setContent('Page not found', 'The requested page was not found. Did you type the url manually?')
view.output()
return
adapter=GenericAdapter(ID, view, action.command_groups)
adapter.page()
示例7: main
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import output [as 别名]
def main():
form = cgi.FieldStorage()
config=Configuration()
view = View(config.system.actions)
if "passwd" not in form and "passwd_new1" not in form and "passwd_new2" not in form:
view.setContent('User management', getView())
view.output()
else:
pm = PasswordManager(form, 'admin')
try:
pm.doTransaction()
view.setContent("User management", getSuccessView())
view.output()
except Exception as e:
view.setContent("User management", getFailedView(e.strerror))
view.output()
示例8: main
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import output [as 别名]
def main():
form = cgi.FieldStorage()
config=Configuration()
view = View(config.system.actions)
apiMgr = APIManager()
if 'content-length' not in form.headers:
view.setContent('API management', apiMgr.getDefaultView())
view.output()
else:
if form.getvalue('api_enable_disable'):
apiMgr.generateApiKey()
view.setContent("API management", apiMgr.getAppliedView())
view.output()
else:
try:
apiMgr.disableApi()
except IOError:
pass
view.setContent("API management", apiMgr.getDisabledView())
view.output()