krebsdance: make flake8 happy
This commit is contained in:
parent
63bccf2200
commit
d8b64c4f13
@ -1,5 +1,5 @@
|
|||||||
{ writers }:
|
{ writers }:
|
||||||
writers.writePython3Bin "krebsdance" {} ''
|
writers.writePython3Bin "krebsdance" { flakeIgnore = [ "E501" ]; } ''
|
||||||
import argparse
|
import argparse
|
||||||
import random
|
import random
|
||||||
import itertools
|
import itertools
|
||||||
@ -80,12 +80,16 @@ writers.writePython3Bin "krebsdance" {} ''
|
|||||||
yield f'{claw["up"]} {body["left"]}{eye}{mouth}{eye}{body["right"]} {claw["up"]}'
|
yield f'{claw["up"]} {body["left"]}{eye}{mouth}{eye}{body["right"]} {claw["up"]}'
|
||||||
|
|
||||||
|
|
||||||
|
def escape_graph(text):
|
||||||
|
return text.replace("\\", "\\\\")
|
||||||
|
|
||||||
|
|
||||||
def krebs_graph() -> str:
|
def krebs_graph() -> str:
|
||||||
return "\n".join(
|
return "\n".join(itertools.chain(
|
||||||
["digraph {"]
|
["digraph {"],
|
||||||
+ [f'"{krebs}"->"{generate(seed=krebs)}"' for krebs in all_krebses()]
|
[escape_graph(f'"{krebs}"->"{generate(seed=krebs)}"') for krebs in all_krebses()],
|
||||||
+ ["}"]
|
"}",
|
||||||
)
|
))
|
||||||
|
|
||||||
|
|
||||||
def generate(*, seed: str, dancing: bool = False) -> str:
|
def generate(*, seed: str, dancing: bool = False) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user