pep8-compat: clean up CountryList-Modul

This commit is contained in:
2015-11-23 19:11:21 +01:00
parent 4a856b1dae
commit f819193790

View File

@@ -126,11 +126,11 @@ class CountryList():
Detect wether current entry is on of the belgian (Belgien/Wallonien) Detect wether current entry is on of the belgian (Belgien/Wallonien)
""" """
# Check if begian province name is in link text or title # Check if begian province name is in link text or title
if "Wallonien" in str( self.wikilink.text ) \ if( "Wallonien" in str( self.wikilink.text ) or
or "Wallonien" in str( self.wikilink.title): "Wallonien" in str( self.wikilink.title) ):
return "Wallonie" return "Wallonie"
elif "Flandern" in str( self.wikilink.text ) \ elif( "Flandern" in str( self.wikilink.text ) or
or "Flandern" in str( self.wikilink.title): "Flandern" in str( self.wikilink.title) ):
return "Flandern" return "Flandern"
else: else:
return None return None
@@ -160,14 +160,14 @@ class CountryList():
# Since we have multiple categories in some countrys we need # Since we have multiple categories in some countrys we need
# to select the first wrapping template # to select the first wrapping template
try: try:
wrapping_template = next( singles_section.ifilter_templates( wrapping = next( singles_section.ifilter_templates(
matches="Nummer-eins-Hits" ) ) matches="Nummer-eins-Hits" ) )
except StopIteration: except StopIteration:
raise CountryListError( "Wrapping template is missing!") raise CountryListError( "Wrapping template is missing!")
# Select the last occurence of template "Nummer-eins-Hits Zeile" in # Select the last occurence of template "Nummer-eins-Hits Zeile" in
# Wrapper-template # Wrapper-template
for self.entry in wrapping_template.get("Inhalt").value.ifilter_templates( for self.entry in wrapping.get("Inhalt").value.ifilter_templates(
matches="Nummer-eins-Hits Zeile" ): matches="Nummer-eins-Hits Zeile" ):
pass pass
@@ -303,8 +303,8 @@ missing!" )
for index in indexes: for index in indexes:
# Check wether wikilink matches # Check wether wikilink matches
if parts[index] == wikilink.text \ if( parts[index] == wikilink.text or
or parts[index] == wikilink.title: parts[index] == wikilink.title ):
# Overwrite name with complete wikilink # Overwrite name with complete wikilink
parts[index] = str( wikilink ) parts[index] = str( wikilink )
@@ -345,6 +345,7 @@ class CountryListError( Exception ):
""" """
pass pass
class CountryListEntryError( CountryListError ): class CountryListEntryError( CountryListError ):
""" """
Handles errors occuring in class CountryList related to entrys Handles errors occuring in class CountryList related to entrys