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


Python Filter.applyFilterOnCase方法代码示例

本文整理汇总了Python中Filter.applyFilterOnCase方法的典型用法代码示例。如果您正苦于以下问题:Python Filter.applyFilterOnCase方法的具体用法?Python Filter.applyFilterOnCase怎么用?Python Filter.applyFilterOnCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Filter的用法示例。


在下文中一共展示了Filter.applyFilterOnCase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1:

# 需要导入模块: import Filter [as 别名]
# 或者: from Filter import applyFilterOnCase [as 别名]
# begining of action section, here are executed all actions
if "addCase" in actions:
    if form.has_key('caseName') and form.has_key('caseDescription'):
        ret = cases.addCase(form['caseName'].value, form['caseDescription'].value)
        message = ret[0]
        messageType = ret[1]
    else:
        message = "<strong>Warning!</strong> Please enter Case Name and Case Description."
        messageType = 'warning'
# when editing filter on case, if filter is empty this action will be skipped
if 'editFilter' in actions:
    filterContent = form['filterContent'].value if form.has_key("filterContent") else ''
    start = form['start'].value if form.has_key('start') else ''
    end = form['end'].value if form.has_key('end') else ''
    if form.has_key("Edit"):
        Filter.applyFilterOnCase(form['caseName'].value, filterContent , mode = "edit", start = start, end = end)
    else:
        Filter.applyFilterOnCase(form['caseName'].value, filterContent, mode = "append", start = start, end = end)
    message = "<strong>Success!</strong> Filter was applied"
    messageType = 'success'

# when applying filter on currently selected file, crete new tmp file
if "applyFilter" in actions:
    start = form['start'].value if form.has_key('start') else ''
    end = form['end'].value if form.has_key('end') else ''
    if form.has_key('filterContent'):
        filteredFileName = Filter.applyTmpFilter(form['filePath'].value, form['filterContent'].value, form['caseName'].value)
        if filteredFileName:
            form['filePath'].value = CASES_DIR + form['caseName'].value + TMP_DIR + filteredFileName
            fileName = filteredFileName
        else:
开发者ID:PanSpagetka,项目名称:BP,代码行数:33,代码来源:main.py


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