Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Spot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
117
Issues
117
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Spot
Spot
Commits
7673b4b5
Commit
7673b4b5
authored
Jan 21, 2016
by
Alexandre Duret-Lutz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* python/spot.py: Make it possible to call str('dot') on formula.
parent
ad8b9645
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
python/spot.py
python/spot.py
+6
-4
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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