本文整理汇总了Python中myclips.functions.Function.Function.resolve方法的典型用法代码示例。如果您正苦于以下问题:Python Function.resolve方法的具体用法?Python Function.resolve怎么用?Python Function.resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myclips.functions.Function.Function
的用法示例。
在下文中一共展示了Function.resolve方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do
# 需要导入模块: from myclips.functions.Function import Function [as 别名]
# 或者: from myclips.functions.Function.Function import resolve [as 别名]
def do(self, funcEnv, resourceId, *args, **kargs):
"""
Retract function handler implementation
"""
# convert <TYPE:value> to python value
resourceId = Function.resolve(self, funcEnv, self.semplify(funcEnv, resourceId, types.Symbol, ("1", "symbol")))
if resourceId != "nil":
try:
resource = funcEnv.RESOURCES[resourceId]
except KeyError:
raise InvalidArgValueError("Resource with logical name %s cannot be found"%str(resourceId))
else:
# for fragment in args:
#
# # revolve variables and function calls
# fragment = self.resolve(funcEnv, self.semplify(funcEnv, fragment))
#
# resource.write(str(fragment))
resource.write("".join([str(self.resolve(funcEnv, self.semplify(funcEnv, x))) for x in args]))
return types.NullValue()
示例2: resolve
# 需要导入模块: from myclips.functions.Function import Function [as 别名]
# 或者: from myclips.functions.Function.Function import resolve [as 别名]
def resolve(self, funcEnv, arg):
"""
Override Function.resolve to manage the <Symbol:crlf> conversion to NEWLINE
and to remove quotes in types.String values
"""
if isinstance(arg, types.Symbol) and arg.pyEqual("crlf"):
return "\n"
else:
return Function.resolve(self, funcEnv, arg)