Cathopedia:Bot/cathopedia-family.py

Da Cathopedia, l'enciclopedia cattolica.
100%Decrease text sizeStandard text sizeIncrease text size
Share/Save/Bookmark
< Cathopedia:Bot
Vai alla navigazione Vai alla ricerca

Per utilizzare il file, fare copia-incolla del testo dalla prossima riga in poi.

             
import config, family, urllib         

class Family(family.Family):          
    def __init__(self):               
        family.Family.__init__(self)  
        self.name = 'cathopedia'      

        self.langs = {                
            'it': 'it.cathopedia.org/',
        }

        self.namespaces[4] = {
            '_default': [u'cathopedia', self.namespaces[4]['_default']], # REQUIRED
            'it': 'Cathopedia',
            }
        self.namespaces[5]['it'] = u'Discussioni Cathopedia'

        self.content_id = "bodyContent"
        self.interwiki_text_separator = '\r\n\r\n'
        self.interwiki_putfirst = {}
        self.interwiki_putfirst_doubled = {}
        self.interwiki_forward = None
        self.obsolete = {}

        self.category_attop = []
        self.category_on_one_line = []
        self.category_text_separator = '\r\n\r\n'
        self.categories_last = []

    def protocol(self, code):
        """
        Can be overridden to return 'https'. Other protocols are not supported.
        """
        return 'http'

    def scriptpath(self, code):
        """The prefix used to locate scripts on this wiki.

        This is the value displayed when you enter {{SCRIPTPATH}} on a
        wiki page (often displayed at [[Help:Variables]] if the wiki has
        copied the master help page correctly).

        The default value is the one used on Wikimedia Foundation wikis,
        but needs to be overridden in the family file for any wiki that
        uses a different value.

        """
        return '/w'

    def apipath(self, code):
        return '%s/api.php' % self.scriptpath(code)

    def version(self, code):
        return '1.15.3'

    def code2encoding(self, code):
        """Return the encoding for a specific language wiki"""
        return 'utf-8'