本文整理匯總了Python中zeobuilder.actions.composed.Parameters.expression方法的典型用法代碼示例。如果您正苦於以下問題:Python Parameters.expression方法的具體用法?Python Parameters.expression怎麽用?Python Parameters.expression使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類zeobuilder.actions.composed.Parameters
的用法示例。
在下文中一共展示了Parameters.expression方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: fn
# 需要導入模塊: from zeobuilder.actions.composed import Parameters [as 別名]
# 或者: from zeobuilder.actions.composed.Parameters import expression [as 別名]
def fn():
FileNew = context.application.plugins.get_action("FileNew")
FileNew()
context.application.main.select_nodes([context.application.model.folder])
AddFolder = context.application.plugins.get_action("AddFolder")
assert AddFolder.analyze_selection()
AddFolder()
context.application.main.select_nodes([context.application.model.folder])
AddNotes = context.application.plugins.get_action("AddNotes")
assert AddNotes.analyze_selection()
AddNotes()
context.application.main.select_nodes([context.application.model.folder])
SelectChildrenByExpression = context.application.plugins.get_action("SelectChildrenByExpression")
parameters = Parameters()
parameters.recursive = SelectChildrenByExpression.SELECT_PLAIN
parameters.expression = Expression("isinstance(node, Folder)")
assert SelectChildrenByExpression.analyze_selection(parameters)
SelectChildrenByExpression(parameters)
assert context.application.model.folder.children[0].selected
assert not context.application.model.folder.children[1].selected
示例2: default_parameters
# 需要導入模塊: from zeobuilder.actions.composed import Parameters [as 別名]
# 或者: from zeobuilder.actions.composed.Parameters import expression [as 別名]
def default_parameters(cls):
result = Parameters()
result.expression = Expression()
result.recursive = cls.SELECT_PLAIN
return result