diff options
| author | Lex Neva <github.com@lexneva.name> | 2019-02-16 16:46:16 -0500 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2019-02-16 16:53:38 -0500 |
| commit | fa3236372bcee28f4aaa78da47b68c5d7f32cca4 (patch) | |
| tree | 88f0e82a8981862b0742e8fb763093414ce2a0c8 | |
| parent | be7d0af82da95d64261351b6281153db1944c0b4 (diff) | |
fix style
| -rw-r--r-- | lib/elements/auto_fill.py | 5 | ||||
| -rw-r--r-- | lib/exceptions.py | 2 | ||||
| -rw-r--r-- | lib/stitches/auto_fill.py | 11 |
3 files changed, 12 insertions, 6 deletions
diff --git a/lib/elements/auto_fill.py b/lib/elements/auto_fill.py index 55292212..b8d8d15f 100644 --- a/lib/elements/auto_fill.py +++ b/lib/elements/auto_fill.py @@ -189,8 +189,9 @@ class AutoFill(Fill): message = "" message += _("Error during autofill! This means that there is a problem with Ink/Stitch.") message += "\n\n" - message += _("If you'd like to help us make Ink/Stitch better, please paste this whole message into a new issue at: https://github.com/inkstitch/inkstitch/issues/new") - message += "\n\n" + # L10N this message is followed by a URL: https://github.com/inkstitch/inkstitch/issues/new + message += _("If you'd like to help us make Ink/Stitch better, please paste this whole message into a new issue at: ") + message += "https://github.com/inkstitch/inkstitch/issues/new\n\n" message += traceback.format_exc() self.fatal(message) diff --git a/lib/exceptions.py b/lib/exceptions.py index 30e595ea..c1ff36f0 100644 --- a/lib/exceptions.py +++ b/lib/exceptions.py @@ -1,2 +1,2 @@ class InkstitchException(Exception): - pass
\ No newline at end of file + pass diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py index 1c0be0a0..0f07b795 100644 --- a/lib/stitches/auto_fill.py +++ b/lib/stitches/auto_fill.py @@ -178,14 +178,19 @@ def build_graph(shape, segments, angle, row_spacing, max_stitch_length): if i % 2 == edge_set: graph.add_edge(node1, node2, key="extra") + check_graph(graph, shape, max_stitch_length) + + return graph + + +def check_graph(graph, shape, max_stitch_length): if networkx.is_empty(graph) or not networkx.is_eulerian(graph): if shape.area < max_stitch_length ** 2: raise InvalidPath(_("This shape is so small that it cannot be filled with rows of stitches. " "It would probably look best as a satin column or running stitch.")) else: - raise InvalidPath(_("Cannot parse shape. This most often happens because your shape is made up of multiple sections that aren't connected.")) - - return graph + raise InvalidPath(_("Cannot parse shape. " + "This most often happens because your shape is made up of multiple sections that aren't connected.")) def node_list_to_edge_list(node_list): |
