Skip to content

Commit

Permalink
Combine strings where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Beitner committed Jan 14, 2021
1 parent c851d38 commit 758b59c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modvis.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def add_uses_edge(from_node, to_node):

def main():
usage = """usage: %prog FILENAME... [--dot|--tgf|--yed]"""
desc = "Analyse one or more Python source files and generate an" "approximate module dependency graph."
desc = "Analyse one or more Python source files and generate an approximate module dependency graph."
parser = OptionParser(usage=usage, description=desc)
parser.add_option("--dot", action="store_true", default=False, help="output in GraphViz dot format")
parser.add_option("--tgf", action="store_true", default=False, help="output in Trivial Graph Format")
Expand Down
14 changes: 7 additions & 7 deletions pyan/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def start_subgraph(self, graph):

# translucent gray (no hue to avoid visual confusion with any
# group of colored nodes)
self.write('graph [style="filled,rounded",' 'fillcolor="#80808018", label="%s"];' % graph.label)
self.write('graph [style="filled,rounded", fillcolor="#80808018", label="%s"];' % graph.label)

def finish_subgraph(self, graph):
self.log("Finish subgraph %s" % graph.label)
Expand All @@ -148,9 +148,9 @@ def write_edge(self, edge):
target = edge.target
color = edge.color
if edge.flavor == "defines":
self.write(' %s -> %s [style="dashed",' ' color="%s"];' % (source.id, target.id, color))
self.write(' %s -> %s [style="dashed", color="%s"];' % (source.id, target.id, color))
else: # edge.flavor == 'uses':
self.write(' %s -> %s [style="solid",' ' color="%s"];' % (source.id, target.id, color))
self.write(' %s -> %s [style="solid", color="%s"];' % (source.id, target.id, color))

def finish_graph(self):
self.write("}") # terminate "digraph G {"
Expand Down Expand Up @@ -250,7 +250,7 @@ def start_subgraph(self, graph):
self.indent()
self.write('<y:Fill color="#CCCCCC" transparent="false"/>')
self.write(
'<y:NodeLabel modelName="internal" modelPosition="t" ' 'alignment="right">%s</y:NodeLabel>' % graph.label
'<y:NodeLabel modelName="internal" modelPosition="t" alignment="right">%s</y:NodeLabel>' % graph.label
)
self.write('<y:Shape type="roundrectangle"/>')
self.dedent()
Expand Down Expand Up @@ -282,7 +282,7 @@ def write_node(self, node):
self.indent()
self.write('<y:Geometry height="%s" width="%s"/>' % ("30", width))
self.write('<y:Fill color="%s" transparent="false"/>' % node.fill_color)
self.write('<y:BorderStyle color="#000000" type="line" ' 'width="1.0"/>')
self.write('<y:BorderStyle color="#000000" type="line" width="1.0"/>')
self.write("<y:NodeLabel>%s</y:NodeLabel>" % node.label)
self.write('<y:Shape type="ellipse"/>')
self.dedent()
Expand All @@ -303,9 +303,9 @@ def write_edge(self, edge):
self.write("<y:PolyLineEdge>")
self.indent()
if edge.flavor == "defines":
self.write('<y:LineStyle color="%s" ' 'type="dashed" width="1.0"/>' % edge.color)
self.write('<y:LineStyle color="%s" type="dashed" width="1.0"/>' % edge.color)
else:
self.write('<y:LineStyle color="%s" ' 'type="line" width="1.0"/>' % edge.color)
self.write('<y:LineStyle color="%s" type="line" width="1.0"/>' % edge.color)
self.write('<y:Arrows source="none" target="standard"/>')
self.write('<y:BendStyle smoothed="true"/>')
self.dedent()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
("License :: OSI Approved :: " "GNU General Public License v2 (GPLv2)"),
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit 758b59c

Please sign in to comment.