Ejemplo n.º 1
0
 def normalize(self):
     if self.first_year is not None:
         if self.last_year is not None:
             self.total_years = self.last_year - self.first_year
         else:
             self.total_years = utils.getCurrentYear() - self.first_year
     return MetadataBase.normalize(self)
Ejemplo n.º 2
0
 def addYearsActive(self, years):
     if self.first_year is None or years['start'] < self.first_year:
         self.first_year = years['start']
     if 'end' in years:
         self.breaking_years += years['end'] - years['start']
         if self.last_year is None or years['end'] > self.last_year:
             self.last_year = years['end']
     else:
         self.breaking_years += utils.getCurrentYear() - years['start']