當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。