本文整理汇总了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}