@defer.inlineCallbacks<EOL><INDENT>def resolve_path( self, path,<EOL>root_id='<STR_LIT:0>', objects=False ):<DEDENT>
if path:<EOL><INDENT>if isinstance(path, types.StringTypes):<EOL><INDENT>path = filter(None, path.split(os.sep))<EOL><DEDENT>if path:<EOL><INDENT>try:<EOL><INDENT>for i, name in enumerate(path):<EOL><INDENT>root_id = dict(it.imap(<EOL>op.itemgetter('<STR_LIT:name>', '<STR_LIT:id>'), (yield self.listdir(root_id)) ))[name]<EOL><DEDENT><DEDENT>except (KeyError, ProtocolError) as err:<EOL><INDENT>if isinstance(err, ProtocolError) and err.code != <NUM_LIT>: raise<EOL>raise DoesNotExists(root_id, path[i:])<EOL><DEDENT><DEDENT><DEDENT>defer.returnValue(root_id if not objects else (yield self.info(root_id)))<EOL>
Return id (or metadata) of an object, specified by chain
                        (iterable or fs-style path string) of "name" attributes of it's ancestors,
                        or raises DoesNotExists error.
                Requires a lot of calls to resolve each name in path, so use with care.
                root_id parameter allows to specify path
                         relative to some folder_id (default: 0).