My favorites
▼
|
Sign in
django-eve-db
A wrapper around EVE Online's CCP-provided data dump.
Project Home
Export to GitHub
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
1
attachment: importer.station.py
(4.1 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
"""
Import station related data.
"""
from eve_db.models import *
from importer_classes import SQLImporter
class Importer_ramActivities(SQLImporter):
def run_importer(self, conn):
c = conn.cursor()
for row in c.execute('select * from ramActivities'):
imp_obj, created = EVEResearchAndMfgActivity.objects.get_or_create(id=row['activityID'])
imp_obj.name = row['activityName']
imp_obj.description = row['description']
if row['iconNo']:
imp_obj.icon_filename = row['iconNo']
if row['published'] == 1:
imp_obj.is_published = True
else:
imp_obj.is_published = False
imp_obj.save()
c.close()
class Importer_staServices(SQLImporter):
def run_importer(self, conn):
c = conn.cursor()
for row in c.execute('select * from staServices'):
imp_obj, created = EVEStationService.objects.get_or_create(id=row['serviceID'])
imp_obj.name = row['serviceName']
imp_obj.description = row['description']
imp_obj.save()
c.close()
class Importer_staStationTypes(SQLImporter):
DEPENDENCIES = ['eveGraphics', 'staOperations','invTypes']
def run_importer(self, conn):
c = conn.cursor()
for row in c.execute('select * from staStationTypes'):
statype, created = EVEStationType.objects.get_or_create(id=row['stationTypeID'])
statype.dock_entry_x = row['dockEntryX']
statype.dock_orientation_x = row['dockOrientationX']
statype.dock_entry_y = row['dockEntryY']
statype.dock_orientation_y = row['dockOrientationY']
statype.dock_entry_z = row['dockEntryZ']
statype.dock_orientation_z = row['dockOrientationZ']
statype.office_slots = row['officeSlots']
statype.reprocessing_efficiency = row['reprocessingEfficiency']
if row['dockingBayGraphicID']:
statype.docking_bay_graphic = EVEGraphic.objects.get(id=row['dockingBayGraphicID'])
if row['hangarGraphicID']:
statype.hangar_graphic = EVEGraphic.objects.get(id=row['hangarGraphicID'])
if row['operationID']:
statype.operation = EVEStationOperation.objects.get(id=row['operationID'])
if row['conquerable'] == 1:
statype.is_conquerable = True
statype.save()
c.close()
class Importer_staOperations(SQLImporter):
DEPENDENCIES = ['staStationTypes']
def run_importer(self, conn):
c = conn.cursor()
for row in c.execute('select * from staOperations'):
operation, created = EVEStationOperation.objects.get_or_create(id=row['operationID'])
operation.activity_id = row['activityID']
operation.name = row['operationName']
operation.description = row['description']
operation.fringe = row['fringe']
operation.corridor = row['corridor']
operation.hub = row['hub']
operation.border = row['border']
operation.ratio = row['ratio']
if row['caldariStationTypeID']:
operation.caldari_station_type = EVEStationType.objects.get(id=row['caldariStationTypeID'])
if row['minmatarStationTypeID']:
operation.minmatar_station_type = EVEStationType.objects.get(id=row['minmatarStationTypeID'])
if row['amarrStationTypeID']:
operation.amarr_station_type = EVEStationType.objects.get(id=row['amarrStationTypeID'])
if row['gallenteStationTypeID']:
operation.gallente_station_type = EVEStationType.objects.get(id=row['gallenteStationTypeID'])
if row['joveStationTypeID']:
operation.jove_station_type = EVEStationType.objects.get(id=row['joveStationTypeID'])
operation.save()
c.close()
Powered by
Google Project Hosting