Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
7673b4b5
Commit
7673b4b5
authored
Jan 21, 2016
by
Alexandre Duret-Lutz
Browse files
* python/spot.py: Make it possible to call str('dot') on formula.
parent
ad8b9645
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/spot.py
View file @
7673b4b5
# -*- coding: utf-8 -*-
# Copyright (C) 2014, 2015 Laboratoire de
# Copyright (C) 2014, 2015
, 2016
Laboratoire de
# Recherche et Développement de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
...
...
@@ -188,9 +188,7 @@ class formula:
# can still be used outside of IPython if IPython is not
# installed.
from
IPython.display
import
SVG
ostr
=
ostringstream
()
print_dot_psl
(
ostr
,
self
)
return
SVG
(
_ostream_to_svg
(
ostr
))
return
SVG
(
_str_to_svg
(
self
.
to_str
(
'd'
)))
def
to_str
(
self
,
format
=
'spot'
,
parenth
=
False
):
if
format
==
'spot'
or
format
==
'f'
:
...
...
@@ -207,6 +205,10 @@ class formula:
return
str_latex_psl
(
self
,
parenth
)
elif
format
==
'sclatex'
or
format
==
'X'
:
return
str_sclatex_psl
(
self
,
parenth
)
elif
format
==
'dot'
or
format
==
'd'
:
ostr
=
ostringstream
()
print_dot_psl
(
ostr
,
self
)
return
ostr
.
str
().
encode
(
'utf-8'
)
else
:
raise
ValueError
(
"unknown string format: "
+
format
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment