CountryList-module: Also search for Links in Titel
This commit is contained in:
@@ -244,7 +244,11 @@ missing!" )
|
|||||||
if not self._titel_raw:
|
if not self._titel_raw:
|
||||||
self.get_titel_value()
|
self.get_titel_value()
|
||||||
|
|
||||||
self.titel = self._titel_raw
|
# Try to find a wikilink for Titel on countrylist
|
||||||
|
if "[[" not in self._titel_raw:
|
||||||
|
self.titel = self._search_links( str(self._titel_raw) )
|
||||||
|
else:
|
||||||
|
self.titel = self._titel_raw
|
||||||
|
|
||||||
def get_titel_value( self ):
|
def get_titel_value( self ):
|
||||||
"""
|
"""
|
||||||
@@ -344,7 +348,7 @@ missing!" )
|
|||||||
|
|
||||||
# If indexes worklist was not provided, work on all elements
|
# If indexes worklist was not provided, work on all elements
|
||||||
if not indexes:
|
if not indexes:
|
||||||
indexes = range( len( keywords ) - 1 )
|
indexes = list(range( len( keywords ) ))
|
||||||
|
|
||||||
# Iterate over wikilinks of refpage and try to find related links
|
# Iterate over wikilinks of refpage and try to find related links
|
||||||
for wikilink in self.wikicode.ifilter_wikilinks():
|
for wikilink in self.wikicode.ifilter_wikilinks():
|
||||||
@@ -365,15 +369,15 @@ missing!" )
|
|||||||
# Other indexes won't also match
|
# Other indexes won't also match
|
||||||
break
|
break
|
||||||
|
|
||||||
# If worklist is empty, stop iterating over wikilinks
|
# If worklist is empty, stop iterating over wikilinks
|
||||||
if not indexes:
|
if not indexes:
|
||||||
break
|
break
|
||||||
|
|
||||||
# Choose wether return list or string based on input type
|
# Choose wether return list or string based on input type
|
||||||
if not string:
|
if not string:
|
||||||
return keywords
|
return keywords
|
||||||
else:
|
else:
|
||||||
return keywords[0]
|
return str(keywords[0])
|
||||||
|
|
||||||
|
|
||||||
class CountryListError( Exception ):
|
class CountryListError( Exception ):
|
||||||
|
|||||||
Reference in New Issue
Block a user