本文整理汇总了Python中Shared.DC.Scripts.Script.Script类的典型用法代码示例。如果您正苦于以下问题:Python Script类的具体用法?Python Script怎么用?Python Script使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Script类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __setstate__
def __setstate__(self, state):
Script.__setstate__(self, state)
if (getattr(self, 'Python_magic', None) != Python_magic or
getattr(self, 'Script_magic', None) != Script_magic):
global _log_complaint
if _log_complaint:
LOG.info(_log_complaint)
_log_complaint = 0
# Changes here won't get saved, unless this Script is edited.
body = self._body.rstrip()
if body:
self._body = body + '\n'
self._compile()
self._v_change = 1
elif self._code is None:
self._v_ft = None
else:
self._newfun(marshal.loads(self._code))
示例2: __call__
def __call__(self, *args, **kw):
'''Calls the script.'''
self._updateFromFS()
return Script.__call__(self, *args, **kw)
示例3: __render_with_namespace__
def __render_with_namespace__(self, namespace):
'''Calls the script.'''
self._updateFromFS()
return Script.__render_with_namespace__(self, namespace)
示例4: __call__
def __call__(self, *args, **kw):
"""Calls the script."""
self._updateFromFS()
return Script.__call__(self, *args, **kw)