def consider_single_directory(self, directory, item):
"""Searches for ``item`` within ``directory``. Is able to
resolve glob instructions.
Subclasses can call this when they have narrowed done the
location of a bundle item to a single directory.
"""
expr = path.join(directory, item)
if has_magic(expr):
# Note: No error if glob returns an empty list
return self.glob(directory, item)
else:
if path.exists(expr):
return expr
raise IOError("'%s' does not exist" % expr)
评论列表
文章目录