Skip to content

Commit 2dfb3b2

Browse files
committed
command line entry point for generating pumla diagrams with a pumla layout enginge creating .svg diagram files.
1 parent f5ba7b4 commit 2dfb3b2

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/pumla/control/cmd_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ def gendiagram(mainpath, inputpuml, outputname, picformat):
4545
print("creating diagram for: " + inputpuml)
4646
print("done.")
4747

48+
def genpumladiag(mainpath, inputpuml, outputname, layoutoverride):
49+
pass
50+
4851
def installPlantUMLJAR(mainpath):
4952
'''downloads the PlantUML JAR file and places it into a pumla command line tool installation directory.'''
5053
print("downloading...")

src/pumla/main.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from pumla.control.cmd_utils import checkElsRelsConsForAliasExistence
2424
from pumla.control.cmd_utils import installPlantUMLJAR
2525
from pumla.control.cmd_utils import gendiagram
26+
from pumla.control.cmd_utils import genpumladiag
2627
from pumla.control.reqparse import updatePUMLAReqRepo
2728

2829
parser = None
@@ -130,6 +131,11 @@ def cmdGenDiagram(args):
130131
pumpath = getPumlaInstallationPath()
131132
gendiagram(pumpath, args.inputfile, ".", args.picformat)
132133

134+
def cmdGenPumlaDiag(args):
135+
identifyMe(parser)
136+
print("Generating a pumla layout diagram .svg file for a pumla diagram file.")
137+
pumpath = getPumlaInstallationPath()
138+
genpumladiag(pumpath, args.inputfile, ".", args.layoutoverride)
133139

134140
def cmdCreateNewPumlaFile(args):
135141
pass
@@ -301,6 +307,22 @@ def main():
301307
)
302308
parser_gendiagram.set_defaults(func=cmdGenDiagram)
303309

310+
parser_genpumladiag = subparsers.add_parser(
311+
"genpumladiag",
312+
help="generates a diagram in .svg file format for the given PlantUML diagram file using the pumla layout engine. "
313+
)
314+
parser_genpumladiag.add_argument(
315+
"inputfile",
316+
help="the pumla diagram file to process."
317+
)
318+
parser_genpumladiag.add_argument(
319+
"layoutoverride",
320+
help="options to override the layout defaults or settings'.",
321+
nargs="?",
322+
default="none",
323+
)
324+
parser_genpumladiag.set_defaults(func=cmdGenPumlaDiag)
325+
304326
parser_setupprj = subparsers.add_parser(
305327
"setupprj",
306328
help="create an environment to use pumla as architecture documentation tool in the current project repository.",

0 commit comments

Comments
 (0)