13,398
edits
No edit summary |
No edit summary Tag: Manual revert |
||
(One intermediate revision by the same user not shown) | |||
Line 49: | Line 49: | ||
display = display or cat | display = display or cat | ||
return string.format('[[:Category:%s|%s]]', cat, display) | return string.format('[[:Category:%s|%s]]', cat, display) | ||
end | |||
function Category:getCount() | |||
if not self._count then | |||
local counts = mw.site.stats.pagesInCategory(self:getCategory(), '*') | |||
self._count = counts[self._whatToCount or 'pages'] | |||
if not self._count then | |||
error("the count type must be one of 'pages', 'subcats', 'files' or 'all'") | |||
end | |||
end | |||
return self._count | |||
end | end | ||
Line 158: | Line 169: | ||
dateFormat = dateFormat, | dateFormat = dateFormat, | ||
} | } | ||
if datedCategoryObj:getCount() > 0 then | |||
table.insert(self._datedCategories, datedCategoryObj) | |||
end | |||
date = ProgressBox.incrementDate(date) | date = ProgressBox.incrementDate(date) | ||
end | end | ||
Line 310: | Line 324: | ||
ProgressBox = ProgressBox, | ProgressBox = ProgressBox, | ||
} | } | ||
end | |||
function p._main(args, cfg, title) | |||
return tostring(ProgressBox.new(args, cfg, title)) | |||
end | end | ||
edits