mytypes now with collections of tuples, more flexible
This commit is contained in:
@@ -42,241 +42,252 @@ workouttypes_ordered = collections.OrderedDict({
|
||||
|
||||
workouttypes = tuple((key, value) for key, value in workouttypes_ordered.items())
|
||||
|
||||
def Reverse(tuples):
|
||||
new_tup = tuples[::-1]
|
||||
return new_tup
|
||||
|
||||
stravacollection = (
|
||||
('water','Rowing'),
|
||||
('rower','Rowing'),
|
||||
('skierg','NordicSki'),
|
||||
('Bike','Ride'),
|
||||
('bikeerg','Ride'),
|
||||
('dynamic','Rowing'),
|
||||
('slides','Rowing'),
|
||||
('paddle','StandUpPaddling'),
|
||||
('snow','NordicSki'),
|
||||
('coastal','Rowing'),
|
||||
('c-boat','Rowing'),
|
||||
('churchboat','Rowing'),
|
||||
('Ride','Ride'),
|
||||
('Run','Run'),
|
||||
('NordicSki','NordicSki'),
|
||||
('Swim','Swim'),
|
||||
('Hike','Hike'),
|
||||
('Walk','Walk'),
|
||||
('Canoeing','Canoeing'),
|
||||
('Crossfit','Crossfit'),
|
||||
('StandUpPaddling','StandUpPaddling'),
|
||||
('IceSkate','IceSkate'),
|
||||
('WeightTraining','WeightTraining'),
|
||||
('InlineSkate','InlineSkate'),
|
||||
('Kayaking','Kayaking'),
|
||||
('Workout','Workout'),
|
||||
('Yoga','Yoga'),
|
||||
('other','Workout'),
|
||||
)
|
||||
|
||||
stravamapping = collections.OrderedDict({
|
||||
'water':'Rowing',
|
||||
'rower':'Rowing',
|
||||
'skierg':'NordicSki',
|
||||
'Bike':'Ride',
|
||||
'bikeerg':'Ride',
|
||||
'dynamic':'Rowing',
|
||||
'slides':'Rowing',
|
||||
'paddle':'StandUpPaddling',
|
||||
'snow':'NordicSki',
|
||||
'coastal':'Rowing',
|
||||
'c-boat':'Rowing',
|
||||
'churchboat':'Rowing',
|
||||
'Ride':'Ride',
|
||||
'Run':'Run',
|
||||
'NordicSki':'NordicSki',
|
||||
'Swim':'Swim',
|
||||
'Hike':'Hike',
|
||||
'Walk':'Walk',
|
||||
'Canoeing':'Canoeing',
|
||||
'Crossfit':'Crossfit',
|
||||
'StandUpPaddling':'StandUpPaddling',
|
||||
'IceSkate':'IceSkate',
|
||||
'WeightTraining':'WeightTraining',
|
||||
'InlineSkate':'InlineSkate',
|
||||
'Kayaking':'Kayaking',
|
||||
'Workout':'Workout',
|
||||
'Yoga':'Yoga',
|
||||
'other':'Workout',
|
||||
stravamapping = {key:value for key,value in Reverse(stravacollection)}
|
||||
|
||||
})
|
||||
garmincollection = (
|
||||
('water','ROWING'),
|
||||
('rower','INDOOR_ROWING'),
|
||||
('skierg','CROSS_COUNTRY_SKIING'),
|
||||
('Bike','ROAD_BIKING'),
|
||||
('bikeerg','INDOOR_CYCLING'),
|
||||
('dynamic','INDOOR_ROWING'),
|
||||
('slides','INDOOR_ROWING'),
|
||||
('paddle','PADDLING'),
|
||||
('snow','CROSS_COUNTRY_SKIING'),
|
||||
('coastal','ROWING'),
|
||||
('c-boat','ROWING'),
|
||||
('churchboat','ROWING'),
|
||||
('Ride','ROAD_BIKING'),
|
||||
('Run','RUNNING'),
|
||||
('NordicSki','CROSS_COUNTRY_SKIING'),
|
||||
('Swim','SWIMMING'),
|
||||
('Hike','HIKING'),
|
||||
('Walk','WALKING'),
|
||||
('Canoeing','PADDLING'),
|
||||
('Crossfit','FITNESS_EQUIPMENT'),
|
||||
('StandUpPaddling','STAND_UP_PADDLEBOARDING'),
|
||||
('IceSkate','SKATING'),
|
||||
('WeightTraining','STRENGTH_TRAINING'),
|
||||
('InlineSkate','INLINE_SKATING'),
|
||||
('Kayaking','PADDLING'),
|
||||
('Workout','OTHER'),
|
||||
('Yoga','OTHER'),
|
||||
('other','OTHER'),
|
||||
)
|
||||
|
||||
garminmapping = collections.OrderedDict({
|
||||
'water':'ROWING',
|
||||
'rower':'INDOOR_ROWING',
|
||||
'skierg':'CROSS_COUNTRY_SKIING',
|
||||
'Bike':'ROAD_BIKING',
|
||||
'bikeerg':'INDOOR_CYCLING',
|
||||
'dynamic':'INDOOR_ROWING',
|
||||
'slides':'INDOOR_ROWING',
|
||||
'paddle':'PADDLING',
|
||||
'snow':'CROSS_COUNTRY_SKIING',
|
||||
'coastal':'ROWING',
|
||||
'c-boat':'ROWING',
|
||||
'churchboat':'ROWING',
|
||||
'Ride':'ROAD_BIKING',
|
||||
'Run':'RUNNING',
|
||||
'NordicSki':'CROSS_COUNTRY_SKIING',
|
||||
'Swim':'SWIMMING',
|
||||
'Hike':'HIKING',
|
||||
'Walk':'WALKING',
|
||||
'Canoeing':'PADDLING',
|
||||
'Crossfit':'FITNESS_EQUIPMENT',
|
||||
'StandUpPaddling':'STAND_UP_PADDLEBOARDING',
|
||||
'IceSkate':'SKATING',
|
||||
'WeightTraining':'STRENGTH_TRAINING',
|
||||
'InlineSkate':'INLINE_SKATING',
|
||||
'Kayaking':'PADDLING',
|
||||
'Workout':'OTHER',
|
||||
'Yoga':'OTHER',
|
||||
'other':'OTHER',
|
||||
garminmapping = {key:value for key,value in Reverse(garmincollection)}
|
||||
|
||||
})
|
||||
stcollection = (
|
||||
('water','Rowing'),
|
||||
('rower','Rowing'),
|
||||
('skierg','Skiing:Nordic'),
|
||||
('Bike','Cycling'),
|
||||
('bikeerg','Cycling'),
|
||||
('dynamic','Rowing'),
|
||||
('slides','Rowing'),
|
||||
('paddle','Other:Paddling'),
|
||||
('snow','Skiing:Nordic'),
|
||||
('coastal','Rowing'),
|
||||
('c-boat','Rowing'),
|
||||
('churchboat','Rowing'),
|
||||
('Ride','Cycling'),
|
||||
('Run','Running'),
|
||||
('NordicSki','Skiing:Nordic'),
|
||||
('Swim','Swimming'),
|
||||
('Hike','Hiking'),
|
||||
('RollerSki','Other:RollerSki'),
|
||||
('Walk','Other:Walk'),
|
||||
('Canoeing','Other:Canoeing'),
|
||||
('Crossfit','Other:Crossfit'),
|
||||
('StandUpPaddling','Other:StandUpPaddling'),
|
||||
('IceSkate','Skating'),
|
||||
('WeightTraining','Other:WeightTraining'),
|
||||
('InlineSkate','Skating:InlineSkate'),
|
||||
('Kayaking','Other:Kayaking'),
|
||||
('Workout','Other:Workout'),
|
||||
('Yoga','Other'),
|
||||
('other','Other'),
|
||||
)
|
||||
|
||||
stmapping = collections.OrderedDict({
|
||||
'water':'Rowing',
|
||||
'rower':'Rowing',
|
||||
'skierg':'Skiing:Nordic',
|
||||
'Bike':'Cycling',
|
||||
'bikeerg':'Cycling',
|
||||
'dynamic':'Rowing',
|
||||
'slides':'Rowing',
|
||||
'paddle':'Other:Paddling',
|
||||
'snow':'Skiing:Nordic',
|
||||
'coastal':'Rowing',
|
||||
'c-boat':'Rowing',
|
||||
'churchboat':'Rowing',
|
||||
'Ride':'Cycling',
|
||||
'Run':'Running',
|
||||
'NordicSki':'Skiing:Nordic',
|
||||
'Swim':'Swimming',
|
||||
'Hike':'Hiking',
|
||||
'RollerSki':'Other:RollerSki',
|
||||
'Walk':'Other:Walk',
|
||||
'Canoeing':'Other:Canoeing',
|
||||
'Crossfit':'Other:Crossfit',
|
||||
'StandUpPaddling':'Other:StandUpPaddling',
|
||||
'IceSkate':'Skating',
|
||||
'WeightTraining':'Other:WeightTraining',
|
||||
'InlineSkate':'Skating:InlineSkate',
|
||||
'Kayaking':'Other:Kayaking',
|
||||
'Workout':'Other:Workout',
|
||||
'Yoga':'Other',
|
||||
'other':'Other',
|
||||
stmapping = {key:value for key,value in Reverse(stcollection)}
|
||||
|
||||
})
|
||||
rkcollection = (
|
||||
('water','Rowing'),
|
||||
('rower','Rowing'),
|
||||
('skierg','Cross-Country Skiing'),
|
||||
('Bike','Cycling'),
|
||||
('bikeerg','Cycling'),
|
||||
('dynamic','Rowing'),
|
||||
('slides','Rowing'),
|
||||
('paddle','Other:Paddling'),
|
||||
('snow','Cross-Country Skiing'),
|
||||
('coastal','Rowing'),
|
||||
('c-boat','Rowing'),
|
||||
('churchboat','Rowing'),
|
||||
('Ride','Cycling'),
|
||||
('Run','Running'),
|
||||
('NordicSki','Cross-Country Skiing'),
|
||||
('Swim','Swimming'),
|
||||
('Hike','Hiking'),
|
||||
('Walk','Walking'),
|
||||
('Canoeing','Other'),
|
||||
('Crossfit','CrossFit'),
|
||||
('StandUpPaddling','Other'),
|
||||
('IceSkate','Skating'),
|
||||
('WeightTraining','Other'),
|
||||
('InlineSkate','Skating'),
|
||||
('Kayaking','Other'),
|
||||
('Workout','Other'),
|
||||
('other','Other'),
|
||||
('Yoga','Other'),
|
||||
)
|
||||
|
||||
rkmapping = collections.OrderedDict({
|
||||
'water':'Rowing',
|
||||
'rower':'Rowing',
|
||||
'skierg':'Cross-Country Skiing',
|
||||
'Bike':'Cycling',
|
||||
'bikeerg':'Cycling',
|
||||
'dynamic':'Rowing',
|
||||
'slides':'Rowing',
|
||||
'paddle':'Other:Paddling',
|
||||
'snow':'Cross-Country Skiing',
|
||||
'coastal':'Rowing',
|
||||
'c-boat':'Rowing',
|
||||
'churchboat':'Rowing',
|
||||
'Ride':'Cycling',
|
||||
'Run':'Running',
|
||||
'NordicSki':'Cross-Country Skiing',
|
||||
'Swim':'Swimming',
|
||||
'Hike':'Hiking',
|
||||
'Walk':'Walking',
|
||||
'Canoeing':'Other',
|
||||
'Crossfit':'CrossFit',
|
||||
'StandUpPaddling':'Other',
|
||||
'IceSkate':'Skating',
|
||||
'WeightTraining':'Other',
|
||||
'InlineSkate':'Skating',
|
||||
'Kayaking':'Other',
|
||||
'Workout':'Other',
|
||||
'other':'Other',
|
||||
'Yoga':'Other',
|
||||
})
|
||||
rkmapping = {key:value for key,value in Reverse(rkcollection)}
|
||||
|
||||
polarmapping = collections.OrderedDict({
|
||||
'water':'Rowing',
|
||||
'rower':'Rowing',
|
||||
'skierg':'Skiing',
|
||||
'Bike':'Cycling',
|
||||
'bikeerg':'Cycling',
|
||||
'dynamic':'Rowing',
|
||||
'slides':'Rowing',
|
||||
'paddle':'Other Outdoor',
|
||||
'snow':'Skiing',
|
||||
'coastal':'Rowing',
|
||||
'c-boat':'Rowing',
|
||||
'churchboat':'Rowing',
|
||||
'Ride':'Cycling',
|
||||
'Run':'Running',
|
||||
'NordicSki':'Skiing',
|
||||
'Swim':'Swimming',
|
||||
'Hike':'Hiking',
|
||||
'Walk':'Walking',
|
||||
'Canoeing':'Canoeing',
|
||||
'Crossfit':'Crossfit',
|
||||
'StandUpPaddling':'Other Outdoor',
|
||||
'IceSkate':'Skating',
|
||||
'WeightTraining':'Strength training',
|
||||
'InlineSkate':'Skating',
|
||||
'Kayaking':'Kayaking',
|
||||
'Workout':'Other Indoor',
|
||||
'other':'Other Indoor',
|
||||
'Yoga':'Yoga',
|
||||
})
|
||||
polarcollection = (
|
||||
('water','Rowing'),
|
||||
('rower','Rowing'),
|
||||
('skierg','Skiing'),
|
||||
('Bike','Cycling'),
|
||||
('bikeerg','Cycling'),
|
||||
('dynamic','Rowing'),
|
||||
('slides','Rowing'),
|
||||
('paddle','Other Outdoor'),
|
||||
('snow','Skiing'),
|
||||
('coastal','Rowing'),
|
||||
('c-boat','Rowing'),
|
||||
('churchboat','Rowing'),
|
||||
('Ride','Cycling'),
|
||||
('Run','Running'),
|
||||
('NordicSki','Skiing'),
|
||||
('Swim','Swimming'),
|
||||
('Hike','Hiking'),
|
||||
('Walk','Walking'),
|
||||
('Canoeing','Canoeing'),
|
||||
('Crossfit','Crossfit'),
|
||||
('StandUpPaddling','Other Outdoor'),
|
||||
('IceSkate','Skating'),
|
||||
('WeightTraining','Strength training'),
|
||||
('InlineSkate','Skating'),
|
||||
('Kayaking','Kayaking'),
|
||||
('Workout','Other Indoor'),
|
||||
('other','Other Indoor'),
|
||||
('Yoga','Yoga'),
|
||||
)
|
||||
|
||||
tpmapping = collections.OrderedDict({
|
||||
'water':'rowing',
|
||||
'rower':'rowing',
|
||||
'skierg':'xc-ski',
|
||||
'Bike':'bike',
|
||||
'Bikeerg':'bike',
|
||||
'dynamic':'rowing',
|
||||
'slides':'rowing',
|
||||
'paddle':'other',
|
||||
'snow':'xc-ski',
|
||||
'coastal':'rowing',
|
||||
'c-boat':'rowing',
|
||||
'churchboat':'rowing',
|
||||
'Ride':'cycling',
|
||||
'Run':'run',
|
||||
'NordicSki':'xc-ski',
|
||||
'Swim':'swim',
|
||||
'Hike':'other',
|
||||
'Walk':'walk',
|
||||
'Canoeing':'other',
|
||||
'Crossfit':'other',
|
||||
'StandUpPaddling':'other',
|
||||
'IceSkate':'other',
|
||||
'WeightTraining':'strength',
|
||||
'InlineSkate':'other',
|
||||
'Kayaking':'other',
|
||||
'Workout':'other',
|
||||
'other':'other',
|
||||
'Yoga':'other',
|
||||
})
|
||||
polarmapping = {key:value for key,value in Reverse(polarcollection)}
|
||||
|
||||
c2mapping = collections.OrderedDict({
|
||||
'water':'water',
|
||||
'rower':'rower',
|
||||
'skierg':'skierg',
|
||||
'Bike':'bike',
|
||||
'bikeerg':'bike',
|
||||
'dynamic':'dynamic',
|
||||
'slides':'slides',
|
||||
'paddle':'paddle',
|
||||
'snow':'snow',
|
||||
'coastal':'water',
|
||||
'c-boat':'water',
|
||||
'churchboat':'water',
|
||||
'Ride':'bike',
|
||||
'Run':None,
|
||||
'NordicSki':'snow',
|
||||
'Swim':None,
|
||||
'Hike':None,
|
||||
'Walk':None,
|
||||
'Canoeing':'paddle',
|
||||
'Crossfit':None,
|
||||
'StandUpPaddling':None,
|
||||
'IceSkate':None,
|
||||
'WeightTraining':None,
|
||||
'InlineSkate':None,
|
||||
'Kayaking':None,
|
||||
'Workout':None,
|
||||
'other':None,
|
||||
'Yoga':None,
|
||||
tpcollection = (
|
||||
('water','rowing'),
|
||||
('rower','rowing'),
|
||||
('skierg','xc-ski'),
|
||||
('Bike','bike'),
|
||||
('Bikeerg','bike'),
|
||||
('dynamic','rowing'),
|
||||
('slides','rowing'),
|
||||
('paddle','other'),
|
||||
('snow','xc-ski'),
|
||||
('coastal','rowing'),
|
||||
('c-boat','rowing'),
|
||||
('churchboat','rowing'),
|
||||
('Ride','cycling'),
|
||||
('Run','run'),
|
||||
('NordicSki','xc-ski'),
|
||||
('Swim','swim'),
|
||||
('Hike','other'),
|
||||
('Walk','walk'),
|
||||
('Canoeing','other'),
|
||||
('Crossfit','other'),
|
||||
('StandUpPaddling','other'),
|
||||
('IceSkate','other'),
|
||||
('WeightTraining','strength'),
|
||||
('InlineSkate','other'),
|
||||
('Kayaking','other'),
|
||||
('Workout','other'),
|
||||
('other','other'),
|
||||
('Yoga','other'),
|
||||
)
|
||||
|
||||
})
|
||||
tpmapping = {key:value for key,value in Reverse(tpcollection)}
|
||||
|
||||
c2mappinginv = {value:key for key,value in reversed(c2mapping.items()) if value is not None}
|
||||
c2collection = (
|
||||
('water','water'),
|
||||
('rower','rower'),
|
||||
('skierg','skierg'),
|
||||
('Bike','bike'),
|
||||
('bikeerg','bike'),
|
||||
('dynamic','dynamic'),
|
||||
('slides','slides'),
|
||||
('paddle','paddle'),
|
||||
('snow','snow'),
|
||||
('coastal','water'),
|
||||
('c-boat','water'),
|
||||
('churchboat','water'),
|
||||
('Ride','bike'),
|
||||
('Run',None),
|
||||
('NordicSki','snow'),
|
||||
('Swim',None),
|
||||
('Hike',None),
|
||||
('Walk',None),
|
||||
('Canoeing','paddle'),
|
||||
('Crossfit',None),
|
||||
('StandUpPaddling',None),
|
||||
('IceSkate',None),
|
||||
('WeightTraining',None),
|
||||
('InlineSkate',None),
|
||||
('Kayaking',None),
|
||||
('Workout',None),
|
||||
('other',None),
|
||||
('Yoga',None),
|
||||
)
|
||||
|
||||
stravamappinginv = {value:key for key,value in reversed(stravamapping.items()) if value is not None}
|
||||
c2mapping = {key:value for key,value in Reverse(c2collection)}
|
||||
c2mappinginv = {value:key for key,value in Reverse(c2collection) if value is not None}
|
||||
|
||||
stmappinginv = {value:key for key,value in reversed(stmapping.items()) if value is not None}
|
||||
stravamappinginv = {value:key for key,value in Reverse(stravacollection) if value is not None}
|
||||
|
||||
rkmappinginv = {value:key for key,value in reversed(rkmapping.items()) if value is not None}
|
||||
stmappinginv = {value:key for key,value in Reverse(stcollection) if value is not None}
|
||||
|
||||
polarmappinginv = {value:key for key,value in reversed(polarmapping.items()) if value is not None}
|
||||
rkmappinginv = {value:key for key,value in Reverse(rkcollection) if value is not None}
|
||||
|
||||
garminmappinginv = {value:key for key, value in reversed(garminmapping.items()) if value is not None}
|
||||
polarmappinginv = {value:key for key,value in Reverse(polarcollection) if value is not None}
|
||||
|
||||
garminmappinginv = {value:key for key, value in Reverse(garmincollection) if value is not None}
|
||||
|
||||
otwtypes = (
|
||||
'water',
|
||||
|
||||
Reference in New Issue
Block a user