From cdc3b170f352affb6bc32024e34cc07aa11773e5 Mon Sep 17 00:00:00 2001 From: fireundubh Date: Wed, 23 Jun 2021 01:19:42 -0700 Subject: [PATCH] Added Path attribute support to Match nodes --- pyro/PackageManager.py | 2 ++ pyro/PapyrusProject.py | 4 ++-- pyro/PapyrusProject.xsd | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyro/PackageManager.py b/pyro/PackageManager.py index e90b002c..f35f1f2c 100644 --- a/pyro/PackageManager.py +++ b/pyro/PackageManager.py @@ -149,6 +149,7 @@ def _generate_include_paths(includes_node: etree.ElementBase, root_path: str, zi attr_in: str = match_node.get(XmlAttributeName.IN).strip() attr_no_recurse: bool = match_node.get(XmlAttributeName.NO_RECURSE) == 'True' attr_exclude: str = match_node.get(XmlAttributeName.EXCLUDE).strip() + attr_path: str = match_node.get(XmlAttributeName.PATH).strip() in_path: str = os.path.normpath(attr_in) @@ -175,6 +176,7 @@ def _generate_include_paths(includes_node: etree.ElementBase, root_path: str, zi yield from PackageManager._match(in_path, match_text, exclude_pattern=attr_exclude, + user_path=attr_path, no_recurse=attr_no_recurse) def _fix_package_extension(self, package_name: str) -> str: diff --git a/pyro/PapyrusProject.py b/pyro/PapyrusProject.py index d89abbfb..c65c2ae9 100644 --- a/pyro/PapyrusProject.py +++ b/pyro/PapyrusProject.py @@ -333,10 +333,10 @@ def _update_attributes(self, parent_node: etree.ElementBase) -> None: elif tag in (XmlTagName.FOLDER, XmlTagName.INCLUDE, XmlTagName.MATCH): if XmlAttributeName.NO_RECURSE not in node.attrib: node.set(XmlAttributeName.NO_RECURSE, 'False') - if tag == XmlTagName.INCLUDE: + if tag in (XmlTagName.INCLUDE, XmlTagName.MATCH): if XmlAttributeName.PATH not in node.attrib: node.set(XmlAttributeName.PATH, '') - elif tag == XmlTagName.MATCH: + if tag == XmlTagName.MATCH: if XmlAttributeName.IN not in node.attrib: node.set(XmlAttributeName.IN, os.curdir) if XmlAttributeName.EXCLUDE not in node.attrib: diff --git a/pyro/PapyrusProject.xsd b/pyro/PapyrusProject.xsd index 93a2f334..3b123853 100644 --- a/pyro/PapyrusProject.xsd +++ b/pyro/PapyrusProject.xsd @@ -103,6 +103,7 @@ +