Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
fireundubh committed Jun 13, 2021
2 parents daa688a + 93f2798 commit f76a159
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion pyro/PackageManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,34 @@ def _generate_include_paths(includes_node: etree.ElementBase, root_path: str, zi
if not zip_mode and startswith(search_path, (os.path.sep, os.path.altsep)):
search_path = '**' + search_path

if '\\' in search_path:
search_path = search_path.replace('\\', '/')

# populate files list using glob patterns or relative paths
if '*' in search_path or not os.path.isabs(search_path):
if '*' in search_path:
for include_path in glob.iglob(search_path,
root_dir=root_path,
flags=PackageManager.DEFAULT_GLFLAGS):
yield include_path, attr_path

elif not os.path.isabs(search_path):
test_path = os.path.normpath(os.path.join(root_path, search_path))
if os.path.isfile(test_path):
yield test_path, attr_path
elif os.path.isdir(test_path):
user_flags = wcmatch.RECURSIVE if not attr_no_recurse else 0x0
matcher = wcmatch.WcMatch(test_path, '*.*', flags=wcmatch.IGNORECASE | user_flags)

matcher.on_reset()
matcher._skipped = 0
for f in matcher._walk():
yield f, attr_path
else:
for include_path in glob.iglob(search_path,
root_dir=root_path,
flags=PackageManager.DEFAULT_GLFLAGS):
yield include_path, attr_path

# populate files list using absolute paths
else:
if not zip_mode and root_path not in search_path:
Expand Down

0 comments on commit f76a159

Please sign in to comment.