Skip to content
Snippets Groups Projects

F refactor high level api

Merged Alexander Schlemmer requested to merge f-refactor-high-level-api into dev
3 unresolved threads
5 files
+ 54
50
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -168,8 +168,6 @@ hide circle\n
else:
raise ValueError("Unknown style.")
if add_properties:
result += "package Properties #DDDDDD {\n"
for p in properties:
@@ -293,7 +291,7 @@ def retrieve_substructure(start_record_types, depth, result_id_set=None, result_
if is_reference(prop.datatype) and prop.datatype != db.FILE and depth > 0:
rt = db.RecordType(name=get_referenced_recordtype(prop.datatype)).retrieve()
retrieve_substructure([rt], depth-1, result_id_set, result_container, False)
# TODO: clean up this hack
# TODO: make it also work for files
if is_reference(prop.datatype) and prop.value is not None:
@@ -358,13 +356,13 @@ def to_graphics(recordtypes: list[db.Entity], filename: str,
if output_dirname is None:
output_dirname = os.getcwd()
allowed_formats = [
"tpng", "tsvg", "teps", "tpdf", "tvdx", "txmi",
"tscxml", "thtml", "ttxt", "tutxt", "tlatex", "tlatex:nopreamble"]
with tempfile.TemporaryDirectory() as td:
pu_filename = os.path.join(td, filename + ".pu")
with open(pu_filename, "w") as pu_file:
pu_file.write(pu)
@@ -373,7 +371,7 @@ def to_graphics(recordtypes: list[db.Entity], filename: str,
extension = format[1:]
if ":" in extension:
extension = extension[:extension.index(":")]
if format not in allowed_formats:
raise RuntimeError("Format not allowed.")
cmd = "plantuml -{} {}".format(format, pu_filename)
Loading