Refactored the plantuml module
Summary
Two main things were refactored:
- The recordtypes to plantuml function allows for more customizations, e.g. leaving out the legend and others.
- The to_graphics function uses a temporary directory for generating the files and furthermore is able to output customized formats.
Focus
The changes in recordtypes to plantuml are self-explanatory. The function to_graphics should be most intensively reviewed and tested (manually).
Test Environment
See the attached files which show an example script and example output for the demo instance that can be used for testing.
Check List for the Author
Please, prepare your MR for a review. Be sure to write a summary and a focus and create gitlab comments for the reviewer. They should guide the reviewer through the changes, explain your changes and also point out open questions. For further good practices have a look at our review guidelines
-
All automated tests pass -
Reference related issues -
Up-to-date CHANGELOG.md (or not necessary) -
Annotations in code (Gitlab comments) - Intent of new code
- Problems with old code
- Why this implementation?
Check List for the Reviewer
-
I understand the intent of this MR -
All automated tests pass -
Up-to-date CHANGELOG.md (or not necessary) -
The test environment setup works and the intended behavior is reproducible in the test environment -
In-code documentation and comments are up-to-date. -
Check: Are there specifications? Are they satisfied?
For further good practices have a look at our review guidelines.
Merge request reports
Activity
assigned to @salexan
301 with open(pu_filename, "w") as pu_file: 302 pu_file.write(pu) 303 304 cmd = "plantuml -tsvg %s" % pu_filename 305 print("Executing:", cmd) 306 307 if os.system(cmd) != 0: 308 raise Exception("An error occured during the execution of plantuml. " 309 "Is plantuml installed?") 353 pu = recordtypes_to_plantuml_string(recordtypes, 354 add_properties, 355 add_recordtypes, 356 add_legend, 357 style) 358 359 if output_dirname is None: 304 cmd = "plantuml -tsvg %s" % pu_filename 305 print("Executing:", cmd) 306 307 if os.system(cmd) != 0: 308 raise Exception("An error occured during the execution of plantuml. " 309 "Is plantuml installed?") 353 pu = recordtypes_to_plantuml_string(recordtypes, 354 add_properties, 355 add_recordtypes, 356 add_legend, 357 style) 358 359 if output_dirname is None: 360 output_dirname = os.getcwd() 361 362 allowed_formats = [ 263 293 if is_reference(prop.datatype) and prop.datatype != db.FILE and depth > 0: 264 294 rt = db.RecordType(name=get_referenced_recordtype(prop.datatype)).retrieve() 265 295 retrieve_substructure([rt], depth-1, result_id_set, result_container, False) 296 297 # TODO: clean up this hack 298 # TODO: make it also work for files 299 if is_reference(prop.datatype) and prop.value is not None: changed this line in version 5 of the diff
mentioned in issue #101 (closed)
mentioned in issue #108 (closed)
added 1 commit
- 3a76adea - MAINT: removed a hack that was accidentally introduced in retrieve_substructure function
added 60 commits
-
3a76adea...694f981c - 59 commits from branch
dev
- 25402474 - Merge branch 'dev' into f-refactor-plantuml
-
3a76adea...694f981c - 59 commits from branch
enabled an automatic merge when the pipeline for 1b8d53ec succeeds
mentioned in commit 0cd4df88