CountryList-Module: Implement parse-method which handles the parsing sequence

This commit is contained in:
2015-11-09 20:09:18 +01:00
parent 41d3ca95ef
commit 2e8b4273e7

View File

@@ -105,6 +105,22 @@ class CountryList():
if str( self.year ) not in self.page.title(): if str( self.year ) not in self.page.title():
raise CountryListYearError raise CountryListYearError
def parse( self ):
"""
Handles the parsing process
"""
# Parse page with mwparser
self.generate_wikicode()
# Select lastest entry
self.get_latest_entry()
# Prepare chartein, titel, interpret
self.prepare_chartein()
self.prepare_titel()
self.prepare_interpret()
def detect_belgian( self ): def detect_belgian( self ):
""" """
Detect wether current entry is on of the belgian (Belgien/Wallonien) Detect wether current entry is on of the belgian (Belgien/Wallonien)
@@ -241,8 +257,6 @@ missing!" )
# Split it in words # Split it in words
words = self._interpret_raw.split() words = self._interpret_raw.split()
print( words )
# Interpret name separating words # Interpret name separating words
seps = ( "feat.", "&" ) seps = ( "feat.", "&" )
@@ -297,8 +311,6 @@ missing!" )
if not indexes: if not indexes:
break break
print( parts )
# Join the collected links # Join the collected links
sep = " " sep = " "
self.interpret = sep.join( parts ) self.interpret = sep.join( parts )