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


Python Filter.applyTmpFilter方法代码示例

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


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

示例1:

# 需要导入模块: import Filter [as 别名]
# 或者: from Filter import applyTmpFilter [as 别名]
    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:
            pagesToRender.remove(renderGraph)
            message = "<strong>Error!</strong> Rendering graph Error, make sure you use right filter syntax."
            messageType = "error"
    if start and end:
        ret = Filter.applyTimeFilterOnFile(form['filePath'].value, caseName, start, end, override = False)
        form['filePath'].value = ret


if "uploadFile" in actions:
    if form.has_key('caseName') and form.has_key('uploadFileItem'):
        ret = saveFile.saveFile(form['caseName'].value, form['uploadFileItem'])
开发者ID:PanSpagetka,项目名称:BP,代码行数:33,代码来源:main.py


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