Browse Source

Fix Bug: Writing is requested even when only rev_ids have changed

Introduce new attr to CountryList for simple get information wether page was parsed

The SummaryPageEntryTemplate comparation to non-equal fails when unparsed Entrys occur
--> and it with information wether CountryList was parsed
develop
Jonathan Golder 9 years ago
parent
commit
5b084f6fde
  1. 5
      countrylist.py
  2. 7
      summarypage.py

5
countrylist.py

@ -74,6 +74,8 @@ class CountryList():
for attr in __attr:
setattr( self, attr, None )
self.parsed = False
# Try to find year
self.find_year()
@ -121,6 +123,9 @@ class CountryList():
self.prepare_titel()
self.prepare_interpret()
# For easy detecting wether we have parsed self
self.parsed = True
def detect_belgian( self ):
"""
Detect wether current entry is on of the belgian (Belgien/Wallonien)

7
summarypage.py

@ -100,7 +100,7 @@ class SummaryPageEntry():
self.get_countrylist()
# Check if parsing country list is needed
if( self.countrylist.is_parsing_needed( self.countrylist_revid )):
if( self.countrylist.parsed):
self.correct_chartein()
@ -220,7 +220,8 @@ class SummaryPageEntry():
Detects wether writing of entry is needed and stores information in
Class-Attribute
"""
type( self ).write_needed = ( ( self.old_entry != self.new_entry ) or
type( self ).write_needed = ( ( self.old_entry != self.new_entry ) and
self.countrylist.parsed or
type( self ).write_needed )
def get_entry( self ):
@ -228,7 +229,7 @@ class SummaryPageEntry():
Returns the new entry if CountryList was parsed otherwise returns the
old one
"""
if( self.countrylist.is_parsing_needed( self.countrylist_revid )):
if( self.countrylist.parsed):
return self.new_entry
else:
return self.old_entry

Loading…
Cancel
Save