Anonymous

Guidelines:Pywikibot: Difference between revisions

From Zelda Wiki, the Zelda encyclopedia
no edit summary
No edit summary
No edit summary
Line 118: Line 118:


Typing simply <code>pwb -help</code> will show you command options available for all scripts.
Typing simply <code>pwb -help</code> will show you command options available for all scripts.
By default, PWB waits for 10 seconds before saving each page. To remove this wait period, add <code>-pt:0</code> to the command.


==Example commands==
==Example commands==
Line 125: Line 123:


====Null-editing all pages using a certain template====
====Null-editing all pages using a certain template====
<syntaxhighlight lang="shell">pwb touch -pt:0 -transcludes:"Template:BotW Item Properties/Store"</syntaxhighlight>
<syntaxhighlight lang="shell">pwb touch -transcludes:"Template:BotW Item Properties/Store"</syntaxhighlight>


The <code>Template:</code> namespace prefix can be omitted.
The <code>Template:</code> namespace prefix can be omitted.


====Null-editing all pages in a category====
====Null-editing all pages in a category====
<syntaxhighlight lang="shell">pwb touch -pt:0 -cat:"Articles using invalid arguments in template calls"</syntaxhighlight>
<syntaxhighlight lang="shell">pwb touch -cat:"Articles using invalid arguments in template calls"</syntaxhighlight>


====Replacing text for all pages in a category====
====Replacing text for all pages in a category====
<syntaxhighlight lang="shell">pwb replace -pt:0 -pairsfile:pairsfile.txt -cat:"Articles using invalid arguments in template calls"</syntaxhighlight>
<syntaxhighlight lang="shell">pwb replace -pairsfile:pairsfile.txt -cat:"Articles using invalid arguments in template calls"</syntaxhighlight>


Where <code>pairsfile.txt</code> is a file in your PWB config directory that looks something like this:
Where <code>pairsfile.txt</code> is a file in your PWB config directory that looks something like this:
Line 150: Line 148:


====Uploading all files in a folder====
====Uploading all files in a folder====
<syntaxhighlight lang="shell">python pwb.py upload <path-to-folder> -pt:0 -descfile:descfile.txt -ignorewarn -keep -noverify</syntaxhighlight>
<syntaxhighlight lang="shell">python pwb.py upload <path-to-folder> -descfile:descfile.txt -ignorewarn -keep -noverify</syntaxhighlight>


Where <code>descfile.txt</code> is a file in the PWB config directory containing the [[Template:FileInfo]] that will be added to all the uploads. Fill in whichever fields apply to all files—you can fill in the rest once the files have been uploaded.
Where <code>descfile.txt</code> is a file in the PWB config directory containing the [[Template:FileInfo]] that will be added to all the uploads. Fill in whichever fields apply to all files—you can fill in the rest once the files have been uploaded.


{{Guidelines Nav}}
{{Guidelines Nav}}