def main(): logging.basicConfig(level=logging.DEBUG) parser = argparse.ArgumentParser(description='Uploads TCX to the Internets') parser.add_argument(nargs='+', dest='tcx', help='TCX files to upload') args = parser.parse_args() stream = file(os.path.expanduser('~/.schwinn810.yaml'), 'r') cfg = load(stream) if 'garmin' in cfg: garmin = cfg['garmin'] client = connect.GarminConnect() client.username = garmin["username"] client.password = garmin["password"] client.data_available(None, "tcx", args.tcx) # thread.start_new_thread() if 'mmf' in cfg: mmf = cfg['mmf'] client = MMF() client.username = mmf["username"] client.password = mmf["password"] client.data_available(None, "tcx", args.tcx)
def create_garmin_connect_plugin(): try: if _cfg.getboolean("antd.connect", "enabled"): import antd.connect as connect client = connect.GarminConnect() client.username = _cfg.get("antd.connect", "username") client.password = _cfg.get("antd.connect", "password") client.cache = os.path.expanduser(_cfg.get("antd.connect", "cache")) return client except ConfigParser.NoSectionError: pass