本文整理匯總了Python中edge.Edge.initialize方法的典型用法代碼示例。如果您正苦於以下問題:Python Edge.initialize方法的具體用法?Python Edge.initialize怎麽用?Python Edge.initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類edge.Edge
的用法示例。
在下文中一共展示了Edge.initialize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: VDFS
# 需要導入模塊: from edge import Edge [as 別名]
# 或者: from edge.Edge import initialize [as 別名]
#.........這裏部分代碼省略.........
if total == 4:
name = os.path.join(name, field[3])
else:
name = self._check_name(field[-1])
if not name:
self._log('failed to parse, invalid path, path=%s' % str(path))
raise FuseOSError(EINVAL)
if total >= 4:
parent = self._check_name(field[-2])
name = os.path.join(parent, name)
return (obj, uid, name)
def _launch(self, func, **args):
cnt = RETRY_MAX
while cnt >= 0:
try:
ret = func(**args)
if ret:
return ret
except:
pass
cnt -= 1
if cnt >= 0:
time.sleep(RETRY_INTERVAL)
def _init(self, uid, name, mode, vrtx, parent, freq, prof, hndl, filt, disp, typ, timeout):
if prof:
if not typ:
typ = prof.get('type')
elif typ != prof.get('type'):
log_err(self, 'failed to initialize, invalid type, type=%' % str(typ))
raise FuseOSError(EINVAL)
if not typ:
log_err(self, 'failed to initialize, no type, name=%s' % str(name))
raise FuseOSError(EINVAL)
link = mode & MODE_LINK
if link:
mode &= ~MODE_LINK
if mode & MODE_CLONE and not parent:
log_err(self, 'failed to initialize, no parent, name=%s' % str(name))
raise FuseOSError(EINVAL)
if not mode & MODE_VIRT:
timeout = None
if not prof:
if self._shadow:
driver = load_driver(typ)
if not driver:
log_err(self, 'failed to initialize, cannot load driver %s, name=%s' % (typ, str(name)))
raise FuseOSError(EINVAL)
if mode & MODE_CLONE:
mode = driver.get_mode() | MODE_CLONE
else:
mode = driver.get_mode()
freq = driver.get_freq()
prof = driver.get_profile()
else:
prof = {'type':typ}