本文整理匯總了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)