Skip to content

Commit

Permalink
Black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hyakuhei committed Aug 2, 2021
1 parent 311b7c6 commit 76afc07
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions fluentm.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def __init__(self, toWrap):
version=None,
)


class TCP(WrappableProtocol):
def __init__(self, toWrap):
super().__init__(
Expand All @@ -179,6 +180,7 @@ def __init__(self, toWrap):
version=None,
)


class TCPForwarded(WrappableProtocol):
def __init__(self, toWrap):
super().__init__(
Expand All @@ -192,6 +194,7 @@ def __init__(self, toWrap):
version=None,
)


class Stdout(WrappableProtocol):
def __init__(self, toWrap):
super().__init__(
Expand Down Expand Up @@ -774,7 +777,7 @@ def dataFlowTable(scenes: dict, key: str, images=False, outputDir=""):
}

if images == True:
#print(f.wrappedData.flatDotRecordString())
# print(f.wrappedData.flatDotRecordString())
dfGraph = Digraph(
filename=f"flow-{_safeFilename(key)}-{flowCounter}",
directory=outputDir,
Expand All @@ -783,7 +786,11 @@ def dataFlowTable(scenes: dict, key: str, images=False, outputDir=""):
"fontstyle": "Arial",
"bgcolor": "transparent",
},
node_attr={"fontsize": "11", "fontstyle": "Arial", "shape": "plaintext"},
node_attr={
"fontsize": "11",
"fontstyle": "Arial",
"shape": "plaintext",
},
)
dfGraph.node(
name="struct",
Expand All @@ -793,12 +800,13 @@ def dataFlowTable(scenes: dict, key: str, images=False, outputDir=""):
dfGraph.render(format="png")

row["Image Source"] = f"flow-{_safeFilename(key)}-{flowCounter}.png"

table.append(row)

flowCounter += 1
return table


def _mixinResponses(scenes, key):
newFlows = []
for f in scenes[key]:
Expand All @@ -809,8 +817,11 @@ def _mixinResponses(scenes, key):
newFlows.append(DataFlow(f.catcher, f.pitcher, f.response))
scenes[key][:] = newFlows


def _safeFilename(filename):
return "".join([c for c in filename if c.isalpha() or c.isdigit() or c==' ']).rstrip()
return "".join(
[c for c in filename if c.isalpha() or c.isdigit() or c == " "]
).rstrip()


def report(scenes: dict, outputDir: str, select=None, dfdLabels=True):
Expand All @@ -827,7 +838,9 @@ def report(scenes: dict, outputDir: str, select=None, dfdLabels=True):
sceneReports[key] = {
"graph": graph,
"dfdImage": renderDfd(graph, key, outputDir=outputDir),
"dataFlowTable": dataFlowTable(scenes, key, images=True, outputDir=outputDir),
"dataFlowTable": dataFlowTable(
scenes, key, images=True, outputDir=outputDir
),
}

compoundFlows = []
Expand Down

0 comments on commit 76afc07

Please sign in to comment.