jenkins-bot submitted this change.

View Change


Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
Wrap DOT-string in curly braces in category_graph.py

Invalid DOT-string in category_graph.py caused TypeError exception when
running category_graph.py. Wrapped the DOT-string in curly braces in
argument passed to pydot.graph_from_dot_data() so that the DOT-string is
in line with the pydot documentation.

Wrap DOT-string in additional set of curly braces.

I forgot the second set of curly braces in the original commit and am
adding them in this commit. The second braces escape the first set of
braces and resolve "style" in the argument.

Bug: T346007
Change-Id: I635e077240b7d6441d5349edf261ba00a96748e7
---
M scripts/category_graph.py
1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/scripts/category_graph.py b/scripts/category_graph.py
index fd97b8c..0d875b2 100755
--- a/scripts/category_graph.py
+++ b/scripts/category_graph.py
@@ -90,7 +90,7 @@
f'node [newrank=true shape=plaintext {font}] ' \
f'edge [arrowhead=open labeldistance=3 ' \
f'labelfontcolor="#00000080" {font}] ' + args.style
- self.dot = pydot.graph_from_dot_data(f'digraph {style}')[0]
+ self.dot = pydot.graph_from_dot_data(f'digraph {{{style}}}')[0]
self.dot.set_name(f'"{cat_title}"')

def scan_level(self, cat, level, hue=None) -> str:

To view, visit change 956098. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I635e077240b7d6441d5349edf261ba00a96748e7
Gerrit-Change-Number: 956098
Gerrit-PatchSet: 4
Gerrit-Owner: Enag2000 <enag2000@gmail.com>
Gerrit-Reviewer: D3r1ck01 <dalangi-ctr@wikimedia.org>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged