Use callback to detect redfam.section

Detecting redfam-Sections via RegExp caused some false positives due to
wrong formated things in wikisyntax. See Task

Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=78 FS#78]
This commit is contained in:
2016-08-24 20:02:48 +02:00
parent 1e4c8646bf
commit ac54aea698
2 changed files with 19 additions and 2 deletions

View File

@@ -28,9 +28,10 @@ Provides a class for handling redundance discussion pages and archives
import pywikibot # noqa
import mwparserfromhell as mwparser
import jogobot
import jogobot # noqa
from mysqlred import MysqlRedPage
from redfam import RedFamParser
class RedPage:
@@ -116,7 +117,7 @@ class RedPage:
# include_lead = if true include first section (intro)
# include_heading = if true include heading
fams = self.wikicode.get_sections(
matches=jogobot.config["redundances"]["section_heading_regex"],
matches=RedFamParser.is_section_redfam_cb,
include_lead=False, include_headings=True )
# Iterate over RedFam