merging changes by dlenski
This commit is contained in:
@@ -45,10 +45,11 @@ def export_filename(activity, export_format):
|
||||
:return: The file name to use for the exported activity.
|
||||
:rtype: str
|
||||
"""
|
||||
return "{time}_{id}{suffix}".format(
|
||||
fn = "{time}_{id}{suffix}".format(
|
||||
id=activity[0],
|
||||
time=activity[1].isoformat(),
|
||||
suffix=format_suffix[export_format])
|
||||
return fn.replace(':','_') if os.name=='nt' else fn
|
||||
|
||||
|
||||
def need_backup(activities, backup_dir, export_formats=None):
|
||||
|
||||
@@ -12,7 +12,9 @@ from StringIO import StringIO
|
||||
import sys
|
||||
import zipfile
|
||||
import dateutil
|
||||
import dateutil.parser
|
||||
import os.path
|
||||
from functools import wraps
|
||||
|
||||
#
|
||||
# Note: For more detailed information about the API services
|
||||
@@ -39,6 +41,7 @@ def require_session(client_function):
|
||||
"""Decorator that is used to annotate :class:`GarminClient`
|
||||
methods that need an authenticated session before being called.
|
||||
"""
|
||||
@wraps(client_function)
|
||||
def check_session(*args, **kwargs):
|
||||
client_object = args[0]
|
||||
if not client_object.session:
|
||||
@@ -270,6 +273,7 @@ class GarminClient(object):
|
||||
return response.text
|
||||
|
||||
|
||||
@require_session
|
||||
def get_activity_tcx(self, activity_id):
|
||||
"""Return a TCX (Training Center XML) representation of a
|
||||
given activity. If the activity doesn't have a TCX source (for
|
||||
|
||||
Reference in New Issue
Block a user