def add(self, *args):
added = 0
for pattern in args:
try:
files = self._glob(pattern)
files = self._process_str_paths(files)
except NotImplementedError:
# self._glob says "Non-relative patterns are unsupported"
# Check if it exists and add it
files = Path(pattern)
if files.exists():
files = [files]
else:
files = None
if not files:
# TODO: Proper handling of this?
print('Include pattern did not match:', pattern)
else:
for file in files:
if file not in self._data:
self._data.append(file)
added += 1
return added
评论列表
文章目录