def data_available(self, device_sn, format, files): if format not in ("tcx"): return files result = [] try: for file in files: self.upload(format, file) result.append(file) plugin.publish_data(device_sn, "notif_TrainingPeaks", files) except Exception: _log.warning("Failed to upload to TrainingPeaks.", exc_info=True) finally: return result
def data_available(self, device_sn, format, files): if format not in ("tcx"): return files result = [] try: for file in files: self.login() self.upload(format, file) result.append(file) plugin.publish_data(device_sn, "notif_connect", files) except Exception: _log.warning("Failed to upload to Garmin Connect.", exc_info=True) finally: return result
def data_availible(self, device_sn, format, files): if "raw" != format: return files processed = [] result = [] try: for file in files: _log.info("TcxPlugin: processing %s.", file) try: dir = self.tcx_output_dir % {"device_id": hex(device_sn)} if not os.path.exists(dir): os.makedirs(dir) files = export_tcx(device_sn, file, dir) result.extend(files) processed.append(file) except Exception: _log.warning("Failed to process %s. Maybe a datatype is unimplemented?", file, exc_info=True) plugin.publish_data(device_sn, "tcx", result) finally: return processed
def data_availible(self, device_sn, format, files): if "raw" != format: return files processed = [] result = [] try: for file in files: _log.info("TcxPlugin: processing %s.", file) try: dir = self.tcx_output_dir % {"device_id": hex(device_sn)} if not os.path.exists(dir): os.makedirs(dir) files = export_tcx(file, dir) result.extend(files) processed.append(file) except Exception: _log.warning( "Failed to process %s. Maybe a datatype is unimplemented?", file, exc_info=True) plugin.publish_data(device_sn, "tcx", result) finally: return processed
#!/usr/bin/python import antd.plugin as plugin import antd.notif as notif import antd.cfg as cfg cfg._cfg.add_section("antd.notification") cfg._cfg.set("antd.notification", "enabled", "True") cfg.init_loggers() plugin.register_plugins(cfg.create_notification_plugin()) files = ['file1', 'file2', 'file3'] plugin.publish_data("0xdeadbeef", "notif_connect", files) plugin.publish_data("0xdeadbeef", "notif_junk", files) plugin.publish_data("0xdeadbeef", "complete_junk", files)
#!/usr/bin/python import antd.plugin as plugin import antd.notif as notif import antd.cfg as cfg cfg._cfg.add_section("antd.notification") cfg._cfg.set("antd.notification", "enabled", "True") cfg.init_loggers() plugin.register_plugins( cfg.create_notification_plugin() ) files = ['file1', 'file2', 'file3'] plugin.publish_data("0xdeadbeef", "notif_connect", files) plugin.publish_data("0xdeadbeef", "notif_junk", files) plugin.publish_data("0xdeadbeef", "complete_junk", files)