From 48ded1101433803f5d415759fa78bbd7a13df17c Mon Sep 17 00:00:00 2001 From: Nick Hancock Date: Fri, 8 Mar 2024 10:22:15 +0100 Subject: [PATCH 1/3] Initial fix --- pyang/plugins/uml.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyang/plugins/uml.py b/pyang/plugins/uml.py index f7f3beaa..44fc23dd 100644 --- a/pyang/plugins/uml.py +++ b/pyang/plugins/uml.py @@ -422,6 +422,9 @@ def emit_stmt(self, mod, stmt, fd): elif stmt.keyword == 'grouping' and not self._ctx.opts.uml_inline: self.emit_grouping(mod, stmt, fd, True) + elif stmt.keyword == 'uses': + self.emit_child_stmt(mod, stmt, fd) + elif stmt.keyword == 'choice': if not self.ctx_filterfile: fd.write('class \"%s\" as %s <> \n' % (self.full_display_path(stmt), self.full_path(stmt))) From 53c00e602b2baeb8417688b4dedb0a0ee6303076 Mon Sep 17 00:00:00 2001 From: Nick Hancock Date: Mon, 11 Mar 2024 17:02:01 +0100 Subject: [PATCH 2/3] Fix uses attributes not being suppressed when using --uml-classes-only --- pyang/plugins/uml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyang/plugins/uml.py b/pyang/plugins/uml.py index 44fc23dd..1e001e35 100644 --- a/pyang/plugins/uml.py +++ b/pyang/plugins/uml.py @@ -515,7 +515,7 @@ def emit_child_stmt(self, parent, node, fd, cont = True): for children in node.substmts: self.emit_child_stmt(node, children, fd) elif node.keyword == 'uses': - if not self.ctx_filterfile and not self._ctx.opts.uml_inline: + if not self.ctx_filterfile and not self._ctx.opts.uml_inline and not self.ctx_classesonly: fd.write('%s : %s {uses} \n' %(self.full_path(parent), node.arg)) if not self._ctx.opts.uml_inline: self.emit_uses(parent, node) From 9394d330a990ad774908a05a4b9896104ff60c79 Mon Sep 17 00:00:00 2001 From: Nick Hancock Date: Tue, 12 Mar 2024 10:07:04 +0100 Subject: [PATCH 3/3] Revert fix for classesonly This fix to be made in a separate pull request --- pyang/plugins/uml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyang/plugins/uml.py b/pyang/plugins/uml.py index 1e001e35..44fc23dd 100644 --- a/pyang/plugins/uml.py +++ b/pyang/plugins/uml.py @@ -515,7 +515,7 @@ def emit_child_stmt(self, parent, node, fd, cont = True): for children in node.substmts: self.emit_child_stmt(node, children, fd) elif node.keyword == 'uses': - if not self.ctx_filterfile and not self._ctx.opts.uml_inline and not self.ctx_classesonly: + if not self.ctx_filterfile and not self._ctx.opts.uml_inline: fd.write('%s : %s {uses} \n' %(self.full_path(parent), node.arg)) if not self._ctx.opts.uml_inline: self.emit_uses(parent, node)