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