Modify

Opened 15 months ago

#14244 new enhancement

Support for MSCGEN

Reported by: anonymous Owned by: Christian Boos
Priority: normal Component: GraphvizPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

The diff below adds support for generating message seq charts using mscgen (https://www.mcternan.me.uk/mscgen/), would be great if this could be included in the trunk.

diff --git a/graphvizplugin/graphviz/graphviz.py b/graphvizplugin/graphviz/graphviz.py
index c545e2f..a5a4b5b 100644
--- a/graphvizplugin/graphviz/graphviz.py
+++ b/graphvizplugin/graphviz/graphviz.py
@@ -90,7 +90,7 @@ class Graphviz(Component):
     implements(IWikiMacroProvider, IHTMLPreviewRenderer, IRequestHandler)
 
     # Available formats and processors, default first (dot/png)
-    Processors = ['dot', 'neato', 'twopi', 'circo', 'fdp']
+    Processors = ['dot', 'neato', 'twopi', 'circo', 'fdp', 'mscgen']
     Bitmap_Formats = ['png', 'jpg', 'gif']
     Vector_Formats = ['svg', 'svgz']
     Formats = Bitmap_Formats + Vector_Formats
@@ -583,6 +583,8 @@ class Graphviz(Component):
         # Note: subprocess.Popen doesn't support unicode options arguments
         # (http://bugs.python.org/issue1759845) so we have to encode them.
         # Anyway, dot expects utf-8 or the encoding specified with -Gcharset.
+        if args[0].endswith('mscgen'):
+            args = tuple([x for x in args if not x.startswith('-G')])
         encoded_cmd = self._launch_args(args)
         with Popen(encoded_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Christian Boos.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.