Manual:Pywikibot/protect.py/es

protect.py es un script que facilita la protección de páginas en masa. Es un script simple que le da un gran poder sobre el la protección de casi todas partes de su wiki. Sin embargo, dado que los wikis generalmente se consideran "enciclopedias" que cualquiera "puede editar", es necesario pensar en las razones por las que desea utilizar este script. Dentro de algunas comunidades wiki, particularmente la propia Wikipedia, el uso indebido de este script podría resultar en la revocación de sus derechos administrativos.

Cuándo utilizarlo
Antes de utilizar este script, debe comprender a fondo las políticas de su wiki sobre la protección de páginas. Si su wiki aún no ha discutido su filosofía de protección de páginas, es una buena idea tener esa discusión y escribir algún tipo de política antes de usar este script. Su comunidad debe comprender lo que está haciendo con su bot. El mal uso de ese bot, es decir, usarlo para proteger todas las páginas de un wiki, es muy fácil de hacer con este script, pero generalmente se consideraría un abuso de los poderes administrativos en la mayoría de las comunidades wiki. Recuerde: puede evitar que todos los que no sean administradores editen todas las páginas de su wiki a través de solo un comando con este script.

Los usos "razonables" típicos son:


 * proteger toda una categoría de plantillas, porque cambiar esas plantillas tendría un impacto significativo en la wiki
 * proteger las páginas de ayuda o políticas de la edición general, porque no desea que las "reglas" de su wiki estén sujetas a vandalismo
 * evitar que se cambien los nombres de las páginas, es decir, "mover las páginas bloqueadas", pero seguir permitiendo que se editen libremente

Sintaxis
El script se invoca escribiendo:

Los parámetros disponibles incluyen:

-page:      Protect specified page -cat:       Protect all pages in the given category. -nosubcats: Don't protect pages in the subcategories. -links:     Protect all pages linked from a given page. -file:      Protect all pages listed in a text file. -ref:       Protect all pages referring from a given page. -images:    Protect all images used on a given page. -expiry:    Supply a custom protection expiry, defaults to infinite. -always:    Don't prompt to protect pages, just do it. -summary:   Supply a custom edit summary. -unprotect:  Actually unprotect pages instead of protecting -edit:PROTECTION_LEVEL Set edit protection level to PROTECTION_LEVEL -move:PROTECTION_LEVEL Set move protection level to PROTECTION_LEVEL


 * 1) Without support ##
 * 2) -create:PROTECTION_LEVEL Set move protection level to PROTECTION_LEVEL ##

Values for PROTECTION_LEVEL are: sysop, autoconfirmed, none. If an operation parameter (edit, move or create) is not specified, default protection level is 'sysop' (or 'none' if -unprotect).

Uso
Following are some concrete examples of typical usages.

Complete lockdown of everything in a category
First, consider the case of a category called category:Dependent templates. Everything in this category is a template which requires another template to work. On its own, no template in this category does anything. But if the template gets changed, it will have a knock-on effect for other templates, which themselves might be transcluded on other pages. So we definitely want to protect these templates from harm. They're the building blocks of our wiki! Here's how you do it.

Easy. No options other than the category name and a summary. The script will assume you want to move- and edit-lock the template, so you don't need to do anything else.

Move-locking
Now, imagine that you run a wiki about a television show. Your community has decided on a standard nomenclature for the naming of pages about episodes of that show. There will never be a foreseeable need to change that nomenclature, and it would require a big community discussion to do so, anyway. So you want to protect pages from being moved (renamed). Here's how you do it:

Note a few things here.


 * We don't need to put the category name into quotation marks, because it's just one word. (This is, incidentally, true of almost every Pywikibot script.)
 * The summary must be in double quotations, because we've included an apostrophe in the summary text
 * The  parameter must be defined to   if we want to allow everyone to edit the article, because   and   all default to
 * Defining  in this instance would have no effect, because the pages in a category are already created

Working from a text file
Now for a more complicated case. Imagine you wanted to protect the most used templates on your wiki. This is a perfectly reasonable usage, since changing a template that has 10,000 transclusions is going to have a significant impact on your wiki. You quite rightly don't want such a change happening on a whim. So, first you'd go to Special:MostLinkedTemplates and extract the list into a text file called. Making sure that  was saved to the   folder on your computer, you'd then be able to type something like this:

Protection expiry
To enable expiry of protection place input inside double quotes as strings understandable by MediaWiki (see: API:Protect). Relative periods and absolute dates are acceptable

Custom summaries advisable
If you fail to use the  parameter, an automated summary will be inserted for you. But that summary won't tell your community why you've taken the action. Because protecting pages is generally considered antithetical to the spirit of wiki editing, it's usually important to leave behind a summary that explains why you've taken this unusual action. Remember, when your users attempt to edit or move the page, they'll get a message which includes your bot's edit summary. In most cases, this summary should be as explicit as possible about the reason why your users can't do what they want to do.

If you've put up a full block — that is, sysop-only editing — you'll probably also want to include a link to a page where users can leave feedback on how to improve the locked article. Often, this is the talk page, but on wikis that don't have the talk page functionality enabled, it might be a good idea to drop in a link to a forum or other feedback page.

Limitations
This script has no ability to affect the protection level of anything in the Special namespaces.