imip-agent

Change of imiptools/period.py

659:4bf280ba1c36
imiptools/period.py
     1.1 --- a/imiptools/period.py	Sat Aug 15 22:58:59 2015 +0200
     1.2 +++ b/imiptools/period.py	Sun Aug 16 00:36:05 2015 +0200
     1.3 @@ -79,6 +79,9 @@
     1.4      def get_end_point(self):
     1.5          return self.end
     1.6  
     1.7 +    def get_duration(self):
     1.8 +        return self.get_end_point() - self.get_start_point()
     1.9 +
    1.10  class Period(PeriodBase):
    1.11  
    1.12      "A simple period abstraction."
    1.13 @@ -428,23 +431,6 @@
    1.14      for replacement in replacements:
    1.15          insert_period(freebusy, replacement)
    1.16  
    1.17 -def get_free_periods(freebusy, period, overlapping=False):
    1.18 -
    1.19 -    """
    1.20 -    Return periods from 'freebusy' within which the given 'period' could be
    1.21 -    inserted. If 'overlapping' is true, only return free periods that overlap
    1.22 -    'period'.
    1.23 -    """
    1.24 -
    1.25 -    free = invert_freebusy(freebusy)
    1.26 -    if not free:
    1.27 -        return None
    1.28 -
    1.29 -    if overlapping:
    1.30 -        return get_overlapping(free, period)
    1.31 -    else:
    1.32 -        return free
    1.33 -
    1.34  def coalesce_freebusy(freebusy):
    1.35  
    1.36      "Coalesce the periods in 'freebusy'."