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()
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"), })
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