Jump to content

Handbuch:Pywikibot/movepages.py

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

The movepages.py script is used to move pages.

Befehle

Befehl Bedeutung
-from und -to The page to move from and the page to move to.
-noredirect Lasse keine Weiterleitung hinterher.
-prefix Move pages by adding a namespace prefix to the names of the pages. (Will remove the old namespace prefix if any). Argument kann auch als "-prefix:namespace:" gegeben werden.
-notalkpage Do not move page's talk page (if it exists).
-nosubpages Do not move subpages.
-always Don't prompt to make changes, just do them.
-skipredirects Skip redirect pages (Warning: increases server load)
-summary Prompt for a custom summary, bypassing the predefined message texts. Argument kann auch als "-summary:XYZ" gegeben werden.
-pairsfile Read pairs of file names from a file. The file must be in a format:
[[frompage]]
[[topage]]
[[frompage]]
[[topage]]

Argument kann auch als "-pairsfile:filename" gegeben werden.

Beispiel

  1. Copy the list of the current pages, for example with Special:PrefixIndex.
  2. Convert it in ASCII, for instance with this JavaScript tool.
  3. Paste it in the first column of a spreadsheet (e.g. OpenOffice Calc).
  4. Create the second column with the same number of lines, with some characters which won't be present neither in the old pages names nor in the new (e.g. "string to replace after by \n").
  5. Paste your new pages names (converted in ASCII) into the third column.
  6. Copy the three columns into a file (e.g. called "articles_pairs.txt").
  7. Search and replace with your text editor (e.g. Notepad++), the second column content by the carriage return (\n) (Tip: In notepad++ which trying to replace with \n enable the option regex in the replace dialogue box.)
  8. Launching: python core/pwb.py movepages -lang:fr -family:wiktionary -pairsfile:"src/lists/articles_fr_wiktionary.txt" -noredirect will produce the wanted result.