-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPilot.py
More file actions
47 lines (39 loc) · 1.29 KB
/
Pilot.py
File metadata and controls
47 lines (39 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/python
# vim:sw=4:softtabstop=4:expandtab:set fileencoding=ISO8859-2
#
# Pilot.py, part of the FleetPanel
#
# Copyright (c) 2008-2009 Pawe³ 'Reef' Polewicz
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution. The terms
# are also available at http://www.opensource.org/licenses/mit-license.php.
import pickle
class Pilot:
def __init__(self, nick):
self.nick = nick
self.serverData = PilotServerData()
self.customData = PilotCustomData(nick)
class PilotCustomData:
properties = ["mining", "pvp", "align", "tackling", "overview", "bookmark", "skaner"]
def __init__(self, nick):
self.data = {}
self.nick = nick
for i in self.properties:
self.data[i] = False
self.deleted = False
self.comment = "just joined"
self.save()
def load(self):
success, pilotsdata = unpickle("PilotCustomData/" + self.nick + '.pkl')
if success:
self.pilotsdata = pilotsdata
def save(self):
output = open("PilotCustomData/" + self.nick + '.pkl', 'wb')
pickle.dump(self, output)
output.close()
class PilotServerData:
def __init__(self):
self.data = {}
#