def categories(self, generator = True): self.site.require(1, 11) if generator: return listing.PagePropertyGenerator(self, 'categories', 'cl') else: # TODO: return sortkey if wanted return listing.PageProperty(self, 'categories', 'cl', return_values = 'title')
def templates(self, namespace = None, generator = True): self.site.require(1, 8) kwargs = dict(listing.List.generate_kwargs('tl', namespace = namespace)) if generator: return listing.PagePropertyGenerator(self, 'templates', 'tl') else: return listing.PageProperty(self, 'templates', 'tl', return_values = 'title')
def revisions(self, startid=None, endid=None, start=None, end=None, dir='older', user=None, excludeuser=None, limit=50, prop='ids|timestamp|flags|comment|user', expandtemplates=False): self.site.require(1, 8) kwargs = dict( listing.List.generate_kwargs('rv', startid=startid, endid=endid, start=start, end=end, user=user, excludeuser=excludeuser)) kwargs['rvdir'] = dir kwargs['rvprop'] = prop if expandtemplates: kwargs['rvexpandtemplates'] = '1' return listing.PageProperty(self, 'revisions', 'rv', limit=limit, **kwargs)
def images(self, generator=True): if generator: return listing.PagePropertyGenerator(self, 'images', '') else: return listing.PageProperty(self, 'images', '', return_values='title')
def links(self, namespace=None, generator=True, redirects=False): prefix = listing.List.get_prefix('pl', generator) kwargs = dict(listing.List.generate_kwargs(prefix, namespace=namespace)) if redirects: kwargs['redirects'] = '1' if generator: return listing.PagePropertyGenerator(self, 'links', 'pl', **kwargs) else: return listing.PageProperty(self, 'links', 'pl', return_values='title', **kwargs)
def imagehistory(self): return listing.PageProperty(self, 'imageinfo', 'ii', iiprop = compatibility.iiprop(self.site.version))
def langlinks(self): self.site.require(1, 9) return listing.PageProperty(self, 'langlinks', 'll', return_values = ('lang', '*'))
def extlinks(self): self.site.require(1, 11) return listing.PageProperty(self, 'extlinks', 'el', return_values = '*')
def duplicatefiles(self, limit=None): return listing.PageProperty(self, 'duplicatefiles', 'df', dflimit=limit)
def imagehistory(self): return listing.PageProperty( self, 'imageinfo', 'ii', iiprop='timestamp|user|comment|url|size|sha1|metadata|archivename')
def langlinks(self, **kwargs): return listing.PageProperty(self, 'langlinks', 'll', return_values=('lang', '*'), **kwargs)
def iwlinks(self): return listing.PageProperty(self, 'iwlinks', 'iw', return_values=('prefix', '*'))
def extlinks(self): return listing.PageProperty(self, 'extlinks', 'el', return_values='*')
def duplicatefiles(self, limit=None): self.require(1, 14) return listing.PageProperty(self, 'duplicatefiles', 'df', dflimit=limit)