Squashed 'SpiffWorkflow/' changes from 3579c477e..2d3bd0085

2d3bd0085 Merge pull request #261 from sartography/feature/xml-validation
a67abd453 Merge pull request #260 from sartography/feature/add_init_to_schema
905c1265d remove debug code w/ burnettk
8daf322da attempt using package data w/ burnettk
7f7c0c10b add an init file to schema directory to see if it can be picked up as a package w/ burnettk
abb2898b1 cleaning up code smell

git-subtree-dir: SpiffWorkflow
git-subtree-split: 2d3bd00854ab483e823c4b386430abc9267f536b
This commit is contained in:
burnettk 2022-10-27 15:15:03 -04:00
parent 7184b165bb
commit f82f4c2582
3 changed files with 6 additions and 4 deletions

View File

@ -25,7 +25,7 @@ class NodeParser:
def xpath(self, xpath, extra_ns=None): def xpath(self, xpath, extra_ns=None):
return self._xpath(self.node, xpath, extra_ns) return self._xpath(self.node, xpath, extra_ns)
def doc_xpath(self, xpath, extra_ns=None): def doc_xpath(self, xpath, extra_ns=None):
root = self.node.getroottree().getroot() root = self.node.getroottree().getroot()
return self._xpath(root, xpath, extra_ns) return self._xpath(root, xpath, extra_ns)
@ -62,8 +62,8 @@ class NodeParser:
extensions = {} extensions = {}
extra_ns = {'camunda': CAMUNDA_MODEL_NS} extra_ns = {'camunda': CAMUNDA_MODEL_NS}
extension_nodes = self.xpath('.//bpmn:extensionElements/camunda:properties/camunda:property', extra_ns) extension_nodes = self.xpath('.//bpmn:extensionElements/camunda:properties/camunda:property', extra_ns)
for node in extension_nodes: for ex_node in extension_nodes:
extensions[node.get('name')] = node.get('value') extensions[ex_node.get('name')] = ex_node.get('value')
return extensions return extensions
def _get_lane(self): def _get_lane(self):
@ -82,4 +82,4 @@ class NodeParser:
nsmap.update(extra_ns) nsmap.update(extra_ns)
else: else:
nsmap = self.nsmap nsmap = self.nsmap
return node.xpath(xpath, namespaces=nsmap) return node.xpath(xpath, namespaces=nsmap)

View File

@ -0,0 +1 @@
"""__init.py__"""

View File

@ -21,6 +21,7 @@ setup(name='SpiffWorkflow',
author_email='dan@sartography.com', author_email='dan@sartography.com',
license='lGPLv2', license='lGPLv2',
packages=find_packages(exclude=['tests', 'tests.*']), packages=find_packages(exclude=['tests', 'tests.*']),
package_data={'SpiffWorkflow.bpmn.parser.schema': ['*.xsd']},
install_requires=['configparser', 'lxml', 'celery', 'dateparser', 'pytz', install_requires=['configparser', 'lxml', 'celery', 'dateparser', 'pytz',
# required for python 3.7 - https://stackoverflow.com/a/73932581 # required for python 3.7 - https://stackoverflow.com/a/73932581
'importlib-metadata<5.0; python_version <= "3.7"'], 'importlib-metadata<5.0; python_version <= "3.7"'],