diff --git a/countrylist.py b/countrylist.py index c869822..38e5c9b 100644 --- a/countrylist.py +++ b/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) diff --git a/summarypage.py b/summarypage.py index f44f186..a52fc4f 100644 --- a/summarypage.py +++ b/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