Exemplo n.º 1
0
 def process_files(self, db_params_dict):
     """Import monitoring FIT files into the database."""
     fp = FitFileProcessor(db_params_dict, self.debug)
     for file_name in progressbar.progressbar(self.file_names):
         try:
             fp.write_file(Fit.file.File(file_name,
                                         self.measurement_system))
         except Fit.exceptions.FitFileError as e:
             logger.error("Failed to parse %s: %s", file_name, e)
Exemplo n.º 2
0
 def process_files(self, db_params_dict):
     """Import monitoring FIT files into the database."""
     fp = FitFileProcessor(db_params_dict, self.debug)
     for file_name in progressbar.progressbar(self.file_names):
         try:
             fit_file = Fit.file.File(file_name, self.measurement_system)
             if fit_file.type() == Fit.field_enums.FileType.monitoring_b:
                 fp.write_file(fit_file)
             else:
                 root_logger.info(
                     "skipping non monitoring file %s type %r message types %r",
                     file_name, fit_file.type(), fit_file.message_types())
         except Fit.exceptions.FitFileError as e:
             logger.error("Failed to parse %s: %s", file_name, e)
Exemplo n.º 3
0
 def process_files(self, db_params):
     """Import FIT files into the database."""
     fp = FitFileProcessor(db_params, self.debug)
     for file_name in tqdm(self.file_names, unit='files'):
         try:
             fit_file = Fit.file.File(file_name, self.measurement_system)
             if self.fit_types is None or fit_file.type in self.fit_types:
                 fp.write_file(fit_file)
                 root_logger.info(
                     "Wrote Fit file %s type %s to the database", file_name,
                     fit_file.type)
             else:
                 root_logger.info(
                     "skipping non-matching %s file %s type %r message types %r",
                     self.fit_types, file_name, fit_file.type,
                     fit_file.message_types)
         except Exception as e:
             logger.error("Failed to parse %s: %s", file_name, e)
             root_logger.error("Failed to parse %s: %s", file_name, e)