6 WSD_URL =
'http://www.websequencediagrams.com/' 10 request[
"message"] = text
11 request[
"style"] = style
12 request[
"apiVersion"] =
"1" 14 r = requests.post(WSD_URL, data=request)
16 if 'img' not in response:
17 print(
"Invalid response from server.")
20 with open(out_fn,
'w')
as f:
22 r = requests.get(WSD_URL + response[
'img'])
26 if __name__ ==
'__main__':
27 current_directory = os.path.abspath(os.path.dirname(__file__))
28 for fn
in os.listdir(current_directory):
29 base, ext = os.path.splitext(fn)
32 text = open(os.path.join(current_directory, fn)).read()
33 out_fn = os.path.join(current_directory, base +
'.png')
def getSequenceDiagram(text, out_fn, style='modern-blue')