Last modified: 2014-11-15 13:03:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T66468, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64468 - improve diff visualization for Wikibase entities
improve diff visualization for Wikibase entities
Status: NEW
Product: Pywikibot
Classification: Unclassified
Wikidata (Other open bugs)
core-(2.0)
All All
: Unprioritized enhancement
: ---
Assigned To: John Mark Vandenberg
:
Depends on: 39147
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-26 03:29 UTC by Ricordisamoa
Modified: 2014-11-15 13:03 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
console output by pywikibot.showDiff used on two json.dumps-ed dictionaries (189.77 KB, image/png)
2014-04-26 04:04 UTC, Ricordisamoa
Details

Description Ricordisamoa 2014-04-26 03:29:25 UTC
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.
Comment 1 Betacommand 2014-04-26 03:31:35 UTC
use json.dumps to get a string?
Comment 2 Ricordisamoa 2014-04-26 04:04:37 UTC
Created attachment 15216 [details]
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.
Comment 3 Betacommand 2014-04-26 04:08:08 UTC
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
Comment 4 Gerrit Notification Bot 2014-09-14 09:56:18 UTC
Change 160254 had a related patch set uploaded by XZise:
[FIX] init: Return valid json in str() for WbTime and WbQuantity

https://gerrit.wikimedia.org/r/160254
Comment 5 Gerrit Notification Bot 2014-09-14 09:58:45 UTC
Change 160254 merged by jenkins-bot:
[FIX] init: Return valid json in str() for WbTime and WbQuantity

https://gerrit.wikimedia.org/r/160254
Comment 6 John Mark Vandenberg 2014-09-14 14:19:53 UTC
more to do

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links