Private
Public Access
1
0

more autopep

This commit is contained in:
Sander Roosendaal
2022-03-10 17:16:31 +01:00
parent 8070a68931
commit a0223bec24
5 changed files with 32 additions and 60 deletions

View File

@@ -87,7 +87,7 @@ def make_plot(r, w, f1, f2, plottype, title, imagename='', plotnr=0):
}
axis = r.staticgrids
if axis == None: # pragma: no cover
if axis is None: # pragma: no cover
gridtrue = False
axis = 'both'
else:
@@ -133,14 +133,14 @@ def do_sync(w, options, quick=False):
do_strava_export = w.user.strava_auto_export
try:
upload_to_strava = options['upload_to_Strava'] or do_strava_export
do_strava_export = options['upload_to_Strava'] or do_strava_export
except KeyError:
upload_to_strava = False
pass
try:
if options['stravaid'] != 0 and options['stravaid'] != '': # pragma: no cover
w.uploadedtostrava = options['stravaid']
upload_to_strava = False
# upload_to_strava = False
do_strava_export = False
w.save()
except KeyError:
@@ -174,14 +174,14 @@ def do_sync(w, options, quick=False):
do_c2_export = w.user.c2_auto_export
try:
upload_to_c2 = options['upload_to_C2'] or do_c2_export
do_c2_export = options['upload_to_C2'] or do_c2_export
except KeyError:
upload_to_c2 = False
pass
try:
if options['c2id'] != 0 and options['c2id'] != '': # pragma: no cover
w.uploadedtoc2 = options['c2id']
upload_to_c2 = False
# upload_to_c2 = False
do_c2_export = False
w.save()
except KeyError:
@@ -250,16 +250,15 @@ def do_sync(w, options, quick=False):
with open('st_export.log', 'a') as logfile:
logfile.write(str(timezone.now())+': ')
logfile.write(str(w.user)+' NoTokenError\n')
message = "Please connect to SportTracks first"
id = 0
return 0
if ('upload_to_TrainingPeaks' in options and options['upload_to_TrainingPeaks']) or (w.user.trainingpeaks_auto_export): # pragma: no cover
try:
message, id = tpstuff.workout_tp_upload(
_, id = tpstuff.workout_tp_upload(
w.user.user, w
)
except NoTokenError:
message = "Please connect to TrainingPeaks first"
id = 0
return 0
return 1