Get some initial scaffolding up for implant sets sourced from the resist code.

This commit is contained in:
blitzmann
2016-03-20 02:04:55 -04:00
parent 6f1872fb94
commit 36ad31ab25
11 changed files with 578 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ from service.update import Update
from service.price import Price
from service.network import Network
from service.eveapi import EVEAPIConnection, ParseXML
from service.implantSet import ImplantSets
import wx
if not 'wxMac' in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3,0)):

60
service/implantSet.py Normal file
View File

@@ -0,0 +1,60 @@
#===============================================================================
# Copyright (C) 2016 Ryan Holmes
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pyfa is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
#===============================================================================
import eos.db
import eos.types
import copy
class ImportError(Exception):
pass
class ImplantSets():
instance = None
@classmethod
def getInstance(cls):
if cls.instance is None:
cls.instance = ImplantSets()
return cls.instance
def getImplantSetList(self):
return eos.db.getImplantSet(None)
def getImplantSet(self, name):
return eos.db.getImplantSet(name)
def newSet(self):
p = eos.types.ImplantSet()
p.name = ""
return p
def renameSet(self, s, newName):
s.name = newName
eos.db.save(s)
def deleteSet(self, s):
eos.db.remove(s)
def copySet(self, s):
newS = copy.deepcopy(s)
eos.db.save(newS)
return newS
def saveChanges(self, s):
eos.db.save(s)