当前位置: 首页>>代码示例>>Python>>正文


Python View.output方法代码示例

本文整理汇总了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()
开发者ID:cernvm,项目名称:cernvm-appliance-agent,代码行数:9,代码来源:index.py

示例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()
开发者ID:Hunterbond,项目名称:pi-web-agent,代码行数:11,代码来源:error_page.py

示例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()
开发者ID:koullislp,项目名称:pi-web-agent,代码行数:13,代码来源:index.py

示例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()
开发者ID:cernvm,项目名称:cernvm-appliance-agent,代码行数:14,代码来源:update.py

示例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()
开发者ID:Hunterbond,项目名称:pi-web-agent,代码行数:14,代码来源:error_timeout.py

示例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()
开发者ID:cernvm,项目名称:cernvm-appliance-agent,代码行数:22,代码来源:main.py

示例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()
开发者ID:cernvm,项目名称:cernvm-appliance-agent,代码行数:18,代码来源:change_password.py

示例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()
开发者ID:IliEle,项目名称:pi-web-agent,代码行数:23,代码来源:enable_api.py


注:本文中的view.View.output方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。