@@ -18,7 +18,7 @@ def add_arguments(self, parser):
1818 "--format" ,
1919 dest = "format" ,
2020 type = str ,
21- choices = ("svg" , "mmd " , "mermaid " ),
21+ choices = ("svg" , "pdf " , "png " ),
2222 default = "svg" ,
2323 help = "Output file format. Default: svg" ,
2424 )
@@ -29,12 +29,19 @@ def add_arguments(self, parser):
2929 type = str ,
3030 help = "Output directory. Default is current working directory." ,
3131 )
32-
32+ parser .add_argument (
33+ "-c" ,
34+ "--cleanup" ,
35+ dest = "cleanup" ,
36+ action = "store_true" ,
37+ help = "Remove dot-files after rendering." ,
38+ )
3339
3440 def handle (self , * args , ** options ):
3541 workflows = options ["workflow" ]
3642 verbosity = options ["verbosity" ]
3743 file_format = options ["format" ]
44+ cleanup = options ["cleanup" ]
3845 directory = options .get ("directory" , None )
3946
4047 workflows = [
@@ -52,7 +59,8 @@ def handle(self, *args, **options):
5259 )
5360 filename = f"{ opt .app_label } _{ workflow .__name__ } " .lower ()
5461 graph = workflow .get_graph ()
55- graph .render (filename = filename , directory = directory , format = file_format )
62+ graph .format = file_format
63+ graph .render (filename = filename , directory = directory , cleanup = cleanup )
5664 if verbosity > 0 :
5765 self .stdout .write ("Done!" , self .style .SUCCESS )
5866 else :
0 commit comments