Browse Source

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

develop
Jonathan Golder 9 years ago
parent
commit
2e8b4273e7
  1. 20
      countrylist.py

20
countrylist.py

@ -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 )

Loading…
Cancel
Save