Skip to content

Commit

Permalink
feat: get activity id based in url
Browse files Browse the repository at this point in the history
It is now possible to get the activity ID based on a full URL and not
just the ID number.
  • Loading branch information
Lucs1590 committed May 9, 2024
1 parent 46326cd commit 628a654
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ def ask_file_location() -> str:


def ask_activity_id() -> str:
return questionary.text(
activity_id = questionary.text(
"Enter the Strava activity ID you want to export to TrainingPeaks:"
).ask()
return re.sub(r"\D", "", activity_id)


def download_tcx_file(activity_id: str, sport: str) -> None:
Expand Down
3 changes: 3 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import os
#import sys
import unittest
from unittest.mock import patch

# sys.path.append(os.path.abspath(''))

from src.main import (
download_tcx_file,
read_xml_file,
Expand Down

0 comments on commit 628a654

Please sign in to comment.