stoichiograph

Spell words with elemental symbols from the periodic table.
git clone git://git.amin.space/stoichiograph.git
Log | Files | Refs | LICENSE

commit fc0bb55e80b07130fc9aa4062d473e5819810b72
parent 1af16660cb3e382227f3abcdec6796a0b9fe8bf4
Author: amin <dev@aminmesbah.com>
Date:   Sun, 26 Feb 2017 07:11:10 +0000

Fix linter problem with multiline string.

FossilOrigin-Name: 8c4aa242b5a7fdd218dd113ffe0faf2723b5043935987d46642940990ce8faab
Diffstat:
Mspeller.py | 8++++----
Mtests.py | 36++++++++++++++++++------------------
2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/speller.py b/speller.py @@ -113,8 +113,8 @@ class Graph(): """ export = StringIO() export.write('digraph G {\n') - export.write('\tgraph [rankdir=LR];\n') - export.write('\tnode [width=0.75 shape=circle];\n') + export.write(' graph [rankdir=LR];\n') + export.write(' node [width=0.75 shape=circle];\n') edges = [ (p, c) @@ -122,10 +122,10 @@ class Graph(): if p is not None and c is not None ] for parent, child in sorted(edges): - export.write('\t"{}" -> "{}";\n'.format(parent, child)) + export.write(' "{}" -> "{}";\n'.format(parent, child)) for node in sorted(self.nodes(connected_only=connected_only)): - export.write('\t"{}" [label="{}"];\n'.format(node, node.value.capitalize())) + export.write(' "{}" [label="{}"];\n'.format(node, node.value.capitalize())) export.write('}') return export.getvalue() diff --git a/tests.py b/tests.py @@ -187,23 +187,23 @@ class TestGraph: def test_export(self, test_graph): """Assert that the graph exports the proper dot code.""" assert test_graph.export() == ( -"""digraph G { - graph [rankdir=LR]; - node [width=0.75 shape=circle]; - "Node(value='au', position=3)" -> "Node(value='s', position=5)"; - "Node(value='au', position=3)" -> "Node(value='se', position=5)"; - "Node(value='be', position=0)" -> "Node(value='c', position=2)"; - "Node(value='be', position=0)" -> "Node(value='ca', position=2)"; - "Node(value='c', position=2)" -> "Node(value='au', position=3)"; - "Node(value='ca', position=2)" -> "Node(value='u', position=4)"; - "Node(value='u', position=4)" -> "Node(value='s', position=5)"; - "Node(value='u', position=4)" -> "Node(value='se', position=5)"; - "Node(value='au', position=3)" [label="Au"]; - "Node(value='be', position=0)" [label="Be"]; - "Node(value='c', position=2)" [label="C"]; - "Node(value='ca', position=2)" [label="Ca"]; - "Node(value='s', position=5)" [label="S"]; - "Node(value='se', position=5)" [label="Se"]; - "Node(value='u', position=4)" [label="U"]; + """digraph G { + graph [rankdir=LR]; + node [width=0.75 shape=circle]; + "Node(value='au', position=3)" -> "Node(value='s', position=5)"; + "Node(value='au', position=3)" -> "Node(value='se', position=5)"; + "Node(value='be', position=0)" -> "Node(value='c', position=2)"; + "Node(value='be', position=0)" -> "Node(value='ca', position=2)"; + "Node(value='c', position=2)" -> "Node(value='au', position=3)"; + "Node(value='ca', position=2)" -> "Node(value='u', position=4)"; + "Node(value='u', position=4)" -> "Node(value='s', position=5)"; + "Node(value='u', position=4)" -> "Node(value='se', position=5)"; + "Node(value='au', position=3)" [label="Au"]; + "Node(value='be', position=0)" [label="Be"]; + "Node(value='c', position=2)" [label="C"]; + "Node(value='ca', position=2)" [label="Ca"]; + "Node(value='s', position=5)" [label="S"]; + "Node(value='se', position=5)" [label="Se"]; + "Node(value='u', position=4)" [label="U"]; }""" )