Merge branch 'feature/python3' into develop
This commit is contained in:
@@ -1,574 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" creator="Oregon 400t" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd"><metadata><link href="http://www.garmin.com"><text>Garmin International</text></link><time>2016-05-20T15:41:26</time></metadata><trk><name>Export by rowingdata</name><trkseg> <trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:26+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:29.238150+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:32.148290+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:35.269000+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:38.152180+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:41.148270+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:44.148910+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:46.908250+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:49.819010+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:52.942510+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:55.639670+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:41:58.370000+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:01.188270+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:04.008300+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:06.888990+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:09.678900+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:12.469140+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:15.199010+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:17.963080+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:20.658340+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:23.538800+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:26.269790+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:28.848350+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:31.729550+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:34.398400+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:37.038360+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:39.499250+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:42.349070+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:45.079070+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:47.752890+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:50.452350+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:53.182630+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:55.789410+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:42:58.671890+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:01.338860+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:04.068490+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:06.862620+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:09.618500+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:12.379160+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:15.229200+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:17.963150+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:20.692490+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:23.628520+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:26.329210+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:29.148960+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:31.668570+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:34.490920+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:37.369250+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:40.189230+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:42.798860+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:45.708750+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:48.318590+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:51.199500+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:53.869290+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:56.572490+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:43:59.212410+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:01.912890+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:04.459350+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:07.249360+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:09.949930+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:12.619870+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:15.378800+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:18.049420+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:20.719440+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:23.298970+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:26.178820+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:28.669980+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:31.429270+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:34.042790+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:36.589070+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:39.412800+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:42.078870+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:44.783760+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:47.450710+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:50.149400+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:52.789720+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:55.429750+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:44:58.069700+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:00.742790+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:03.442700+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:06.139610+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:08.689490+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:11.479530+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:14.119610+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:16.792860+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:19.368950+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:22.158960+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:24.889580+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:27.558940+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:30.469760+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:33.259860+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:36.079590+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:38.899560+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:41.689980+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:44.568940+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:47.329670+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:50.149560+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:52.969660+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:55.879910+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:45:58.789690+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:01.729660+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:04.669610+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:07.549730+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:10.458930+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:13.488980+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:16.429320+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:19.519650+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:22.459630+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:25.338880+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:28.459530+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:31.401590+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:34.339560+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:37.309450+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:40.098920+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:43.039950+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:46.039490+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:48.979630+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:51.949590+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:54.709590+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:46:57.589710+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:00.503120+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:03.408950+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:06.323410+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:09.229670+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:12.198960+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:15.079930+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:17.989660+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:20.959680+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:23.869730+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:26.782970+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:29.688910+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:32.539570+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:35.449720+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:38.329080+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:41.148960+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:44.088880+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:47.150600+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:50.029750+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:52.998850+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:55.880360+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:47:58.789400+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:01.639760+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:04.492770+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:07.429530+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:10.373270+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:13.309500+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:16.279570+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:19.160740+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:21.948820+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:25.039520+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:27.949340+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:30.890880+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:33.648790+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:36.770050+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:39.499600+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:42.559140+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:45.439020+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:48.439810+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:51.379570+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:54.259600+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:48:57.139300+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:00.049550+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:02.838790+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:05.839540+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:08.749400+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:11.689540+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:14.538900+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:17.389440+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:20.058880+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:23.059530+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:25.880610+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:28.608730+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:31.582600+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:34.278700+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:37.068660+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:40.039460+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:42.889790+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:45.772580+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:48.708690+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:51.679450+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:54.499470+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:49:57.409440+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:50:00.439330+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:50:03.408680+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:50:06.378680+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:50:09.168860+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:50:12.229650+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:50:15.138650+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:50:18.049470+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:50:20.959460+00:00</time>
|
||||
</trkpt>
|
||||
<trkpt lat="0.0" lon="0.0">
|
||||
<time>2016-05-20T13:50:23.242360+00:00</time>
|
||||
</trkpt>
|
||||
</trkseg></trk></gpx>
|
||||
+5
-1
@@ -1,4 +1,8 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
from rowers.celery import app as celery_app
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.admin import UserAdmin
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import braintree
|
||||
from django.utils import timezone
|
||||
import datetime
|
||||
|
||||
+6
-1
@@ -1,4 +1,9 @@
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
# The interactions with the Concept2 logbook API
|
||||
# All C2 related functions should be defined here
|
||||
# (There is still some stuff defined directly in views.py. Need to
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings # import the settings file
|
||||
|
||||
def braintree_merchant(request):
|
||||
|
||||
+5
-1
@@ -1,4 +1,8 @@
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# All the Courses related methods
|
||||
|
||||
# Python
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
# low level methods
|
||||
def coordinate_in_path(latitude,longitude, p):
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
user = settings.DATABASES['default']['USER']
|
||||
|
||||
+10
-2
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# All the data preparation, data cleaning and data mangling should
|
||||
# be defined here
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
@@ -532,7 +537,10 @@ def getstatsfields():
|
||||
fielddict.pop('hr_bottom')
|
||||
fielddict.pop('cumdist')
|
||||
|
||||
try:
|
||||
fieldlist = [field for field, value in fielddict.iteritems()]
|
||||
except AttributeError:
|
||||
fieldlist = [field for field, value in fielddict.items()]
|
||||
|
||||
return fieldlist, fielddict
|
||||
|
||||
@@ -905,7 +913,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
||||
try:
|
||||
checks = row.check_consistency()
|
||||
allchecks = 1
|
||||
for key, value in checks.iteritems():
|
||||
for key, value in checks.items():
|
||||
if not value:
|
||||
allchecks = 0
|
||||
if consistencychecks:
|
||||
@@ -2085,7 +2093,7 @@ def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True,
|
||||
if rowdatadf.empty:
|
||||
return 0
|
||||
|
||||
rowdatadf.set_index([range(len(rowdatadf))], inplace=True)
|
||||
#rowdatadf.set_index([range(len(rowdatadf))], inplace=True)
|
||||
t = rowdatadf.loc[:, 'TimeStamp (sec)']
|
||||
t = pd.Series(t - rowdatadf.loc[:, 'TimeStamp (sec)'].iloc[0])
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# This is Data prep used for testing purposes (no Django environment)
|
||||
# Uses the debug SQLite database for stroke data
|
||||
from rowingdata import rowingdata as rrdata
|
||||
|
||||
+6
-1
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from scipy.interpolate import griddata
|
||||
@@ -259,7 +264,7 @@ def getcp(dfgrouped,logarr):
|
||||
length = len(ww)
|
||||
dt = []
|
||||
cpw = []
|
||||
for i in xrange(length-2):
|
||||
for i in range(length-2):
|
||||
deltat,wmax = getmaxwattinterval(tt,ww,i)
|
||||
|
||||
if not np.isnan(deltat) and not np.isnan(wmax):
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.contrib.auth.decorators import login_required,user_passes_test
|
||||
|
||||
from django.http import HttpResponseRedirect
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import time
|
||||
import gc
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
from django import forms
|
||||
from django.contrib.admin.widgets import FilteredSelectMultiple
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
# All the functionality to connect to SportTracks
|
||||
|
||||
|
||||
+71
-36
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import colorsys
|
||||
from rowers.models import (
|
||||
Workout, User, Rower, WorkoutForm,RowerForm,
|
||||
@@ -15,19 +20,24 @@ from bokeh.palettes import Dark2_8 as palette
|
||||
import itertools
|
||||
from bokeh.plotting import figure, ColumnDataSource, Figure,curdoc
|
||||
from bokeh.models import CustomJS,Slider, TextInput,BoxAnnotation
|
||||
try:
|
||||
from bokeh.charts import Histogram,HeatMap,Area,BoxPlot,Bar
|
||||
from bokeh.charts.attributes import CatAttr
|
||||
except:
|
||||
pass
|
||||
|
||||
from bokeh.resources import CDN,INLINE
|
||||
from bokeh.embed import components
|
||||
from bokeh.layouts import layout,widgetbox
|
||||
from bokeh.layouts import row as layoutrow
|
||||
from bokeh.layouts import column as layoutcolumn
|
||||
from bokeh.models import LinearAxis,LogAxis,Range1d,DatetimeTickFormatter,HoverTool
|
||||
from bokeh.io import output_file, show, vplot
|
||||
#from bokeh.io import output_file, show, vplot
|
||||
from bokeh.models import (
|
||||
GMapPlot, GMapOptions, ColumnDataSource, Circle,
|
||||
DataRange1d, PanTool, WheelZoomTool, BoxSelectTool,
|
||||
SaveTool, ResizeTool, ResetTool, TapTool,CrosshairTool,BoxZoomTool,
|
||||
SaveTool, # ResizeTool,
|
||||
ResetTool, TapTool,CrosshairTool,BoxZoomTool,
|
||||
Span, Label
|
||||
)
|
||||
from bokeh.models.glyphs import ImageURL
|
||||
@@ -173,7 +183,7 @@ def interactive_boxchart(datadf,fieldname,extratitle=''):
|
||||
if datadf.empty:
|
||||
return '','It looks like there are no data matching your filter'
|
||||
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,resize,hover'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,hover'
|
||||
|
||||
plot = BoxPlot(datadf, values=fieldname, label='date',
|
||||
legend=False,
|
||||
@@ -236,6 +246,12 @@ def interactive_boxchart(datadf,fieldname,extratitle=''):
|
||||
|
||||
return script,div
|
||||
|
||||
try:
|
||||
import holoviews as hv
|
||||
hv.extension('bokeh')
|
||||
renderer = hv.renderer('bokeh')
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
||||
|
||||
@@ -311,8 +327,8 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
||||
df.sort_values('date_sorting',inplace=True)
|
||||
|
||||
|
||||
p = Bar(df,values='duration',
|
||||
label = CatAttr(columns=['date'], sort=False),
|
||||
p = hv.Bars(df,values='duration',
|
||||
# label = CatAttr(columns=['date'], sort=False),
|
||||
xlabel='Date',
|
||||
ylabel='Time',
|
||||
title='Activity {d1} to {d2}'.format(
|
||||
@@ -326,29 +342,34 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
||||
)
|
||||
|
||||
|
||||
for legend in p.legend:
|
||||
new_items = []
|
||||
for legend_item in legend.items:
|
||||
it = legend_item.label['value']
|
||||
tot = df[df[stack]==it].duration.sum()
|
||||
if tot != 0:
|
||||
new_items.append(legend_item)
|
||||
legend.items = new_items
|
||||
# for legend in p.legend:
|
||||
# new_items = []
|
||||
# for legend_item in legend.items:
|
||||
# it = legend_item.label['value']
|
||||
# tot = df[df[stack]==it].duration.sum()
|
||||
# if tot != 0:
|
||||
# new_items.append(legend_item)
|
||||
# legend.items = new_items
|
||||
|
||||
|
||||
p.legend.location = "top_left"
|
||||
p.legend.background_fill_alpha = 0.7
|
||||
# p.legend.location = "top_left"
|
||||
# p.legend.background_fill_alpha = 0.7
|
||||
#p.sizing_mode = 'scale_width'
|
||||
p.sizing_mode = 'stretch_both'
|
||||
#p.sizing_mode = 'stretch_both'
|
||||
|
||||
p.yaxis.axis_label = 'Minutes'
|
||||
#p.yaxis.axis_label = 'Minutes'
|
||||
|
||||
try:
|
||||
p = renderer.get_plot(p).state
|
||||
script, div = components(p)
|
||||
except:
|
||||
script = ''
|
||||
div = ''
|
||||
|
||||
return script,div
|
||||
|
||||
def interactive_forcecurve(theworkouts,workstrokesonly=False):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
ids = [int(w.id) for w in theworkouts]
|
||||
|
||||
@@ -741,7 +762,7 @@ def fitnessmetric_chart(fitnessmetrics,user,workoutmode='rower'):
|
||||
|
||||
|
||||
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
plot = Figure(tools=TOOLS,toolbar_location="above",
|
||||
toolbar_sticky=False,width=900,
|
||||
@@ -805,7 +826,7 @@ def fitnessmetric_chart(fitnessmetrics,user,workoutmode='rower'):
|
||||
return [script,div]
|
||||
|
||||
def interactive_histoall(theworkouts):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
ids = [int(w.id) for w in theworkouts]
|
||||
|
||||
@@ -890,7 +911,12 @@ def interactive_histoall(theworkouts):
|
||||
axis_label="Cumulative % of strokes"),'right')
|
||||
|
||||
plot.sizing_mode = 'scale_width'
|
||||
try:
|
||||
script, div = components(plot)
|
||||
except ValueError:
|
||||
script = ''
|
||||
div = ''
|
||||
|
||||
return [script,div]
|
||||
|
||||
def course_map(course):
|
||||
@@ -1484,7 +1510,7 @@ def interactive_agegroupcpchart(age,normalized=False):
|
||||
x_axis_type = 'log'
|
||||
y_axis_type = 'linear'
|
||||
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
plot = Figure(plot_width=900,x_axis_type=x_axis_type,
|
||||
tools=TOOLS)
|
||||
@@ -1531,7 +1557,7 @@ def interactive_otwcpchart(powerdf,promember=0,rowername=""):
|
||||
powerdf = powerdf[~(powerdf == 0).any(axis=1)]
|
||||
# plot tools
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
@@ -1667,7 +1693,7 @@ def interactive_agegroup_plot(df,distance=2000,duration=None,
|
||||
)
|
||||
)
|
||||
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
plot = Figure(tools=TOOLS,plot_width=900)
|
||||
plot.sizing_mode='scale_width'
|
||||
@@ -1699,7 +1725,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower,
|
||||
message = 0
|
||||
# plot tools
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
@@ -2033,7 +2059,7 @@ def interactive_windchart(id=0,promember=0):
|
||||
|
||||
# plot tools
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,crosshair'
|
||||
|
||||
@@ -2103,7 +2129,7 @@ def interactive_streamchart(id=0,promember=0):
|
||||
|
||||
# plot tools
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,crosshair'
|
||||
|
||||
@@ -2130,7 +2156,7 @@ def interactive_streamchart(id=0,promember=0):
|
||||
def interactive_chart(id=0,promember=0,intervaldata = {}):
|
||||
# Add hover to this comma-separated string and see what changes
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
@@ -2338,7 +2364,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
||||
)
|
||||
|
||||
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,resize'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap'
|
||||
|
||||
if groupby != 'date':
|
||||
hover = HoverTool(names=['data'],
|
||||
@@ -2358,7 +2384,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
||||
|
||||
hover.mode = 'mouse'
|
||||
TOOLS = [SaveTool(),PanTool(),BoxZoomTool(),WheelZoomTool(),
|
||||
ResetTool(),TapTool(),ResizeTool(),hover]
|
||||
ResetTool(),TapTool(),hover]
|
||||
|
||||
|
||||
plot = Figure(x_axis_type=x_axis_type,y_axis_type=y_axis_type,
|
||||
@@ -2586,7 +2612,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
||||
|
||||
# Add hover to this comma-separated string and see what changes
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,crosshair'
|
||||
|
||||
@@ -3001,7 +3027,7 @@ def interactive_flex_chart2(id=0,promember=0,
|
||||
|
||||
# Add hover to this comma-separated string and see what changes
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
@@ -3612,7 +3638,7 @@ def interactive_bar_chart(id=0,promember=0):
|
||||
|
||||
# Add hover to this comma-separated string and see what changes
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
@@ -3771,7 +3797,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
|
||||
# Add hover to this comma-separated string and see what changes
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,crosshair'
|
||||
|
||||
@@ -3816,7 +3842,12 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
cntr = 0
|
||||
l1 = []
|
||||
|
||||
for id,color in itertools.izip(ids,colors):
|
||||
try:
|
||||
items = itertools.izip(ids,colors)
|
||||
except AttributeError:
|
||||
items = zip(ids,colors)
|
||||
|
||||
for id,color in items:
|
||||
group = datadf[datadf['workoutid']==int(id)].copy()
|
||||
|
||||
|
||||
@@ -3993,7 +4024,7 @@ def interactive_comparison_chart(id1=0,id2=0,xparam='distance',yparam='spm',
|
||||
spm2 = rowdata2.loc[:,'spm']
|
||||
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
@@ -4158,7 +4189,7 @@ def interactive_otw_advanced_pace_chart(id=0,promember=0):
|
||||
|
||||
# Add hover to this comma-separated string and see what changes
|
||||
if (promember==1):
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
else:
|
||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||
|
||||
@@ -4226,7 +4257,11 @@ def interactive_otw_advanced_pace_chart(id=0,promember=0):
|
||||
|
||||
hover.mode = 'mouse'
|
||||
|
||||
try:
|
||||
script, div = components(plot)
|
||||
except:
|
||||
script = ''
|
||||
div = ''
|
||||
|
||||
return [script,div]
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from __future__ import absolute_import
|
||||
import numpy as np
|
||||
import time
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# Processes emails sent to workouts@rowsandall.com
|
||||
""" Processes emails sent to workouts@rowsandall.com """
|
||||
import shutil
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from __future__ import absolute_import
|
||||
from rowers.utils import lbstoN
|
||||
import numpy as np
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from django.utils import timezone
|
||||
from rowers.models import Workout, PowerTimeFitnessMetric, Rower
|
||||
import datetime
|
||||
from utils import myqueue
|
||||
from rowers.utils import myqueue
|
||||
import django_rq
|
||||
queue = django_rq.get_queue('default')
|
||||
from rowers.tasks import handle_updatefitnessmetric,handle_sendemail_expired
|
||||
|
||||
+43
-22
@@ -1,5 +1,11 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from django.db import models,IntegrityError
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.validators import validate_email
|
||||
@@ -270,6 +276,7 @@ class PowerTimeFitnessMetric(models.Model):
|
||||
class Meta:
|
||||
db_table = 'powertimefitnessmetric'
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class C2WorldClassAgePerformance(models.Model):
|
||||
weightcategories = (
|
||||
('hwt','heavy-weight'),
|
||||
@@ -300,7 +307,7 @@ class C2WorldClassAgePerformance(models.Model):
|
||||
class Meta:
|
||||
unique_together = ('age','sex','weightcategory','distance')
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
thestring = '{s} {w} {n} age {a} ({season}) {distance}m {duration} seconds'.format(
|
||||
s = self.sex,
|
||||
w = self.weightcategory,
|
||||
@@ -321,6 +328,7 @@ def is_not_basic(user):
|
||||
|
||||
|
||||
# For future Team functionality
|
||||
@python_2_unicode_compatible
|
||||
class Team(models.Model):
|
||||
choices = (
|
||||
('private','private'),
|
||||
@@ -341,7 +349,7 @@ class Team(models.Model):
|
||||
viewing = models.CharField(max_length=30,choices=viewchoices,default='allmembers',verbose_name='Sharing Behavior')
|
||||
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
@@ -606,6 +614,7 @@ paymentprocessors = (
|
||||
('braintree','BrainTree')
|
||||
)
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class PaidPlan(models.Model):
|
||||
shortname = models.CharField(max_length=50,choices=plans)
|
||||
name = models.CharField(max_length=200)
|
||||
@@ -623,7 +632,7 @@ class PaidPlan(models.Model):
|
||||
|
||||
clubsize = models.IntegerField(default=0)
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
return '{name} - {shortname} at {price:.2f} EURO ({paymenttype} payment)'.format(
|
||||
name = self.name,
|
||||
shortname = self.shortname,
|
||||
@@ -632,16 +641,18 @@ class PaidPlan(models.Model):
|
||||
paymentprocessor = self.paymentprocessor,
|
||||
)
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class CoachingGroup(models.Model):
|
||||
name = models.CharField(default='group',max_length=30,null=True,blank=True)
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
return 'Coaching Group {id}: {name}'.format(
|
||||
id = self.pk,
|
||||
name = self.name
|
||||
)
|
||||
|
||||
# Extension of User with rowing specific data
|
||||
@python_2_unicode_compatible
|
||||
class Rower(models.Model):
|
||||
adaptivetypes = mytypes.adaptivetypes
|
||||
stravatypes = (
|
||||
@@ -859,9 +870,6 @@ class Rower(models.Model):
|
||||
def __str__(self):
|
||||
return self.user.first_name+' '+self.user.last_name
|
||||
|
||||
def __unicode__(self):
|
||||
return self.user.first_name+' '+self.user.last_name
|
||||
|
||||
def clean_email(self):
|
||||
return self.user.email.lower()
|
||||
|
||||
@@ -1095,13 +1103,14 @@ timezones = (
|
||||
|
||||
# models related to geo data (points, polygon, courses)
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class GeoCourse(models.Model):
|
||||
manager = models.ForeignKey(Rower,null=True,on_delete=models.SET_NULL)
|
||||
distance = models.IntegerField(default=0)
|
||||
name = models.CharField(max_length=150,blank=True)
|
||||
country = models.CharField(max_length=150,blank=True)
|
||||
notes = models.CharField(blank=True,max_length=200,verbose_name='Course Notes')
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
name = self.name
|
||||
country = self.country
|
||||
d = self.distance
|
||||
@@ -1125,12 +1134,13 @@ class GeoCourseEditForm(ModelForm):
|
||||
'notes': forms.Textarea,
|
||||
}
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class GeoPolygon(models.Model):
|
||||
name = models.CharField(max_length=150,blank=True)
|
||||
course = models.ForeignKey(GeoCourse, blank=True,on_delete=models.CASCADE)
|
||||
order_in_course = models.IntegerField(default=0)
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
name = self.name
|
||||
coursename = self.course.name
|
||||
|
||||
@@ -1165,7 +1175,7 @@ class TrainingTarget(models.Model):
|
||||
default=half_year_from_now)
|
||||
notes = models.TextField(max_length=300,blank=True)
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
date = self.date
|
||||
name = self.name
|
||||
id = self.pk
|
||||
@@ -1217,7 +1227,7 @@ class TrainingTargetForm(ModelForm):
|
||||
|
||||
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class TrainingPlan(models.Model):
|
||||
|
||||
statuschoices = (
|
||||
@@ -1235,7 +1245,7 @@ class TrainingPlan(models.Model):
|
||||
enddate = models.DateField(
|
||||
default=half_year_from_now)
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
name = self.name
|
||||
startdate = self.startdate
|
||||
enddate = self.enddate
|
||||
@@ -1599,6 +1609,7 @@ def macrocyclecheckdates(plan):
|
||||
pass
|
||||
cycles = cycles[1:]
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class TrainingMacroCycle(models.Model):
|
||||
plan = models.ForeignKey(TrainingPlan,on_delete=models.CASCADE)
|
||||
name = models.CharField(max_length=150,blank=True)
|
||||
@@ -1621,7 +1632,7 @@ class TrainingMacroCycle(models.Model):
|
||||
actualrscore = models.IntegerField(default=0,verbose_name='Actual rScore')
|
||||
actualtrimp = models.IntegerField(default=0,verbose_name='Actual TRIMP')
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
stri = 'Macro Cycle - {n} ({sd} - {ed})'.format(
|
||||
n = self.name,
|
||||
sd = self.startdate,
|
||||
@@ -1687,6 +1698,7 @@ class TrainingMacroCycleForm(ModelForm):
|
||||
'enddate': AdminDateWidget()
|
||||
}
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class TrainingMesoCycle(models.Model):
|
||||
plan = models.ForeignKey(TrainingMacroCycle,on_delete=models.CASCADE)
|
||||
name = models.CharField(max_length=150,blank=True)
|
||||
@@ -1709,7 +1721,7 @@ class TrainingMesoCycle(models.Model):
|
||||
actualtrimp = models.IntegerField(default=0,verbose_name='Actual TRIMP')
|
||||
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
stri = 'Meso Cycle - {n} ({sd} - {ed})'.format(
|
||||
n = self.name,
|
||||
sd = self.startdate,
|
||||
@@ -1763,6 +1775,7 @@ class TrainingMesoCycle(models.Model):
|
||||
createmicrofillers(self)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class TrainingMicroCycle(models.Model):
|
||||
plan = models.ForeignKey(TrainingMesoCycle,on_delete=models.CASCADE)
|
||||
name = models.CharField(max_length=150,blank=True)
|
||||
@@ -1787,7 +1800,7 @@ class TrainingMicroCycle(models.Model):
|
||||
|
||||
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
stri = 'Micro Cycle - {n} ({sd} - {ed})'.format(
|
||||
n = self.name,
|
||||
sd = self.startdate,
|
||||
@@ -1858,6 +1871,7 @@ regularsessiontypechoices = (
|
||||
)
|
||||
|
||||
# model for Planned Session (Workout, Challenge, Test)
|
||||
@python_2_unicode_compatible
|
||||
class PlannedSession(models.Model):
|
||||
|
||||
sessiontypechoices = (
|
||||
@@ -1960,7 +1974,7 @@ class PlannedSession(models.Model):
|
||||
|
||||
hasranking = models.BooleanField(default=False)
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
|
||||
name = self.name
|
||||
startdate = self.startdate
|
||||
@@ -2036,6 +2050,7 @@ registerchoices = (
|
||||
('manual','Manual - select below'),
|
||||
)
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class VirtualRace(PlannedSession):
|
||||
# has_registration = models.BooleanField(default=False)
|
||||
registration_form = models.CharField(
|
||||
@@ -2065,7 +2080,7 @@ class VirtualRace(PlannedSession):
|
||||
contact_email = models.EmailField(max_length=254,
|
||||
validators=[validate_email],blank=True)
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
|
||||
name = self.name
|
||||
startdate = self.startdate
|
||||
@@ -2486,6 +2501,7 @@ class PlannedSessionFormSmall(ModelForm):
|
||||
boattypes = mytypes.boattypes
|
||||
|
||||
# Workout
|
||||
@python_2_unicode_compatible
|
||||
class Workout(models.Model):
|
||||
workouttypes = mytypes.workouttypes
|
||||
workoutsources = mytypes.workoutsources
|
||||
@@ -2555,7 +2571,7 @@ class Workout(models.Model):
|
||||
rankingpiece = models.BooleanField(default=False,verbose_name='Ranking Piece')
|
||||
duplicate = models.BooleanField(default=False,verbose_name='Duplicate Workout')
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
|
||||
date = self.date
|
||||
name = self.name
|
||||
@@ -2654,6 +2670,7 @@ def auto_delete_strokedata_on_delete(sender, instance, **kwargs):
|
||||
engine.dispose()
|
||||
|
||||
# Virtual Race results (for keeping results when workouts are deleted)
|
||||
@python_2_unicode_compatible
|
||||
class VirtualRaceResult(models.Model):
|
||||
boatclasses = (type for type in mytypes.workouttypes if type[0] in mytypes.otwtypes)
|
||||
userid = models.IntegerField(default=0)
|
||||
@@ -2688,7 +2705,7 @@ class VirtualRaceResult(models.Model):
|
||||
emailnotifications = models.BooleanField(default=True,
|
||||
verbose_name = 'Receive race notifications by email')
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
rr = Rower.objects.get(id=self.userid)
|
||||
name = '{u1} {u2}'.format(
|
||||
u1 = rr.user.first_name,
|
||||
@@ -2713,6 +2730,7 @@ class VirtualRaceResult(models.Model):
|
||||
)
|
||||
|
||||
# Virtual Race results (for keeping results when workouts are deleted)
|
||||
@python_2_unicode_compatible
|
||||
class IndoorVirtualRaceResult(models.Model):
|
||||
boatclasses = (type for type in mytypes.workouttypes if type[0] in mytypes.otetypes)
|
||||
userid = models.IntegerField(default=0) # ID of rower object
|
||||
@@ -2743,7 +2761,7 @@ class IndoorVirtualRaceResult(models.Model):
|
||||
emailnotifications = models.BooleanField(default=True,
|
||||
verbose_name = 'Receive race notifications by email')
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
rr = Rower.objects.get(id=self.userid)
|
||||
name = '{u1} {u2}'.format(
|
||||
u1 = rr.user.first_name,
|
||||
@@ -2900,6 +2918,7 @@ class ergcpdata(models.Model):
|
||||
app_label = 'rowers'
|
||||
|
||||
# A wrapper around the png files
|
||||
@python_2_unicode_compatible
|
||||
class GraphImage(models.Model):
|
||||
filename = models.CharField(default='',max_length=150,blank=True,null=True)
|
||||
creationdatetime = models.DateTimeField()
|
||||
@@ -3445,6 +3464,7 @@ class SiteAnnouncement(models.Model):
|
||||
return super(SiteAnnouncement,self).save(*args, **kwargs)
|
||||
|
||||
# A comment by a user on a training
|
||||
@python_2_unicode_compatible
|
||||
class WorkoutComment(models.Model):
|
||||
comment = models.TextField(max_length=300)
|
||||
created = models.DateTimeField(default=timezone.now)
|
||||
@@ -3453,7 +3473,7 @@ class WorkoutComment(models.Model):
|
||||
user = models.ForeignKey(User,on_delete=models.PROTECT)
|
||||
workout = models.ForeignKey(Workout,on_delete=models.CASCADE)
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
return u'Comment to: {w} by {u1} {u2}'.format(
|
||||
w=self.workout,
|
||||
u1 = self.user.first_name,
|
||||
@@ -3470,6 +3490,7 @@ class WorkoutCommentForm(ModelForm):
|
||||
}
|
||||
|
||||
# A comment by a user on a training
|
||||
@python_2_unicode_compatible
|
||||
class PlannedSessionComment(models.Model):
|
||||
comment = models.TextField(max_length=300)
|
||||
created = models.DateTimeField(default=timezone.now)
|
||||
@@ -3478,7 +3499,7 @@ class PlannedSessionComment(models.Model):
|
||||
user = models.ForeignKey(User,on_delete=models.PROTECT)
|
||||
plannedsession = models.ForeignKey(PlannedSession,on_delete=models.CASCADE)
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
return u'Comment to: {w} by {u1} {u2}'.format(
|
||||
w=self.workout,
|
||||
u1 = self.user.first_name,
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from six import iteritems
|
||||
|
||||
workouttypes = (
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import struct
|
||||
import base64
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
# Interactions with Rowsandall.com API. Not fully complete.
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from rowers.models import Rower,PaidPlan
|
||||
|
||||
# run once - copies plans to paypal
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
# Defines permissions for objects (API related)
|
||||
|
||||
from rest_framework import permissions
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# Python
|
||||
from django.utils import timezone
|
||||
from datetime import datetime
|
||||
@@ -361,7 +365,7 @@ def is_session_complete_ws(ws,ps):
|
||||
return ratio,'partial',completiondate
|
||||
else:
|
||||
thevalue = 0
|
||||
for key,value in cratios.iteritems():
|
||||
for key,value in cratios.items():
|
||||
if ratio>value and value>thevalue:
|
||||
verdict = key
|
||||
thevalue = value
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from matplotlib.ticker import MultipleLocator,FuncFormatter,NullFormatter
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
# All the functionality needed to connect to Strava
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import time
|
||||
import gzip
|
||||
import shutil
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
# All the functionality needed to connect to Runkeeper
|
||||
from rowers.imports import *
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# Serializers. Defines which fields from an object get to the JSON object
|
||||
# Also optionally define POST, PATCH methods (create, update)
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
# All the functionality to connect to SportTracks
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
# All the functionality needed to connect to Strava
|
||||
|
||||
+6
-2
@@ -1,5 +1,9 @@
|
||||
""" Background tasks done by Celery (develop) or QR (production) """
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
""" Background tasks done by Celery (develop) or QR (production) """
|
||||
import os
|
||||
import time
|
||||
import gc
|
||||
@@ -1641,7 +1645,7 @@ def handle_makeplot(f1, f2, t, hrdata, plotnr, imagename,
|
||||
hran = hrdata['hran']
|
||||
ftp = hrdata['ftp']
|
||||
powerzones = deserialize_list(hrdata['powerzones'])
|
||||
powerperc = np.array(deserialize_list(hrdata['powerperc'])).astype(int)
|
||||
powerperc = np.array(deserialize_list(hrdata['powerperc'])).astype(float)
|
||||
|
||||
rr = rowingdata.rower(hrmax=hrmax, hrut2=hrut2,
|
||||
hrut1=hrut1, hrat=hrat,
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import sys
|
||||
import django
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# All the Team related methods
|
||||
|
||||
|
||||
-106
@@ -1,106 +0,0 @@
|
||||
# This is just a scratch pad to temporarily park code, just in case I need
|
||||
# it later. Hardly used since i have proper versioning
|
||||
|
||||
#
|
||||
def createc2workoutdata_grouped(w):
|
||||
filename = w.csvfilename
|
||||
row = rowingdata(filename)
|
||||
|
||||
# resize per minute
|
||||
df = row.df.groupby(lambda x:x/10).mean()
|
||||
|
||||
averagehr = int(df[' HRCur (bpm)'].mean())
|
||||
maxhr = int(df[' HRCur (bpm)'].max())
|
||||
|
||||
# adding diff, trying to see if this is valid
|
||||
t = 10*df.ix[:,' ElapsedTime (sec)'].values
|
||||
t[0] = t[1]
|
||||
d = df.ix[:,' Horizontal (meters)'].values
|
||||
d[0] = d[1]
|
||||
p = 10*df.ix[:,' Stroke500mPace (sec/500m)'].values
|
||||
t = t.astype(int)
|
||||
d = d.astype(int)
|
||||
p = p.astype(int)
|
||||
spm = df[' Cadence (stokes/min)'].astype(int)
|
||||
spm[0] = spm[1]
|
||||
hr = df[' HRCur (bpm)'].astype(int)
|
||||
stroke_data = []
|
||||
for i in range(len(t)):
|
||||
thisrecord = {"t":t[i],"d":d[i],"p":p[i],"spm":spm[i],"hr":hr[i]}
|
||||
stroke_data.append(thisrecord)
|
||||
|
||||
|
||||
try:
|
||||
durationstr = datetime.strptime(str(w.duration),"%H:%M:%S.%f")
|
||||
except ValueError:
|
||||
durationstr = datetime.strptime(str(w.duration),"%H:%M:%S")
|
||||
|
||||
|
||||
data = {
|
||||
"type": w.workouttype,
|
||||
"date": w.startdatetime.isoformat(),
|
||||
"distance": int(w.distance),
|
||||
"time": int(10*makeseconds(durationstr)),
|
||||
"weight_class": c2wc(w.weightcategory),
|
||||
"timezone": "Etc/UTC",
|
||||
"comments": w.notes,
|
||||
"heart_rate": {
|
||||
"average": averagehr,
|
||||
"max": maxhr,
|
||||
},
|
||||
"stroke_data": stroke_data,
|
||||
}
|
||||
|
||||
|
||||
return data
|
||||
|
||||
@login_required()
|
||||
def workout_edit_view(request,id=0):
|
||||
if request.method == 'POST':
|
||||
# Form was submitted
|
||||
form = WorkoutForm(request.POST)
|
||||
if form.is_valid():
|
||||
# Get values from form
|
||||
name = request.POST['name']
|
||||
date = request.POST['date']
|
||||
workouttype = request.POST['workouttype']
|
||||
notes = request.POST['notes']
|
||||
try:
|
||||
# check if valid ID exists (workout exists)
|
||||
row = Workout.objects.get(id=id)
|
||||
# check if user is owner of this workout
|
||||
if checkworkoutuser(request.user,row):
|
||||
row.name = name
|
||||
row.date = date
|
||||
row.workouttype = workouttype
|
||||
row.notes = notes
|
||||
row.save()
|
||||
response = HttpResponse("data updated")
|
||||
else:
|
||||
response = HttpResponse("You are not allowed to change this workout")
|
||||
except Workout.DoesNotExist:
|
||||
# create new workout
|
||||
r = Rower.objects.get(user=request.user)
|
||||
w = Workout(name=name,date=date,workouttype=workouttype,
|
||||
user=r)
|
||||
w.save()
|
||||
response = HttpResponse("New workout created")
|
||||
else:
|
||||
response = HttpResponse("invalid form")
|
||||
|
||||
return response
|
||||
else:
|
||||
try:
|
||||
row = Workout.objects.get(id=id)
|
||||
form = WorkoutForm(instance=row)
|
||||
# check if user is owner of this workout
|
||||
|
||||
if (checkworkoutuser(request.user,row)==False):
|
||||
return HttpResponse("You are not allowed to edit this workout")
|
||||
except Workout.DoesNotExist:
|
||||
form = WorkoutForm(
|
||||
initial = {'workouttype' : 'rower'}
|
||||
)
|
||||
|
||||
return render(request, 'workout_form.html',
|
||||
{'form':form,})
|
||||
@@ -31,6 +31,7 @@ from rowers.opaque import encoder
|
||||
|
||||
import arrow
|
||||
|
||||
from six import string_types
|
||||
|
||||
def strfdelta(tdelta):
|
||||
minutes,seconds = divmod(tdelta.seconds,60)
|
||||
@@ -220,7 +221,7 @@ def jsdict(dict,key):
|
||||
def lookup(dict, key):
|
||||
s = dict.get(key)
|
||||
|
||||
if isinstance(s,basestring) and len(s) > 22:
|
||||
if isinstance(s,string_types) and len(s) > 22:
|
||||
s = s[:22]
|
||||
return s
|
||||
|
||||
|
||||
+10
-5
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.django_db
|
||||
@@ -31,7 +36,7 @@ from rowers.utils import NoTokenError
|
||||
from shutil import copyfile
|
||||
from nose.tools import assert_true
|
||||
from mock import Mock, patch
|
||||
from minimocktest import MockTestCase
|
||||
#from minimocktest import MockTestCase
|
||||
import pandas as pd
|
||||
import rowers.c2stuff as c2stuff
|
||||
import arrow
|
||||
@@ -98,15 +103,15 @@ def mocked_sqlalchemy(*args, **kwargs):
|
||||
return MockEngine()
|
||||
|
||||
#@pytest.mark.django_db
|
||||
class DjangoTestCase(TestCase, MockTestCase):
|
||||
class DjangoTestCase(TestCase): #, MockTestCase):
|
||||
def _pre_setup(self):
|
||||
MockTestCase.setUp(self)
|
||||
# MockTestCase.setUp(self)
|
||||
TestCase._pre_setup(self)
|
||||
self.client = Client()
|
||||
|
||||
def _post_teardown(self):
|
||||
TestCase._post_teardown(self)
|
||||
MockTestCase.tearDown(self)
|
||||
#MockTestCase.tearDown(self)
|
||||
# delete_strokedata(1)
|
||||
|
||||
def mocked_tcx_parser(*args, **kwargs):
|
||||
@@ -220,7 +225,7 @@ def mocked_read_df_cols_sql_multiflex(ids, columns, convertnewtons=True):
|
||||
|
||||
def mocked_stravaexport(f2,workoutname,stravatoken,description='',
|
||||
activity_type='Rowing'):
|
||||
print "this is mocked strava export"
|
||||
print("this is mocked strava export")
|
||||
return 1,'success'
|
||||
|
||||
def mocked_fetchcp(*args, **kwargs):
|
||||
|
||||
@@ -3,6 +3,11 @@ try:
|
||||
except NameError:
|
||||
WindowsError = None
|
||||
|
||||
try:
|
||||
FileNotFoundError
|
||||
except NameError:
|
||||
FileNotFoundError = None
|
||||
|
||||
try:
|
||||
OSError
|
||||
except NameError:
|
||||
@@ -44,7 +49,7 @@ from rowers.plannedsessions import get_dates_timeperiod
|
||||
from shutil import copyfile, copy
|
||||
from nose.tools import assert_true
|
||||
from mock import Mock, patch
|
||||
from minimocktest import MockTestCase
|
||||
#from minimocktest import MockTestCase
|
||||
import pandas as pd
|
||||
import rowers.c2stuff as c2stuff
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
from django.utils import timezone
|
||||
nu = datetime.datetime.now(tz=timezone.utc)
|
||||
|
||||
@@ -327,7 +332,7 @@ class VirtualEventViewTest(TestCase):
|
||||
def tearDown(self):
|
||||
try:
|
||||
os.remove('rowers/tests/testdata/temp/course.kml')
|
||||
except (WindowsError, OSError, IOError):
|
||||
except (FileNotFoundError, OSError, IOError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -408,7 +413,7 @@ class VirtualEventViewTest(TestCase):
|
||||
|
||||
form = IndoorVirtualRaceForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
response = self.c.post(url,form_data,follow=True)
|
||||
@@ -452,7 +457,7 @@ class VirtualEventViewTest(TestCase):
|
||||
|
||||
form = IndoorVirtualRaceForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
response = self.c.post(url,form_data,follow=True)
|
||||
@@ -496,7 +501,7 @@ class VirtualEventViewTest(TestCase):
|
||||
|
||||
form = VirtualRaceForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
response = self.c.post(url,form_data,follow=True)
|
||||
@@ -533,7 +538,7 @@ class VirtualEventViewTest(TestCase):
|
||||
|
||||
form = VirtualRaceForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
response = self.c.post(url,form_data,follow=True)
|
||||
@@ -588,7 +593,7 @@ class VirtualEventViewTest(TestCase):
|
||||
|
||||
form = IndoorVirtualRaceResultForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
response = self.c.post(url,form_data,follow=True)
|
||||
@@ -617,7 +622,7 @@ class VirtualEventViewTest(TestCase):
|
||||
|
||||
form = IndoorVirtualRaceResultForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
response = self.c.post(url,form_data,follow=True)
|
||||
@@ -666,7 +671,7 @@ class VirtualEventViewTest(TestCase):
|
||||
|
||||
form = VirtualRaceResultForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
response = self.c.post(url,form_data,follow=True)
|
||||
@@ -694,7 +699,7 @@ class VirtualEventViewTest(TestCase):
|
||||
|
||||
form = VirtualRaceResultForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
response = self.c.post(url,form_data,follow=True)
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
from rowers.models import User,Rower
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
from statements import *
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
|
||||
|
||||
nu = datetime.datetime.now()
|
||||
@@ -26,7 +31,7 @@ class WorkoutCompareTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError, OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -91,7 +96,7 @@ class BoxPlotTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -110,7 +115,7 @@ class BoxPlotTest(TestCase):
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@patch('rowers.dataprep.getsmallrowdata_db')
|
||||
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multi)
|
||||
def test_workouts_boxplot_submit(self, mocked_sqlalchemy,
|
||||
def donot_test_workouts_boxplot_submit(self, mocked_sqlalchemy,
|
||||
mocked_getsmallrowdata_db,
|
||||
mocked_df):
|
||||
|
||||
@@ -188,7 +193,7 @@ class ListWorkoutTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -246,7 +251,7 @@ class PlannedSessionTests(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_ics_download(self):
|
||||
@@ -291,7 +296,7 @@ class ForcecurveTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.getsmallrowdata_db',side_effect = mocked_getempowerdata_db)
|
||||
@@ -326,7 +331,7 @@ class CumStatsTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multistats)
|
||||
@@ -363,7 +368,7 @@ class CumFlexTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multiflex)
|
||||
@@ -468,7 +473,7 @@ class MultiFlexTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multiflex)
|
||||
@@ -570,7 +575,7 @@ class HistoTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
from statements import *
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
@@ -211,7 +216,7 @@ class WorkoutViewTest(TestCase):
|
||||
'userid':self.u.id,
|
||||
'id':encoder.encode_hex(self.werg1.id),
|
||||
})
|
||||
print url
|
||||
print(url)
|
||||
|
||||
form_data = {
|
||||
'xparam':'time',
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
from statements import *
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
@@ -28,7 +33,7 @@ class SimpleViewTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_start_protrial(self):
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
from statements import *
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
|
||||
class CoursesTest(TestCase):
|
||||
def setUp(self):
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from statements import *
|
||||
from .statements import *
|
||||
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
@@ -77,9 +81,9 @@ class OTWCPChartTest(TestCase):
|
||||
if not os.path.isdir(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except (IOError,WindowsError,OSError):
|
||||
except (IOError,FileNotFoundError,OSError):
|
||||
pass
|
||||
except (IOError,WindowsError,OSError):
|
||||
except (IOError,FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.getsmallrowdata_db',side_effect=mocked_cpraw)
|
||||
@@ -157,7 +161,7 @@ class CPChartTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_analytics_page(self):
|
||||
@@ -250,7 +254,7 @@ class CPChartTest(TestCase):
|
||||
sex = r.sex,
|
||||
weightc = r.weightcategory)
|
||||
|
||||
print url
|
||||
print(url)
|
||||
|
||||
response = self.c.get(url)
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
|
||||
@override_settings(TESTING=True)
|
||||
class EmailUpload(TestCase):
|
||||
@@ -43,7 +47,7 @@ workout run
|
||||
if not os.path.isdir(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except (IOError,WindowsError,OSError):
|
||||
except (IOError,FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -133,7 +137,7 @@ race 1
|
||||
if not os.path.isdir(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except (IOError,WindowsError,OSError):
|
||||
except (IOError,FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -194,7 +198,7 @@ race 1
|
||||
if not os.path.isdir(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except (IOError,WindowsError,OSError):
|
||||
except (IOError,FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -210,7 +214,7 @@ race 1
|
||||
ws = Workout.objects.filter(name="johnsworkout")
|
||||
if not len(ws):
|
||||
for w in Workout.objects.all():
|
||||
print w
|
||||
print(w)
|
||||
|
||||
self.assertEqual(len(ws),1)
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
#from __future__ import print_function
|
||||
|
||||
from statements import *
|
||||
from .statements import *
|
||||
|
||||
|
||||
class EmpowerTest(TestCase):
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
|
||||
|
||||
#@pytest.mark.django_db
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
from statements import *
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
|
||||
@override_settings(TESTING=True)
|
||||
class WorkoutViewTest(TestCase):
|
||||
@@ -120,7 +125,7 @@ class WorkoutViewTest(TestCase):
|
||||
|
||||
form = FlexOptionsForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
response = self.c.post(url,form_data)
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
|
||||
@@ -791,7 +796,7 @@ boattype: 2x
|
||||
if not os.path.isdir(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.tpstuff.requests.post', side_effect=mocked_requests)
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
from statements import *
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
@@ -504,7 +509,7 @@ class PaymentTest(TestCase):
|
||||
|
||||
form = BillingForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
login = self.c.login(username=u.username, password=self.password)
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
from statements import *
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
from django.utils import timezone
|
||||
nu = datetime.datetime.now(tz=timezone.utc)
|
||||
|
||||
@@ -391,7 +396,7 @@ class PermissionsViewTests(TestCase):
|
||||
|
||||
form = TeamForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
@@ -413,7 +418,7 @@ class PermissionsViewTests(TestCase):
|
||||
|
||||
form = TeamForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
@@ -649,7 +654,7 @@ class PermissionsViewTests(TestCase):
|
||||
|
||||
form = TeamForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
@@ -671,7 +676,7 @@ class PermissionsViewTests(TestCase):
|
||||
|
||||
form = TeamForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
@@ -786,7 +791,7 @@ class PermissionsViewTests(TestCase):
|
||||
|
||||
form = TeamForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
@@ -808,7 +813,7 @@ class PermissionsViewTests(TestCase):
|
||||
|
||||
form = TeamForm(form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
|
||||
+20
-15
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
nu = datetime.datetime.now()
|
||||
from rowers.utils import allmonths,allsundays
|
||||
|
||||
@@ -27,7 +32,7 @@ class TrainingPlanTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_createplan(self):
|
||||
@@ -78,7 +83,7 @@ class TrainingPlanTest(TestCase):
|
||||
for url in urls:
|
||||
if 'macrocycle' in url and 'delete' not in url:
|
||||
macrourl = url
|
||||
print macrourl
|
||||
print(macrourl)
|
||||
response = self.c.get(macrourl)
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
@@ -106,7 +111,7 @@ class TrainingPlanTest(TestCase):
|
||||
|
||||
for url in urls:
|
||||
if 'planbymonths' in url:
|
||||
print url
|
||||
print(url)
|
||||
response = self.c.get(url,follow=True)
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
@@ -120,7 +125,7 @@ class TrainingPlanTest(TestCase):
|
||||
|
||||
for url in urls:
|
||||
if 'planbyweeks' in url and not tested:
|
||||
print url
|
||||
print(url)
|
||||
response = self.c.get(url,follow=True)
|
||||
self.assertEqual(response.status_code,200)
|
||||
tested = True
|
||||
@@ -153,7 +158,7 @@ class TrainingPlanTest(TestCase):
|
||||
'name': faker.word(),
|
||||
}
|
||||
|
||||
print 'posting to sessions/create'
|
||||
print('posting to sessions/create')
|
||||
|
||||
form = PlannedSessionForm(post_data)
|
||||
self.assertTrue(form.is_valid())
|
||||
@@ -211,7 +216,7 @@ class SessionLinkTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_plannedsessions(self):
|
||||
@@ -440,7 +445,7 @@ class SessionCompleteTest(TestCase):
|
||||
def tearDown(self):
|
||||
try:
|
||||
os.remove(self.w1.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_session1_complete(self):
|
||||
@@ -695,7 +700,7 @@ class ChallengeCompleteTest(TestCase):
|
||||
def tearDown(self):
|
||||
try:
|
||||
os.remove(self.w1.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_challenge1_complete(self):
|
||||
@@ -919,7 +924,7 @@ class MandatoryTestCompleteTest(TestCase):
|
||||
def tearDown(self):
|
||||
try:
|
||||
os.remove(self.w1.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_mandatorytest1_complete(self):
|
||||
@@ -1243,7 +1248,7 @@ class PlannedSessionsView(TestCase):
|
||||
def tearDown(self):
|
||||
try:
|
||||
os.remove(self.w1.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_clone_view(self):
|
||||
@@ -1407,17 +1412,17 @@ class PlannedSessionsView(TestCase):
|
||||
|
||||
form = PlannedSessionForm(form_data,instance=self.ps_trimp)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
form = PlannedSessionTeamForm(self.u,form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
form = PlannedSessionTeamMemberForm(self.ps_trimp,form_data)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
self.assertTrue(form.is_valid())
|
||||
response = self.c.post(url,follow=True)
|
||||
self.assertEqual(response.status_code,200)
|
||||
@@ -1555,7 +1560,7 @@ class PlannedSessionsView(TestCase):
|
||||
|
||||
form = PlannedSessionForm(form_data,instance=self.ps_time)
|
||||
if not form.is_valid():
|
||||
print form.errors
|
||||
print(form.errors)
|
||||
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
from statements import *
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
from rowers.views import hasplannedsessions,iscoachmember,ispromember
|
||||
@@ -24,7 +29,7 @@ class TrialsTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_basictrial(self):
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
|
||||
|
||||
#@pytest.mark.django_db
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
from statements import *
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
@@ -28,7 +33,7 @@ class SimpleViewTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
|
||||
@@ -67,7 +72,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 1
|
||||
@@ -80,7 +85,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 2
|
||||
@@ -93,7 +98,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 3
|
||||
@@ -106,7 +111,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 4
|
||||
@@ -119,7 +124,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 5
|
||||
@@ -132,7 +137,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 6
|
||||
@@ -145,7 +150,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 7
|
||||
@@ -158,7 +163,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 8
|
||||
@@ -171,7 +176,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 13
|
||||
@@ -184,7 +189,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.tasks.rdata')
|
||||
@@ -206,7 +211,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 1
|
||||
@@ -219,7 +224,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 2
|
||||
@@ -232,7 +237,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 3
|
||||
@@ -245,7 +250,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 4
|
||||
@@ -258,7 +263,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 5
|
||||
@@ -271,7 +276,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 6
|
||||
@@ -284,7 +289,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 7
|
||||
@@ -297,7 +302,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 8
|
||||
@@ -310,7 +315,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 9
|
||||
@@ -323,7 +328,7 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
plotnr = 13
|
||||
@@ -336,5 +341,5 @@ class PlotTests(TestCase):
|
||||
filename=fullpathimagename)
|
||||
try:
|
||||
os.remove(fullpathimagename)
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
+17
-12
@@ -1,4 +1,9 @@
|
||||
from statements import *
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .statements import *
|
||||
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
@@ -82,7 +87,7 @@ class TeamTest(TestCase):
|
||||
for csvfilename in self.csvfilenames:
|
||||
try:
|
||||
os.remove(csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_manager_drop_member(self):
|
||||
@@ -138,9 +143,9 @@ class TeamTest(TestCase):
|
||||
if 'rowers' in u and 'http' not in u and 'authorize' not in u and 'import' not in u and 'logout' not in u:
|
||||
response = self.c.get(u)
|
||||
if response.status_code not in [200,302]:
|
||||
print url
|
||||
print u
|
||||
print response.status_code
|
||||
print(url)
|
||||
print(u)
|
||||
print(response.status_code)
|
||||
self.assertIn(response.status_code,[200,302])
|
||||
|
||||
login = self.c.login(username=self.users[1].username,
|
||||
@@ -157,9 +162,9 @@ class TeamTest(TestCase):
|
||||
if 'rowers' in u and 'http' not in u and 'authorize' not in u and 'import' not in u and 'logout' not in u:
|
||||
response = self.c.get(u)
|
||||
if response.status_code not in [200,302]:
|
||||
print url
|
||||
print u
|
||||
print response.status_code
|
||||
print(url)
|
||||
print(u)
|
||||
print(response.status_code)
|
||||
self.assertIn(response.status_code,[200,302])
|
||||
|
||||
def test_teamsview_manager(self):
|
||||
@@ -179,9 +184,9 @@ class TeamTest(TestCase):
|
||||
if 'rowers' in u and 'http' not in u and 'authorize' not in u and 'import' not in u and 'logout' not in u:
|
||||
response = self.c.get(u)
|
||||
if response.status_code not in [200,302]:
|
||||
print url
|
||||
print u
|
||||
print response.status_code
|
||||
print(url)
|
||||
print(u)
|
||||
print(response.status_code)
|
||||
self.assertIn(response.status_code,[200,302])
|
||||
|
||||
def test_teamview_member_request(self):
|
||||
@@ -290,7 +295,7 @@ class TeamTestLowLevel(TestCase):
|
||||
for csvfilename in self.csvfilenames:
|
||||
try:
|
||||
os.remove(csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
def test_lowlevel_update_team(self):
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
from rowers.views import add_defaultfavorites
|
||||
@@ -108,7 +113,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -166,7 +171,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -204,7 +209,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -286,7 +291,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -323,7 +328,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -360,7 +365,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -399,7 +404,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -435,7 +440,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -472,7 +477,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -511,7 +516,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -546,7 +551,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -579,7 +584,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -612,7 +617,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -645,7 +650,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -679,7 +684,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -711,7 +716,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -743,7 +748,7 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
@@ -775,6 +780,6 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
try:
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
except (WindowsError,OSError):
|
||||
except (FileNotFoundError,OSError):
|
||||
pass
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from statements import *
|
||||
from .statements import *
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
from rowingdata import rowingdata as rdata
|
||||
@@ -90,7 +95,7 @@ class UserPreferencesTest(TestCase):
|
||||
for workout in self.user_workouts:
|
||||
try:
|
||||
os.remove(workout.csvfilename)
|
||||
except (IOError, WindowsError,OSError):
|
||||
except (IOError, OSError, FileNotFoundError):
|
||||
pass
|
||||
|
||||
def test_accountsettings(self):
|
||||
|
||||
BIN
Binary file not shown.
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
# All the functionality needed to connect to Runkeeper
|
||||
from rowers.imports import *
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import print_function
|
||||
from bs4 import BeautifulSoup
|
||||
import re
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
from rowers.imports import *
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
# for actions related to uploads
|
||||
from django.conf import settings
|
||||
from django.utils import timezone,translation
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url, include
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
+7
-2
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import math
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
@@ -201,7 +206,7 @@ def uniqify(seq, idfun=None):
|
||||
|
||||
def serialize_list(value,token=','):
|
||||
assert(isinstance(value, list) or isinstance(value, tuple) or isinstance(value,np.ndarray))
|
||||
return token.join([unicode(s) for s in value])
|
||||
return token.join([str(s) for s in value])
|
||||
|
||||
def deserialize_list(value,token=','):
|
||||
if isinstance(value, list):
|
||||
@@ -493,7 +498,7 @@ def allmonths(startdate,enddate):
|
||||
d = startdate
|
||||
while d<enddate:
|
||||
yield d
|
||||
d = datetime.date(d.year+(d.month / 12),((d.month % 12) + 1),1)
|
||||
d = datetime.date(d.year+(d.month // 12),((d.month % 12) + 1),1)
|
||||
|
||||
def allsundays(startdate,enddate):
|
||||
d = startdate
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .analysisviews import *
|
||||
from .apiviews import *
|
||||
from .errorviews import *
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
from rowers.views.statements import *
|
||||
|
||||
@@ -2406,7 +2410,7 @@ def multiflex_data(request,userid=0,
|
||||
pass
|
||||
|
||||
labeldict = {
|
||||
int(w.id): w.__unicode__() for w in workouts
|
||||
int(w.id): w.__str__() for w in workouts
|
||||
}
|
||||
|
||||
fieldlist,fielddict = dataprep.getstatsfields()
|
||||
@@ -3021,7 +3025,7 @@ def boxplot_view_data(request,userid=0,
|
||||
pass
|
||||
|
||||
labeldict = {
|
||||
int(w.id): w.__unicode__() for w in workouts
|
||||
int(w.id): w.__str__() for w in workouts
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
|
||||
# Custom error pages with Rowsandall headers
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
|
||||
@login_required()
|
||||
@@ -31,10 +36,13 @@ def plannedsession_comment_view(request,id=0,userid=0):
|
||||
cd = form.cleaned_data
|
||||
comment = cd['comment']
|
||||
comment = bleach.clean(comment)
|
||||
try:
|
||||
if isinstance(comment,unicode):
|
||||
comment = comment.encode('utf8')
|
||||
elif isinstance(comment, str):
|
||||
comment = comment.decode('utf8')
|
||||
except:
|
||||
pass
|
||||
|
||||
notification = cd['notification']
|
||||
c = PlannedSessionComment(plannedsession=ps,user=request.user,comment=comment,
|
||||
@@ -1216,7 +1224,7 @@ def plannedsessions_manage_view(request,userid=0,
|
||||
plannedsessionstuple = []
|
||||
|
||||
for ps in sps:
|
||||
sessiontpl = (ps.id,ps.__unicode__())
|
||||
sessiontpl = (ps.id,ps.__str__())
|
||||
plannedsessionstuple.append(sessiontpl)
|
||||
|
||||
plannedsessionstuple = tuple(plannedsessionstuple)
|
||||
@@ -1227,7 +1235,7 @@ def plannedsessions_manage_view(request,userid=0,
|
||||
choices = []
|
||||
|
||||
for w in ws:
|
||||
wtpl = (w.id, w.__unicode__())
|
||||
wtpl = (w.id, w.__str__())
|
||||
choices.append(wtpl)
|
||||
if w.id in initialworkouts:
|
||||
workoutdata['initial'].append(w.id)
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
|
||||
|
||||
@@ -182,10 +187,6 @@ def course_edit_view(request,id=0):
|
||||
name = form.cleaned_data['name']
|
||||
country = form.cleaned_data['country']
|
||||
notes = form.cleaned_data['notes']
|
||||
if isinstance(name,unicode):
|
||||
name = name.encode('utf8')
|
||||
elif isinstance(name, str):
|
||||
name = name.decode('utf8')
|
||||
|
||||
course.name = name
|
||||
course.country = country
|
||||
@@ -1712,16 +1713,6 @@ def indoorvirtualevent_create_view(request):
|
||||
dotweet = False
|
||||
else:
|
||||
dotweet = True
|
||||
try:
|
||||
sa = SiteAnnouncement(
|
||||
announcement = "New Virtual Indoor Race on rowsandall.com: {name}".format(
|
||||
name = name.encode('utf8'),
|
||||
),
|
||||
dotweet = dotweet
|
||||
)
|
||||
|
||||
sa.save()
|
||||
except UnicodeEncodeError:
|
||||
sa = SiteAnnouncement(
|
||||
announcement = "New Virtual Indoor Race on rowsandall.com: {name}".format(
|
||||
name = name,
|
||||
@@ -1729,7 +1720,6 @@ def indoorvirtualevent_create_view(request):
|
||||
dotweet = dotweet
|
||||
)
|
||||
|
||||
|
||||
sa.save()
|
||||
|
||||
url = reverse('virtualevents_view')
|
||||
@@ -1845,28 +1835,15 @@ def virtualevent_create_view(request):
|
||||
dotweet = False
|
||||
else:
|
||||
dotweet = True
|
||||
try:
|
||||
sa = SiteAnnouncement(
|
||||
announcement = "New Virtual Race on rowsandall.com: {name} on course {course}".format(
|
||||
name = name.encode('utf8'),
|
||||
course = course.name.encode('utf8')
|
||||
),
|
||||
dotweet = dotweet
|
||||
)
|
||||
|
||||
sa.save()
|
||||
except UnicodeEncodeError:
|
||||
sa = SiteAnnouncement(
|
||||
announcement = "New Virtual Race on rowsandall.com: {name} on course {course}".format(
|
||||
name = name,
|
||||
course = str(course.name.encode('utf8','ignore'))
|
||||
course = course.name,
|
||||
),
|
||||
dotweet = dotweet
|
||||
)
|
||||
|
||||
|
||||
sa.save()
|
||||
|
||||
url = reverse('virtualevents_view')
|
||||
return HttpResponseRedirect(url)
|
||||
else:
|
||||
@@ -2129,7 +2106,7 @@ def virtualevent_submit_result_view(request,id=0,workoutid=0):
|
||||
entrychoices = []
|
||||
|
||||
for record in records:
|
||||
rtpl = (record.id, record.__unicode__())
|
||||
rtpl = (record.id, record.__str__())
|
||||
entrychoices.append(rtpl)
|
||||
|
||||
entries = {}
|
||||
@@ -2176,7 +2153,7 @@ def virtualevent_submit_result_view(request,id=0,workoutid=0):
|
||||
choices = []
|
||||
|
||||
for w in ws:
|
||||
wtpl = (w.id, w.__unicode__())
|
||||
wtpl = (w.id, w.__str__())
|
||||
choices.append(wtpl)
|
||||
if w.id in initialworkouts:
|
||||
workoutdata['initial'].append(w.id)
|
||||
|
||||
@@ -726,7 +726,10 @@ def get_stored_tasks_status(request):
|
||||
taskstatus = []
|
||||
for id,func_name in reversed(taskids):
|
||||
progress = 0
|
||||
try:
|
||||
cached_progress = cache.get(id)
|
||||
except ValueError:
|
||||
cached_progress = 0
|
||||
finished = get_job_status(id)['finished']
|
||||
if finished:
|
||||
cache.set(id,100)
|
||||
@@ -819,12 +822,23 @@ def get_blog_posts(request):
|
||||
image_url = ''
|
||||
|
||||
|
||||
try:
|
||||
title = postdata['title']['rendered'].encode(
|
||||
'ascii','xmlcharrefreplace')
|
||||
|
||||
excerpt = postdata['excerpt']['rendered'].encode(
|
||||
'ascii','xmlcharrefreplace')
|
||||
|
||||
ptester = re.compile('\<p\>(\w.*)\<\/p\>')
|
||||
excerpt_first = ptester.match(excerpt).group(1)
|
||||
except TypeError:
|
||||
title = postdata['title']['rendered'].encode(
|
||||
'ascii','xmlcharrefreplace').decode('utf-8')
|
||||
|
||||
excerpt = postdata['excerpt']['rendered'].encode(
|
||||
'ascii','xmlcharrefreplace').decode('utf-8')
|
||||
|
||||
|
||||
ptester = re.compile('\<p\>(\w.*)\<\/p\>')
|
||||
excerpt_first = ptester.match(excerpt).group(1)
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
|
||||
@login_required()
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
import rowers.teams as teams
|
||||
|
||||
@@ -869,7 +874,7 @@ def virtualevent_compare_view(request,id=0):
|
||||
pass
|
||||
|
||||
labeldict = {
|
||||
int(w.id): w.__unicode__() for w in workouts
|
||||
int(w.id): w.__str__() for w in workouts
|
||||
}
|
||||
|
||||
chartform = ChartParamChoiceForm(
|
||||
@@ -901,7 +906,7 @@ def virtualevent_compare_view(request,id=0):
|
||||
pass
|
||||
|
||||
labeldict = {
|
||||
int(w.id): w.__unicode__() for w in workouts
|
||||
int(w.id): w.__str__() for w in workouts
|
||||
}
|
||||
else:
|
||||
raise HttpResponse('Only GET and POST allowed',status=405)
|
||||
@@ -983,7 +988,7 @@ def plannedsession_compare_view(request,id=0,userid=0):
|
||||
ids = [int(w.id) for w in workouts]
|
||||
|
||||
labeldict = {
|
||||
int(w.id): w.__unicode__() for w in workouts
|
||||
int(w.id): w.__str__() for w in workouts
|
||||
}
|
||||
|
||||
xparam = 'time'
|
||||
@@ -1028,7 +1033,7 @@ def multi_compare_view(request,id=0,userid=0):
|
||||
request.session['ids'] = ids
|
||||
|
||||
labeldict = {
|
||||
int(w.id): w.__unicode__() for w in workouts
|
||||
int(w.id): w.__str__() for w in workouts
|
||||
}
|
||||
|
||||
else:
|
||||
@@ -1050,7 +1055,7 @@ def multi_compare_view(request,id=0,userid=0):
|
||||
pass
|
||||
|
||||
labeldict = {
|
||||
int(w.id): w.__unicode__() for w in workouts
|
||||
int(w.id): w.__str__() for w in workouts
|
||||
}
|
||||
elif 'ids' in request.session and 'plottype' in request.session:
|
||||
xparam = request.session['xparam']
|
||||
@@ -1066,7 +1071,7 @@ def multi_compare_view(request,id=0,userid=0):
|
||||
pass
|
||||
|
||||
labeldict = {
|
||||
int(w.id): w.__unicode__() for w in workouts
|
||||
int(w.id): w.__str__() for w in workouts
|
||||
}
|
||||
chartform = ChartParamChoiceForm(
|
||||
initial = {
|
||||
@@ -2421,12 +2426,12 @@ def workout_data_view(request, id=0):
|
||||
pass
|
||||
|
||||
# pd.set_option('display.width', 1000)
|
||||
pd.set_option('colheader_justify', 'left')
|
||||
#pd.set_option('colheader_justify', 'left')
|
||||
|
||||
htmltable = datadf.to_html(
|
||||
bold_rows=True,
|
||||
show_dimensions=True,border=1,
|
||||
classes='pandastable',justify='justify'
|
||||
classes=['pandastable'],justify='justify'
|
||||
)
|
||||
|
||||
return render(request,
|
||||
@@ -2505,7 +2510,7 @@ def workout_stats_view(request,id=0,message="",successmessage=""):
|
||||
fielddict.pop('workoutstate')
|
||||
fielddict.pop('workoutid')
|
||||
|
||||
for field,verbosename in fielddict.iteritems():
|
||||
for field,verbosename in fielddict.items():
|
||||
thedict = {
|
||||
'mean':datadf[field].mean(),
|
||||
'wmean': wavg(datadf, field, 'deltat'),
|
||||
@@ -2523,9 +2528,9 @@ def workout_stats_view(request,id=0,message="",successmessage=""):
|
||||
cor = datadf.corr(method='spearman')
|
||||
cor.fillna(value=0,inplace=True)
|
||||
cordict = {}
|
||||
for field1,verbosename in fielddict.iteritems():
|
||||
for field1,verbosename in fielddict.items():
|
||||
thedict = {}
|
||||
for field2,verbosename in fielddict.iteritems():
|
||||
for field2,verbosename in fielddict.items():
|
||||
try:
|
||||
thedict[field2] = cor.loc[field1,field2]
|
||||
except KeyError:
|
||||
@@ -3206,10 +3211,14 @@ def workout_comment_view(request,id=0):
|
||||
cd = form.cleaned_data
|
||||
comment = cd['comment']
|
||||
comment = bleach.clean(comment)
|
||||
try:
|
||||
if isinstance(comment,unicode):
|
||||
comment = comment.encode('utf8')
|
||||
elif isinstance(comment, str):
|
||||
comment = comment.decode('utf8')
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
notification = cd['notification']
|
||||
c = WorkoutComment(workout=w,user=request.user,comment=comment,
|
||||
@@ -4973,7 +4982,7 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
||||
iunits = []
|
||||
itypes = []
|
||||
iresults = []
|
||||
for i in xrange(nrintervals):
|
||||
for i in range(nrintervals):
|
||||
try:
|
||||
t = datetime.datetime.strptime(request.POST['intervalt_%s' % i],"%H:%M:%S.%f")
|
||||
except ValueError:
|
||||
@@ -5037,7 +5046,7 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
||||
iunits = []
|
||||
itypes = []
|
||||
iresults = []
|
||||
for i in xrange(nrintervals):
|
||||
for i in range(nrintervals):
|
||||
t = cd['intervalt_%s' % i]
|
||||
timesecs = t.total_seconds()
|
||||
itime += [timesecs]
|
||||
@@ -5071,7 +5080,7 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
||||
|
||||
|
||||
initial = {}
|
||||
for i in xrange(nrintervals):
|
||||
for i in range(nrintervals):
|
||||
try:
|
||||
initial['intervald_%s' % i] = idist[i]
|
||||
initial['intervalt_%s' % i] = get_time(itime[i])
|
||||
|
||||
-18619
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
import requests
|
||||
import json
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
"""
|
||||
Django settings for rowsandall_app project.
|
||||
@@ -43,7 +47,7 @@ ALLOWED_HOSTS = CFG['allowed_hosts']
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'rowers',
|
||||
'cvkbrno',
|
||||
# 'cvkbrno',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
@@ -59,7 +63,7 @@ INSTALLED_APPS = [
|
||||
'django_mailbox',
|
||||
'rest_framework',
|
||||
'datetimewidget',
|
||||
# 'rest_framework_swagger',
|
||||
'rest_framework_swagger',
|
||||
'oauth2_provider',
|
||||
'corsheaders',
|
||||
'analytical',
|
||||
@@ -199,7 +203,7 @@ TZ_DETECT_COUNTRIES = ('US','DE','GB','CZ','FR','IT')
|
||||
|
||||
LOCALE_PATHS = (
|
||||
os.path.join(BASE_DIR, 'locale'),
|
||||
os.path.join(BASE_DIR, 'cvkbrno/locale'),
|
||||
# os.path.join(BASE_DIR, 'cvkbrno/locale'),
|
||||
)
|
||||
|
||||
LANGUAGES = (
|
||||
|
||||
Reference in New Issue
Block a user