Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BOURNEUF Lucas
biseau
Commits
b14b2137
Commit
b14b2137
authored
Oct 29, 2019
by
Aluriak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more stripping in properties
parent
a039059f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
biseau/asp_to_dot.py
biseau/asp_to_dot.py
+3
-3
No files found.
biseau/asp_to_dot.py
View file @
b14b2137
...
...
@@ -72,7 +72,7 @@ def visual_config_from_atoms(atoms:dict, base_atoms:dict,
def
get_uid_from_atom
(
atom
:
str
or
tuple
):
if
isinstance
(
atom
,
str
):
return
atom
return
atom
.
strip
(
'"'
)
elif
isinstance
(
atom
,
tuple
):
if
len
(
atom
)
==
2
:
# a regular atom
if
len
(
atom
[
1
])
==
0
:
...
...
@@ -138,11 +138,11 @@ def visual_config_from_atoms(atoms:dict, base_atoms:dict,
if
len
(
colored
)
==
2
:
# node
node
,
color
=
colored
node
=
get_uid_from_atom
(
node
)
properties
[
node
][
'fillcolor'
].
add
(
color
)
properties
[
node
][
'fillcolor'
].
add
(
color
.
strip
(
'"'
)
)
elif
len
(
colored
)
==
3
:
# edge
src
,
trg
,
color
=
colored
src
,
trg
=
map
(
get_uid_from_atom
,
(
src
,
trg
))
properties
[
src
,
trg
][
'color'
].
add
(
color
)
# fillcolor do not exists for edges
properties
[
src
,
trg
][
'color'
].
add
(
color
.
strip
(
'"'
)
)
# fillcolor do not exists for edges
for
shaped
in
get_atoms_of_predicate
(
'shape'
):
if
len
(
shaped
)
==
2
:
# node
node
,
shape
=
shaped
...
...
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