Last modified: 2014-10-07 07:37:00 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 T56999, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54999 - PreloadingItemGenerator for Wikibase items
PreloadingItemGenerator for Wikibase items
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
Wikidata (Other open bugs)
unspecified
All All
: Unprioritized enhancement
: ---
Assigned To: xqt
:
Depends on:
Blocks: 58976
  Show dependency treegraph
 
Reported: 2013-10-05 04:02 UTC by Kunal Mehta (Legoktm)
Modified: 2014-10-07 07:37 UTC (History)
4 users (show)

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


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:02:28 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/347/
Reported by: sk1d
Created on: 2013-09-02 22:26:45.280000
Subject: preloadpagegenartor for wikidataitems
Assigned to: legoktm
Original description:
Preloadpagegenerator with wikidataitems does not work. It seems you have to call pywikibot.page.Itempage.get() for each item after you get it from the generator. This should be obsolete as the item should already get loaded.
Comment 1 Kunal Mehta (Legoktm) 2013-10-05 04:02:30 UTC
- **status**: open --> pending
- **assigned_to**: Legoktm
Comment 2 Kunal Mehta (Legoktm) 2013-10-05 04:02:32 UTC
See https://gerrit.wikimedia.org/r/#/c/80789/ (which won't work on the live site yet)
Comment 3 Kunal Mehta (Legoktm) 2013-10-05 04:02:33 UTC
Looks promising!
Comment 4 Maarten Dammers 2014-06-22 08:57:21 UTC
Looks like this generator has been implemented:

def PreloadingItemGenerator(generator, step=50):
    """
    Yield preloaded pages taken from another generator.

    Function basically is copied from above, but for ItemPage's

    @param generator: pages to iterate over
    @param step: how many pages to preload at once
    """

But it contains a bug: The documentation says it expects a page generator, but in reality it expect an itempage generator.

It should probably contain some logic to check for each page if it's an ItemPage already and otherwise make an itempage (like in WikidataItemGenerator)
Comment 5 Gerrit Notification Bot 2014-09-19 04:18:14 UTC
Change 160438 had a related patch set uploaded by John Vandenberg:
PreloadingItemGenerator: process normal pages

https://gerrit.wikimedia.org/r/160438
Comment 6 Gerrit Notification Bot 2014-09-20 22:32:56 UTC
Change 160438 merged by jenkins-bot:
PreloadingItemGenerator: process normal pages

https://gerrit.wikimedia.org/r/160438

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


Navigation
Links