From 2e8b4273e7d9b4288b85a49993b059330f3cee4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?GOLDERWEB=20=E2=80=93=20Jonathan=20Golder?= Date: Mon, 9 Nov 2015 20:09:18 +0100 Subject: [PATCH] CountryList-Module: Implement parse-method which handles the parsing sequence --- countrylist.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/countrylist.py b/countrylist.py index a74e0e3..18b508c 100644 --- a/countrylist.py +++ b/countrylist.py @@ -105,6 +105,22 @@ class CountryList(): if str( self.year ) not in self.page.title(): 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 ): """ Detect wether current entry is on of the belgian (Belgien/Wallonien) @@ -241,8 +257,6 @@ missing!" ) # Split it in words words = self._interpret_raw.split() - print( words ) - # Interpret name separating words seps = ( "feat.", "&" ) @@ -297,8 +311,6 @@ missing!" ) if not indexes: break - print( parts ) - # Join the collected links sep = " " self.interpret = sep.join( parts )