def main (self, args, app):
    params = self.get_params(args)
    delta = relativedelta.relativedelta(hours=params.get('hours'))
    now = datetime.now( )
    since = now - delta
    records = [ ]
    for item in self.dexcom.iter_records(self.RECORD_TYPE):
      if item.display_time >= since:
        records.append(item.to_dict( ))
      else:
        break
    return records
dataset/ETHPy150Open openaps/openaps/openaps/vendors/dexcom.py/iter_glucose_hours.main/original