Tags: chiefgeek157/pywikibot
Tags
[backport] backport archivebot.py from master - Non latin digits support introduced with https://gerrit.wikimedia.org/r/c/pywikibot/core/+/163213 never worked because the variable replacements like %(counter)d expected an int instead of s str. This did not fail as long as textlib.to_local_digits returned an unchanged value if there are no local digits given for a language but it might be failed for those who have it. With 7.5 textlib.to_local_digits always return a str and the archivebot failed. This was fixed recently with 7.5.1. - User should be able to decide whether to use latin or non latin digits. Therefore a lot for new fields were introduced like 'localcounter' which uses the localized number instead of the latin one. This does not break the further implementation due to the %d replacement except in rare cases if the user had it replaced by %s already. - Restore old values for non local fields - Remove the 7.5.1 changes - make a sanity check in analyze_page() method for the case that the local fields are used with %d and show a warning in this case. - Use a generator instead of a list of pages to process. This decreases memory usage a lot and also speeds up start time by giving up sorting all pages. - preload the page contents - catch KeyboardInterrupt and leave the mean loop - add look & feel of CurrentPageBot - print execution time finally Bug: T71551 Bug: T313682 Bug: T313692 Bug: T313785 Change-Id: I10c8ac62656aa53f41be629003e5ed6a875f9310
[BUGFIX] replace archive pattern fields to string conversion use string conversion format fields to support non latin numbers introduced with https://gerrit.wikimedia.org/r/c/pywikibot/core/+/163213 backported from master branch Bug: T313692 Change-Id: Ic543ad607d35a68cdde04a18653804996f96fdb2
PreviousNext