-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding --uml-no-inline-groupings-from #872
Open
kirankotari
wants to merge
8
commits into
mbj4668:master
Choose a base branch
from
kirankotari:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8dc80f7
adding --uml-skip-module, --uml-add-legend
kirankotari a58f297
Update pyang/plugins/uml.py
kirankotari ae249d6
Update pyang/plugins/uml.py
kirankotari 23f5bc4
Update pyang/plugins/uml.py
kirankotari 0d27a44
opt reformated
kirankotari d98c82b
pull out legend
kirankotari 1e73120
mobing options to right place
kirankotari 1e5e94d
uml options update
kirankotari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,11 @@ def add_opts(self, optparser): | |
dest="uml_inline", | ||
default =False, | ||
help="Inline groupings where they are used."), | ||
optparse.make_option("--uml-no-inline-groupings-from", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although suggested by myself, I am not totally convinced by this name. |
||
dest="uml_no_inline_groupings_from", | ||
action="append", | ||
default=[], | ||
help="Skips given modules from inline groupings. \nExample --uml-no-inline-groupings-from=ietf-yang-push"), | ||
optparse.make_option("--uml-inline-augments", | ||
action="store_true", | ||
dest="uml_inline_augments", | ||
|
@@ -188,6 +193,7 @@ def __init__(self, ctx): | |
self.ctx_title = ctx.opts.uml_title | ||
|
||
self.ctx_inline_augments = ctx.opts.uml_inline_augments | ||
self.ctx_no_inline_groupings_from = set(ctx.opts.uml_no_inline_groupings_from) | ||
|
||
no = ctx.opts.uml_no.split(",") | ||
self.ctx_leafrefs = not "leafref" in no | ||
|
@@ -255,6 +261,7 @@ def emit(self, modules, fd): | |
|
||
if not self.ctx_filterfile: | ||
self.post_process_module(module, fd) | ||
|
||
if not self.ctx_filterfile: | ||
self.post_process_diagram(fd) | ||
|
||
|
@@ -413,6 +420,11 @@ def emit_child_stmt(self, parent, node, fd, cont = True): | |
if hasattr(node, 'i_grouping') and (self._ctx.opts.uml_inline) and cont: | ||
grouping_node = node.i_grouping | ||
if grouping_node is not None: | ||
# skip grouping modules if given | ||
module = str(grouping_node.main_module()).split()[-1] | ||
if module in self.ctx_no_inline_groupings_from: | ||
fd.write('%s : %s {uses} \n' %(self.full_path(parent), node.arg)) | ||
return | ||
# inline grouping here | ||
# sys.stderr.write('Found target grouping to inline %s %s \n' %(grouping_node.keyword, grouping_node.arg)) | ||
for children in grouping_node.substmts: | ||
|
@@ -591,8 +603,6 @@ def emit_module_header(self, module, fd): | |
def emit_module_class(self, module, fd): | ||
fd.write('class \"%s\" as %s << (M, #33CCFF) module>> \n' %(self.full_display_path(module), self.full_path(module))) | ||
|
||
|
||
|
||
def emit_uml_footer(self, module, fd): | ||
if self._ctx.opts.uml_footer is not None: | ||
fd.write('center footer\n <size:24> %s </size>\n endfooter \n' %self._ctx.opts.uml_footer) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a note could be added to this text to indicate that groupings from specific modules can be omitted from this option through use of the --uml-no-inline-groupings-from option.