merging changes by dlenski

This commit is contained in:
petergardfjall
2015-08-27 19:18:26 +02:00
parent e25cd38ea6
commit d6cad6736f
4 changed files with 15 additions and 7 deletions
+2 -1
View File
@@ -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):
+4
View File
@@ -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