Exemple #1
0
    def process_text(self, elem):
        assert self.user, "User still not defined"

        text = elem.text
        if not (text and self.user):
            return

        if (mwlib.isHardRedirect(text) or mwlib.isSoftRedirect(text)):
            return

        talks = self.sig_finder.find(text)

        self.ecache.add(mwlib.normalize_pagename(self.user), talks)
        self.count += 1
        if not self.count % 500:
            print self.count
Exemple #2
0
    def process_text(self, elem):
        assert self.user, "User still not defined"

        text = elem.text
        if not (text and self.user):
            return

        if (mwlib.isHardRedirect(text) or mwlib.isSoftRedirect(text)):
            return

        try:
            talks = self.sig_finder.find(text)
            self.ecache.add(mwlib.normalize_pagename(self.user), talks)
        # Checks if self.user is a valid pagename
        except AttributeError:
            self._skip = True
            return
        self.count += 1
        if not self.count % 500:
            logging.info("Counter: %d", self.count)