本文整理汇总了Python中system.System.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Python System.getInstance方法的具体用法?Python System.getInstance怎么用?Python System.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system.System
的用法示例。
在下文中一共展示了System.getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from system import System [as 别名]
# 或者: from system.System import getInstance [as 别名]
def main():
# initialize system
system = System.getInstance()
# parse commandline
options = parseCommandLine()
if options is None:
sys.exit(1)
# initialize and run PyNode
node = PyNode(options)
node.run()
示例2: reset
# 需要导入模块: from system import System [as 别名]
# 或者: from system.System import getInstance [as 别名]
def reset(self):
self.system = System.getInstance()
self.config = AttributeDict()
self.resources = [ ]
self.delayedActions = set()
now = datetime.now()
self.updateConfig({
'date': now,
'pynode.version': version(),
'pynode.longVersion': longVersion(),
'pynode.backup.path': '/tmp/pynode/backup',
'pynode.backup.prefix': now.strftime("%Y%m%d%H%M%S"),
})
示例3: meta
# 需要导入模块: from system import System [as 别名]
# 或者: from system.System import getInstance [as 别名]
def meta(self):
if self._meta is None:
metapath = os.path.join(self.path, "__init__.py")
meta = {'system': System.getInstance()}
if os.path.exists(metapath):
with open(metapath, "rb") as fp:
source = fp.read()
exec compile(source, metapath, "exec") in meta
else:
meta['__config__'] = { }
meta['__loader__'] = { }
self._meta = meta
return self._meta