Skip to content

Commit 95b8528

Browse files
committed
Make gui
1 parent 5427035 commit 95b8528

File tree

10 files changed

+540
-303
lines changed

10 files changed

+540
-303
lines changed

colourer.py

Lines changed: 0 additions & 105 deletions
This file was deleted.

devices/Kobo.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import os
2+
3+
4+
class Kobo:
5+
dir = '/XCSoarData/'
6+
7+
def __init__(self, mountpoint):
8+
self.mountpoint = mountpoint
9+
pass
10+
11+
def isDevice(self):
12+
return os.path.isdir(self.mountpoint + self.dir)
13+
14+
def getPilotId(self, filename):
15+
try:
16+
file = open(self.dir + filename + '.txt', 'r')
17+
id = file.read()
18+
file.close()
19+
return id
20+
except Exception as e:
21+
logging.warn("Failed to get pilot ID. " + str(e))
22+
return False
23+
24+
def setPilotId(self, filename, id):
25+
try:
26+
file = open(self.mountpoint + filename + '.txt', 'w')
27+
file.write(id)
28+
file.close()
29+
except Exception as e:
30+
logging.warn("Failed to set pilot ID. " + str(e))
31+
return False
32+
33+
def getFlightFiles(self):
34+
kobo_path = self.mountpoint + self.dir + "logs/"
35+
return os.listdir(kobo_path)
36+
37+
def getFile(self, file):
38+
return self.mountpoint + self.dir + "logs/" + file

devices/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__author__ = 'RobChett'

0 commit comments

Comments
 (0)