Index: /wakeup/wakeup.py
===================================================================
--- /wakeup/wakeup.py (revision 13)
+++ /wakeup/wakeup.py (revision 13)
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+
+def timeToInt((hour,minute)):
+    if 12<hour: hour-=24
+    return hour+minute/60.0
+
+def intToTime(time):
+    hour=int(time)
+    return hour,int(round((time-hour)*60))
+
+
+def processTime(time):
+    return timeToInt([int(e) for e in time.split(':')])
+
+def averageTime(times):
+    total=0
+    for i in times: total+=i
+    return intToTime(total/len(times))
+
+sleep=[]
+wakeup1=[]
+wakeup2=[]
+insleep=[]
+
+for i in file('WakeUpLog.txt').readlines():
+    times = i.split('||')
+    sleep.append(processTime(times[0]))
+    wakeup1.append(processTime(times[2]))
+    wakeup2.append(processTime(times[1]))
+    insleep.append(processTime(times[2])-processTime(times[0]))
+
+print averageTime(sleep)
+print averageTime(wakeup1)
+print averageTime(wakeup2)
+print averageTime(insleep)
+
Index: /wakeup/WakeUpLog.txt
===================================================================
--- /wakeup/WakeUpLog.txt (revision 13)
+++ /wakeup/WakeUpLog.txt (revision 13)
@@ -0,0 +1,268 @@
+01:07||07:34||07:02
+00:39||07:40||07:04
+01:01||07:42||07:05
+01:25||07:43||07:05
+01:00||08:01||07:29
+00:39||07:38||07:06
+00:32||07:49||07:16
+00:50||07:47||07:10
+01:05||08:06||07:38
+01:15||07:50||07:05
+00:48||07:58||07:24
+23:18||07:32||07:00
+23:58||07:52||07:05
+01:13||07:52||07:05
+01:23||07:40||07:07
+23:41||07:46||07:11
+01:21||07:52||06:43
+01:04||07:39||07:01
+00:45||07:57||07:25
+00:47||08:18||07:40
+00:50||08:31||07:43
+00:35||07:45||07:11
+01:40||07:58||07:18
+01:00||07:57||07:15
+01:16||07:59||07:26
+02:37||07:45||07:14
+02:39||08:13||07:17
+02:14||07:54||07:11
+00:42||08:00||07:06
+01:23||08:00||07:05
+01:10||07:59||07:15
+23:30||06:35||06:05
+00:46||08:04||07:27
+00:41||08:02||07:27
+01:15||08:01||07:20
+02:32||08:04||07:24
+02:07||08:06||07:30
+04:22||08:45||08:32
+01:25||07:27||06:40
+01:45||08:01||07:22
+01:22||07:45||07:15
+23:37||08:06||07:28
+00:02||08:00||07:10
+00:48||08:07||07:38
+00:44||07:41||07:05
+00:55||08:13||07:44
+02:14||08:10||07:15
+01:16||08:02||07:26
+01:33||07:45||07:05
+01:24||07:47||07:15
+02:01||06:49||06:06
+01:40||07:43||07:05
+00:46||07:39||07:06
+23:50||07:44||07:08
+23:58||07:54||07:09
+23:59||07:49||07:20
+00:49||07:34||07:04
+00:01||07:40||07:05
+23:59||07:41||07:12
+00:29||07:33||07:00
+01:41||07:48||07:16
+00:53||07:46||07:13
+01:28||07:40||07:08
+02:06||08:32||08:16
+00:37||07:59||07:23
+01:23||07:50||07:11
+01:14||07:47||07:09
+00:30||07:57||07:51
+00:23||08:00||07:13
+00:37||07:43||07:06
+01:22||08:48||08:30
+00:58||08:00||07:10
+00:47||07:43||06:58
+00:22||07:34||07:00
+00:38||07:40||07:00
+00:26||07:46||07:11
+22:04||07:44||07:05
+00:44||06:26||06:01
+00:19||08:25||07:35
+01:44||08:46||08:35
+00:26||07:44||07:05
+00:34||07:42||07:00
+00:10||07:43||07:03
+01:05||07:45||07:06
+00:50||07:50||07:11
+01:03||08:00||07:08
+00:47||08:01||07:20
+00:42||07:57||07:18
+00:11||07:52||07:12
+01:48||07:55||07:29
+02:22||08:28||08:16
+00:32||07:44||07:06
+23:52||07:40||07:06
+00:44||08:35||07:57
+23:45||07:48||07:05
+00:41||07:46||07:00
+01:44||08:15||07:40
+00:38||07:49||07:05
+01:20||07:42||07:01
+00:14||07:43||07:05
+01:23||08:42||08:12
+01:02||07:37||06:58
+01:20||07:08||06:30
+01:49||07:56||07:10
+01:50||08:48||08:10
+00:54||07:48||07:07
+00:49||08:05||07:05
+01:40||07:43||07:03
+01:18||07:55||07:04
+01:13||08:00||07:00
+01:06||07:45||07:01
+23:04||07:45||07:01
+01:37||07:53||07:14
+01:11||07:43||07:04
+01:20||08:08||07:13
+00:52||07:44||07:00
+00:41||07:42||07:04
+01:26||07:43||07:07
+01:29||07:22||06:30
+01:47||07:48||07:10
+00:54||07:42||07:06
+01:15||07:47||07:05
+00:54||07:58||07:01
+00:45||07:52||07:06
+00:46||07:24||06:40
+00:59||07:20||06:40
+01:34||07:31||07:04
+01:50||07:20||06:48
+01:16||07:38||07:00
+01:50||07:26||06:40
+01:30||07:38||07:06
+01:27||07:18||06:40
+01:06||07:20||06:46
+01:40||07:26||06:45
+01:22||07:37||07:12
+01:25||07:30||06:40
+02:03||08:13||07:35
+00:42||07:48||07:16
+01:13||07:12||06:30
+01:50||07:18||06:45
+01:37||07:29||06:55
+01:42||08:24||07:47
+00:21||07:39||06:58
+01:35||07:25||06:56
+02:40||07:30||06:57
+02:14||07:29||07:05
+02:30||07:37||07:00
+01:51||07:35||07:00
+01:41||07:40||07:10
+01:44||07:38||07:02
+01:13||07:34||07:06
+02:18||08:40||08:00
+01:28||07:06||06:35
+01:39||07:56||07:30
+01:28||07:47||07:15
+03:14||07:50||07:10
+01:40||07:07||06:15
+00:55||06:55||06:21
+00:58||07:25||07:03
+00:37||06:56||06:24
+01:26||08:28||07:57
+01:33||06:57||06:05
+02:26||07:40||07:12
+00:47||07:44||07:10
+00:32||07:57||07:31
+01:05||07:28||06:55
+01:42||07:08||06:33
+01:17||07:33||07:07
+00:43||07:35||07:09
+02:41||08:00||07:28
+00:47||07:43||07:06
+01:09||07:17||06:44
+01:37||07:42||07:07
+01:12||07:33||07:01
+01:16||07:36||06:59
+01:58||07:48||07:00
+00:42||07:06||06:37
+01:30||07:33||07:01
+01:53||07:31||07:02
+01:04||07:35||07:03
+01:55||07:32||07:00
+01:16||07:42||07:10
+01:26||07:42||07:08
+01:51||07:44||07:13
+01:39||07:46||07:14
+01:32||07:45||07:10
+02:47||07:40||07:03
+01:47||07:45||07:12
+01:21||07:48||07:16
+02:44||07:44||07:05
+01:59||08:14||07:29
+01:50||08:19||07:48
+01:44||07:55||07:18
+01:41||07:58||07:24
+01:30||08:05||07:25
+00:42||07:56||07:30
+00:47||07:59||07:18
+00:26||08:01||07:27
+01:12||07:31||06:59
+01:38||07:52||07:23
+01:28||07:37||07:06
+01:48||07:52||07:21
+01:55||07:49||07:20
+02:18||08:01||07:36
+23:43||08:19||07:45
+01:28||08:11||07:48
+01:38||08:22||07:58
+02:04||07:30||07:00
+01:03||07:55||07:21
+01:40||08:01||07:26
+02:11||08:03||07:35
+01:23||07:17||06:46
+00:58||07:57||07:32
+02:02||08:00||07:29
+01:19||08:01||07:37
+00:54||07:37||07:25
+01:53||07:54||07:20
+01:26||07:57||07:25
+02:26||08:04||07:28
+02:24||07:58||07:23
+01:34||08:03||07:30
+03:55||08:06||07:40
+00:49||08:05||07:35
+01:22||08:02||07:40
+01:49||08:08||07:39
+01:16||08:05||07:36
+02:40||08:07||07:40
+02:30||08:02||07:33
+02:11||08:09||07:29
+02:59||08:04||07:33
+02:44||08:10||07:41
+02:05||08:27||07:34
+02:04||08:24||07:38
+23:05||08:04||07:33
+00:54||08:05||07:29
+01:16||08:07||07:30
+02:43||08:20||08:00
+00:56||08:07||07:31
+00:22||08:01||07:28
+00:45||08:07||07:36
+02:31||08:15||07:45
+03:01||08:47||08:27
+03:00||08:15||07:46
+03:15||08:02||07:35
+01:37||08:10||07:40
+03:53||08:10||07:43
+02:01||08:16||07:45
+02:01||08:33||08:04
+00:26||08:11||07:36
+02:08||08:10||07:47
+01:50||07:59||07:31
+01:56||08:08||07:40
+00:50||08:03||07:33
+01:24||08:16||07:44
+02:16||08:11||07:42
+01:08||08:10||07:40
+01:48||08:11||07:47
+00:25||08:05||07:35
+02:28||08:14||07:35
+01:07||08:08||07:44
+01:16||08:11||07:41
+01:24||08:07||07:37
+01:59||08:11||07:43
+01:48||08:18||07:42
+01:02||08:08||07:21
+01:40||08:11||07:37
+02:35||08:13||07:50
+01:46||08:18||07:53
