|
|
@ -66,7 +66,8 @@ class CountryList(): |
|
|
|
|
|
|
|
# Check if page exits |
|
|
|
if not self.page.exists(): |
|
|
|
return False |
|
|
|
raise CountryListError( "CountryList " + |
|
|
|
str(wikilink.title) + " does not exists!" ) |
|
|
|
|
|
|
|
# Initialise attributes |
|
|
|
__attr = ( "wikicode", "entry", "chartein", "_chartein_raw", |
|
|
@ -156,11 +157,18 @@ class CountryList(): |
|
|
|
# For belgian list we need to select subsection of country |
|
|
|
belgian = self.detect_belgian() |
|
|
|
|
|
|
|
if belgian: |
|
|
|
singles_section = self.wikicode.get_sections( |
|
|
|
matches=belgian )[0].get_sections( matches="Singles" )[0] |
|
|
|
else: |
|
|
|
singles_section = self.wikicode.get_sections(matches="Singles")[0] |
|
|
|
# Select Singles-Section |
|
|
|
# Catch Error if we have none |
|
|
|
try: |
|
|
|
if belgian: |
|
|
|
singles_section = self.wikicode.get_sections( |
|
|
|
matches=belgian )[0].get_sections( matches="Singles" )[0] |
|
|
|
else: |
|
|
|
singles_section = self.wikicode.get_sections( |
|
|
|
matches="Singles" )[0] |
|
|
|
|
|
|
|
except IndexError: |
|
|
|
raise CountryListError( "No Singles-Section found!") |
|
|
|
|
|
|
|
# Since we have multiple categories in some countrys we need |
|
|
|
# to select the first wrapping template |
|
|
@ -230,7 +238,15 @@ class CountryList(): |
|
|
|
If param is not present raise Error |
|
|
|
""" |
|
|
|
if self.entry.has( "Chartein" ): |
|
|
|
self._chartein_raw = self.entry.get("Chartein").value.strip() |
|
|
|
self._chartein_raw = self.entry.get("Chartein").value |
|
|
|
|
|
|
|
# Remove possible ref-tags |
|
|
|
for ref in self._chartein_raw.ifilter_tags(matches="ref"): |
|
|
|
self._chartein_raw.remove( ref ) |
|
|
|
|
|
|
|
# Remove whitespace |
|
|
|
self._chartein_raw = str(self._chartein_raw).strip() |
|
|
|
|
|
|
|
else: |
|
|
|
raise CountryListEntryError( "Template Parameter 'Chartein' is \ |
|
|
|
missing!" ) |
|
|
@ -256,7 +272,14 @@ missing!" ) |
|
|
|
If param is not present raise Error |
|
|
|
""" |
|
|
|
if self.entry.has( "Titel" ): |
|
|
|
self._titel_raw = self.entry.get("Titel").value.strip() |
|
|
|
self._titel_raw = self.entry.get("Titel").value |
|
|
|
|
|
|
|
# Remove possible ref-tags |
|
|
|
for ref in self._titel_raw.ifilter_tags(matches="ref"): |
|
|
|
self._titel_raw.remove( ref ) |
|
|
|
|
|
|
|
# Remove whitespace |
|
|
|
self._titel_raw = str(self._titel_raw).strip() |
|
|
|
else: |
|
|
|
raise CountryListEntryError( "Template Parameter 'Titel' is \ |
|
|
|
missing!" ) |
|
|
@ -321,7 +344,14 @@ missing!" ) |
|
|
|
If param is not present raise Error |
|
|
|
""" |
|
|
|
if self.entry.has( "Interpret" ): |
|
|
|
self._interpret_raw = self.entry.get("Interpret").value.strip() |
|
|
|
self._interpret_raw = self.entry.get("Interpret").value |
|
|
|
|
|
|
|
# Remove possible ref-tags |
|
|
|
for ref in self._interpret_raw.ifilter_tags(matches="ref"): |
|
|
|
self._interpret_raw.remove( ref ) |
|
|
|
|
|
|
|
# Remove whitespace |
|
|
|
self._interpret_raw = str(self._interpret_raw).strip() |
|
|
|
else: |
|
|
|
raise CountryListEntryError( "Template Parameter 'Interpret' is \ |
|
|
|
missing!" ) |
|
|
|