https://bugzilla.wikimedia.org/show_bug.cgi?id=64468
Bug ID: 64468 Summary: improve diff visualization for Wikibase entities Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: Unprioritized Component: Wikidata Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: ricordisamoa@live.it Depends on: 39147 Web browser: --- Mobile Platform: ---
pywikibot.showDiff(oldText, newText) is currently used to compare two wikicode strings. But what about data items?
We should either: * use the API to get a diff in structured format (bug 39147), or: * convert dicts to strings somehow, before sending them to difflib
More ideas are welcome.
https://bugzilla.wikimedia.org/show_bug.cgi?id=64468
Betacommand Phoenixoverride@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |Phoenixoverride@gmail.com
--- Comment #1 from Betacommand Phoenixoverride@gmail.com --- use json.dumps to get a string?
https://bugzilla.wikimedia.org/show_bug.cgi?id=64468
Ricordisamoa ricordisamoa@live.it changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ricordisamoa@live.it
--- Comment #2 from Ricordisamoa ricordisamoa@live.it --- Created attachment 15216 --> https://bugzilla.wikimedia.org/attachment.cgi?id=15216&action=edit console output by pywikibot.showDiff used on two json.dumps-ed dictionaries
(In reply to Betacommand from comment #1)
use json.dumps to get a string?
Really? This is a small piece of what I got on my terminal using json.dumps before showDiff, after changing a single alias. We need a smarter function than json.dumps.
https://bugzilla.wikimedia.org/show_bug.cgi?id=64468
--- Comment #3 from Betacommand Phoenixoverride@gmail.com --- thats probably because you didnt configure the dumps for human reading. Try: json.dumps(data, indent=4, sort_keys=True) should give you much cleaner results
https://bugzilla.wikimedia.org/show_bug.cgi?id=64468
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|Pywikipedia-bugs@lists.wiki |jayvdb@gmail.com |media.org |
pywikipedia-bugs@lists.wikimedia.org