手册:Pywikibot/djvutext.py

From mediawiki.org
This page is a translated version of the page Manual:Pywikibot/djvutext.py and the translation is 88% complete.

djvutext.py extracts the ocr text from a djvu page image and uploads it to the corresponding page in the page namespace on Wikisource. In order for the bot to function, a djvu file must be in the same folder pywikibot runs from and it must be identical to the djvu used for the index file on Wikisource.

On a blank page this script will leave a blank page and set the pagequality level=0 (without text) and the user= to the name of your bot (e.g. <pagequality level="0" user="DougBot" />).

参数

支持以下参数:

-ask 在上传每个页面之前要求确认。(默认:覆盖页面时询问)
-djvu:... 本地djvu文件的文件名(即在您的PWB文件夹中)
-index:... Wikisource上索引页面的名称
-pages:‎<开始>-‎<结束> 要上传的页面范围; ‎<结束>是可选的(例如“-pages:1-”),如果有结束则‎<开始>可选。

所有其它参数将被视为单个页面标题的一部分,并且机器人将仅在该单个页面上工作。

核心唯一参数

-summary:... 自定义编辑摘要。 如果编辑摘要包含空格,使用引号。
-force 覆盖现有文字;可选,默认为False
-always 不要求在更改时进行确认