Compare commits
482 Commits
draft1
...
singularit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51c481206c | ||
|
|
7b6b922c57 | ||
|
|
492776c5a8 | ||
|
|
51a8076d30 | ||
|
|
decf7ff028 | ||
|
|
31b1c94c0f | ||
|
|
a9fc457510 | ||
|
|
6dbed1403a | ||
|
|
aa5eb7ac92 | ||
|
|
e0fbcc91f1 | ||
|
|
b2dce223b0 | ||
|
|
4b7b22025c | ||
|
|
8e37dab37e | ||
|
|
6e95f69565 | ||
|
|
31331b1e34 | ||
|
|
05b3777ad2 | ||
|
|
cda8dd4c8b | ||
|
|
cbedf03026 | ||
|
|
a69589dd23 | ||
|
|
2904ab6afa | ||
|
|
c763595cc4 | ||
|
|
8fe97180ed | ||
|
|
6a4b2ffe69 | ||
|
|
7f100353e2 | ||
|
|
97ac0804c5 | ||
|
|
598512a904 | ||
|
|
121a81ce70 | ||
|
|
a2e031cf27 | ||
|
|
f18ba6160a | ||
|
|
ab7bbcb6ef | ||
|
|
cc59612fa4 | ||
|
|
01db1efdf7 | ||
|
|
e74e2615ad | ||
|
|
2f246d0897 | ||
|
|
505b0ce38f | ||
|
|
8c19a956e0 | ||
|
|
9de3600d7f | ||
|
|
5a4f526b2b | ||
|
|
cd0b0eada0 | ||
|
|
17733d5951 | ||
|
|
0a1f324053 | ||
|
|
b32f76cfde | ||
|
|
182104a010 | ||
|
|
90c883da67 | ||
|
|
ac08b1b264 | ||
|
|
f17d015ebe | ||
|
|
d496637614 | ||
|
|
4596c526a2 | ||
|
|
9941b6c74b | ||
|
|
b06ce24d4a | ||
|
|
2f8c201ab3 | ||
|
|
d184820728 | ||
|
|
40aeb1ed4a | ||
|
|
71b258a8f5 | ||
|
|
cd7579a4bf | ||
|
|
d6199a58c2 | ||
|
|
3ad5aaac89 | ||
|
|
3bed268d81 | ||
|
|
9a1b0f07c0 | ||
|
|
f591ecba10 | ||
|
|
c571fdc5e6 | ||
|
|
6f944fc7db | ||
|
|
63fce4be17 | ||
|
|
86ee5292d8 | ||
|
|
0060f58e3d | ||
|
|
23b458534f | ||
|
|
2256efacb0 | ||
|
|
28a5318e3b | ||
|
|
609ee13cd6 | ||
|
|
4216904736 | ||
|
|
496e9b56b5 | ||
|
|
b8f73a7c94 | ||
|
|
b4604f8207 | ||
|
|
68dddf2810 | ||
|
|
4c17f38b1a | ||
|
|
221a3fde14 | ||
|
|
c17e03d8d0 | ||
|
|
af9f64db5f | ||
|
|
1f82465a65 | ||
|
|
d885bd4636 | ||
|
|
c17bce55bb | ||
|
|
4137a7cda9 | ||
|
|
c92911b79a | ||
|
|
adc9fb6d00 | ||
|
|
5baf70694a | ||
|
|
f08dc97576 | ||
|
|
35094ae1ce | ||
|
|
5ac31920ee | ||
|
|
e63c3541c4 | ||
|
|
4976516d4d | ||
|
|
e042a21d32 | ||
|
|
8a22907940 | ||
|
|
a97847e644 | ||
|
|
23309a5da6 | ||
|
|
06e4a7e80f | ||
|
|
b95a10d284 | ||
|
|
2bca3ddcc8 | ||
|
|
9ef182aa99 | ||
|
|
5e56107582 | ||
|
|
972c08e7e4 | ||
|
|
091832af21 | ||
|
|
16d1891e16 | ||
|
|
40ee68e2cf | ||
|
|
bfe3b4a26d | ||
|
|
9aa1332b15 | ||
|
|
0521d242eb | ||
|
|
2b3f3773e5 | ||
|
|
4041407878 | ||
|
|
1b5e0467fc | ||
|
|
a7c346f78e | ||
|
|
3cc51aaf89 | ||
|
|
a339ae1c55 | ||
|
|
3773d1c28e | ||
|
|
41b8db346f | ||
|
|
7959593c6c | ||
|
|
aaa60cbc14 | ||
|
|
8ae5a96047 | ||
|
|
8c90b3132b | ||
|
|
1326e21f6b | ||
|
|
bfdc2161e0 | ||
|
|
9ab79af70c | ||
|
|
f0de2000bf | ||
|
|
5991d19b3e | ||
|
|
51fed996f1 | ||
|
|
f6bbc6c410 | ||
|
|
3de6b63325 | ||
|
|
dd48815f30 | ||
|
|
5608676dc8 | ||
|
|
86ab1f7444 | ||
|
|
8f51642f70 | ||
|
|
de71123a48 | ||
|
|
874cf4ef0a | ||
|
|
87e5929cb1 | ||
|
|
84b1e0ac41 | ||
|
|
539360d5f6 | ||
|
|
ca08f8d8da | ||
|
|
e1ce672569 | ||
|
|
717080b58c | ||
|
|
51696c509f | ||
|
|
4a5ae9f6f1 | ||
|
|
fa9f324f78 | ||
|
|
bcc77f11cd | ||
|
|
f737f292e3 | ||
|
|
1c18a5207c | ||
|
|
fa2b1e3821 | ||
|
|
6184753822 | ||
|
|
91a9c860ea | ||
|
|
0730ac369f | ||
|
|
aaa5a6ae18 | ||
|
|
646f3afd27 | ||
|
|
98815f2b85 | ||
|
|
95eb5a6117 | ||
|
|
dc035469ed | ||
|
|
ec4a00cdfc | ||
|
|
21937c02ff | ||
|
|
edfd446e46 | ||
|
|
7ec78b941e | ||
|
|
95bf1039c0 | ||
|
|
e6def6f5f9 | ||
|
|
de0b03630a | ||
|
|
90a2a79d5b | ||
|
|
21efd6d06a | ||
|
|
ea288a6133 | ||
|
|
23baaa7dba | ||
|
|
8008c986d3 | ||
|
|
b9efc919ea | ||
|
|
6cc6fd9468 | ||
|
|
53c9169043 | ||
|
|
9e96aac04d | ||
|
|
3395f8ebe6 | ||
|
|
1d45102100 | ||
|
|
1694d74afa | ||
|
|
9c9f1dcefa | ||
|
|
a4ca2e90f9 | ||
|
|
dbfcfd9acf | ||
|
|
8c30ee3fd3 | ||
|
|
ca17d17232 | ||
|
|
b78c0a5845 | ||
|
|
ef6e25bfce | ||
|
|
e81f7eb765 | ||
|
|
26122f6da7 | ||
|
|
cca7f1112a | ||
|
|
c809a614f9 | ||
|
|
2c366faa66 | ||
|
|
06252d761d | ||
|
|
bb8d5d0d65 | ||
|
|
7606bded40 | ||
|
|
daaf48d02a | ||
|
|
d18cf7b3b0 | ||
|
|
33a0c10650 | ||
|
|
2077655694 | ||
|
|
0dc3cbb7c7 | ||
|
|
a3c19f6f2b | ||
|
|
f97b037011 | ||
|
|
dd3dd799b2 | ||
|
|
ac881ac371 | ||
|
|
d734ccbf0d | ||
|
|
024e0ad4f5 | ||
|
|
545d98883a | ||
|
|
742abc3250 | ||
|
|
294e213ac2 | ||
|
|
557f32ab91 | ||
|
|
e5430cac84 | ||
|
|
39c14b62fd | ||
|
|
940035fa8c | ||
|
|
5eaaaf070b | ||
|
|
0bc9264c28 | ||
|
|
cb1de9589e | ||
|
|
370e34cff9 | ||
|
|
28c3fc720f | ||
|
|
04b3a687fc | ||
|
|
629f6e60a4 | ||
|
|
f801d7905c | ||
|
|
694a2a3d9b | ||
|
|
222888984a | ||
|
|
bb96ecb647 | ||
|
|
e082077dfc | ||
|
|
a31769bde3 | ||
|
|
be7e8be85b | ||
|
|
b16d2eae15 | ||
|
|
0ef05ffaf8 | ||
|
|
9ee7671a3c | ||
|
|
ca301f8d5b | ||
|
|
471261275a | ||
|
|
55f2f3bfe8 | ||
|
|
3ce673d8af | ||
|
|
3e2053b2dd | ||
|
|
931e48d9a0 | ||
|
|
6c19f446be | ||
|
|
d4842c2f8e | ||
|
|
dc77ee9353 | ||
|
|
6d29fd6bc1 | ||
|
|
cbcd5ccca5 | ||
|
|
30d2ab23ad | ||
|
|
f4f028b843 | ||
|
|
ef62f102bc | ||
|
|
7b8bb79cbe | ||
|
|
3a26790109 | ||
|
|
c861adc5ed | ||
|
|
36a3ac70b6 | ||
|
|
54d1b35ce7 | ||
|
|
675213f20f | ||
|
|
3a9e1f8b85 | ||
|
|
e520758334 | ||
|
|
073309de0a | ||
|
|
1bce724190 | ||
|
|
2c47d0758e | ||
|
|
8f7ae4b00c | ||
|
|
f11f3bfb79 | ||
|
|
68703f3db5 | ||
|
|
ad18560412 | ||
|
|
d3def54b5a | ||
|
|
27d72ed909 | ||
|
|
55e45b6bc1 | ||
|
|
252f56732b | ||
|
|
d52e88cdaa | ||
|
|
371e33764e | ||
|
|
9b8b7aba07 | ||
|
|
0a6274474e | ||
|
|
0ff69068c0 | ||
|
|
731477b366 | ||
|
|
0295f04ec4 | ||
|
|
059af217aa | ||
|
|
2a391fa38b | ||
|
|
88b1426fe0 | ||
|
|
07da5aa861 | ||
|
|
192d6f4605 | ||
|
|
487f65d62b | ||
|
|
c202aefd2e | ||
|
|
0ed91e4079 | ||
|
|
9c2a667635 | ||
|
|
19579fb087 | ||
|
|
ea77e6851e | ||
|
|
1c3f9ccf5b | ||
|
|
e42671fbec | ||
|
|
18c86daea6 | ||
|
|
c59b818677 | ||
|
|
71bf1556a1 | ||
|
|
26e50f2e8a | ||
|
|
25e30672fe | ||
|
|
e8268633e3 | ||
|
|
1b3c058eab | ||
|
|
adcae42ae7 | ||
|
|
238712e62c | ||
|
|
f2b959895e | ||
|
|
ffb7719937 | ||
|
|
3c1bf22e87 | ||
|
|
e0488dce4f | ||
|
|
88074c8516 | ||
|
|
359840aee8 | ||
|
|
77e3a0f666 | ||
|
|
3d4eef2466 | ||
|
|
663cf7104c | ||
|
|
0d6a55dcb6 | ||
|
|
85608616dd | ||
|
|
d5ce666d8d | ||
|
|
2bff11e5ab | ||
|
|
5adaaac75e | ||
|
|
a49269b759 | ||
|
|
a96efaee1a | ||
|
|
299de38bf6 | ||
|
|
b29019f0a7 | ||
|
|
da15b63831 | ||
|
|
20b2f1e5fc | ||
|
|
f1cdabf37c | ||
|
|
94e1c7aba3 | ||
|
|
797db36a42 | ||
|
|
ac18c58a0a | ||
|
|
281850d7df | ||
|
|
2e460adbc9 | ||
|
|
5660b2b8ed | ||
|
|
de9fbd672f | ||
|
|
85029f6be8 | ||
|
|
337db326fd | ||
|
|
795230dae6 | ||
|
|
022a929399 | ||
|
|
b64238634a | ||
|
|
4b0e0300ad | ||
|
|
7762bb365f | ||
|
|
dfec7d8fa2 | ||
|
|
5c5ec60efd | ||
|
|
2a7e35ff6f | ||
|
|
d7ab709d52 | ||
|
|
831478e034 | ||
|
|
d0b5f3ad78 | ||
|
|
190c1f135f | ||
|
|
374d6d6d34 | ||
|
|
edbdaf5631 | ||
|
|
23a71e7448 | ||
|
|
892c5c5b60 | ||
|
|
081e32da6f | ||
|
|
7100e8997b | ||
|
|
9a8642e789 | ||
|
|
a565abe6f7 | ||
|
|
b93b59fe4d | ||
|
|
9782ca3a29 | ||
|
|
f9fd894c9f | ||
|
|
ee8395e8fd | ||
|
|
7836506444 | ||
|
|
8df7593223 | ||
|
|
8351b0fc9d | ||
|
|
88ee1d60be | ||
|
|
dda1494b90 | ||
|
|
f53384c4c2 | ||
|
|
d4af877e47 | ||
|
|
5242c6df60 | ||
|
|
8c1d14ec4a | ||
|
|
f187caa549 | ||
|
|
70d52fd0b2 | ||
|
|
222ee22fe3 | ||
|
|
76f1f217e1 | ||
|
|
6f42e7c286 | ||
|
|
aab2ec5f96 | ||
|
|
9831ed5c3d | ||
|
|
399ec7d009 | ||
|
|
bf91e82813 | ||
|
|
7ca1fc4cfb | ||
|
|
3f86d3c33d | ||
|
|
fd1dc5b4e2 | ||
|
|
05c73d1b1b | ||
|
|
7a6e3ac665 | ||
|
|
9de8fe5884 | ||
|
|
ff55f2817b | ||
|
|
198ee8d129 | ||
|
|
7db13bd3ba | ||
|
|
5be0d4b70e | ||
|
|
a603a4359a | ||
|
|
b4f4024903 | ||
|
|
df18651b4f | ||
|
|
61197ec061 | ||
|
|
9f2124ac9f | ||
|
|
dbacfc19f0 | ||
|
|
6fafe40f35 | ||
|
|
7641384aba | ||
|
|
15087a290a | ||
|
|
cb27efd5e1 | ||
|
|
091935259a | ||
|
|
1fca17f5dd | ||
|
|
98cac2a0da | ||
|
|
c28e52f2d1 | ||
|
|
36df6878e8 | ||
|
|
7077261fe1 | ||
|
|
89052edda2 | ||
|
|
e60b677b3f | ||
|
|
bf5c443053 | ||
|
|
d298ed8e01 | ||
|
|
28f2644a15 | ||
|
|
635e684c3a | ||
|
|
d991048be3 | ||
|
|
69e99d98c2 | ||
|
|
20362d2c0c | ||
|
|
2e1d0c43a1 | ||
|
|
f78e2ed405 | ||
|
|
23906d5824 | ||
|
|
41a67bfae2 | ||
|
|
df58614674 | ||
|
|
90369b679c | ||
|
|
fed7107857 | ||
|
|
4a2223323d | ||
|
|
0bbc35cd1b | ||
|
|
9b8c1ff3ba | ||
|
|
3394fabfc8 | ||
|
|
1bdfd7f924 | ||
|
|
b69a46f9b1 | ||
|
|
c17579505c | ||
|
|
2f990b9de2 | ||
|
|
c9f33f200d | ||
|
|
4abde609d8 | ||
|
|
9c09cef783 | ||
|
|
7570fee97b | ||
|
|
22e8330045 | ||
|
|
98c37a253f | ||
|
|
a931d46cb0 | ||
|
|
f4de596193 | ||
|
|
973a081e8d | ||
|
|
3054ac9d90 | ||
|
|
4ea2636788 | ||
|
|
b5f2df58ce | ||
|
|
6d15645198 | ||
|
|
a1bd671d89 | ||
|
|
aba5d43fc7 | ||
|
|
c903dff8ad | ||
|
|
35d5c49745 | ||
|
|
030e6aa9db | ||
|
|
cc770898d9 | ||
|
|
8e383a085e | ||
|
|
5fef07a552 | ||
|
|
72e272084e | ||
|
|
a2499cc070 | ||
|
|
c262acd0dc | ||
|
|
da047106f3 | ||
|
|
c04bb8f82c | ||
|
|
bb16e649af | ||
|
|
035443b4ff | ||
|
|
0e10ac3928 | ||
|
|
f0473f1eab | ||
|
|
a95eabac7b | ||
|
|
1ab76a7170 | ||
|
|
53c4a31334 | ||
|
|
f02be0b0fd | ||
|
|
0524b901f5 | ||
|
|
d5a701ab31 | ||
|
|
55c7488a0d | ||
|
|
8c8cf05207 | ||
|
|
ab9822b37e | ||
|
|
4e5f27a643 | ||
|
|
92c9e1afc3 | ||
|
|
e6e503f9e8 | ||
|
|
578716767f | ||
|
|
ec083428da | ||
|
|
f57c18810e | ||
|
|
5d4c0b443e | ||
|
|
b89f55c675 | ||
|
|
81d991b48d | ||
|
|
944bc971bd | ||
|
|
cf44af3586 | ||
|
|
3e70a6fd7c | ||
|
|
59be18506c | ||
|
|
b1bf14de29 | ||
|
|
2dd8453bbb | ||
|
|
4e61d1b17a | ||
|
|
458e89a534 | ||
|
|
493bf5cb0d | ||
|
|
0032163a38 | ||
|
|
84ac71f528 | ||
|
|
e8041470c8 | ||
|
|
8928d394c0 | ||
|
|
0881abae7b | ||
|
|
0686b602c6 | ||
|
|
fa5edbb804 | ||
|
|
1279b20370 | ||
|
|
ed1b9854a0 | ||
|
|
4fe80b7554 | ||
|
|
a5773a3fd6 | ||
|
|
ca61be2476 | ||
|
|
ae02e214f0 | ||
|
|
a0093d9760 | ||
|
|
11891340af | ||
|
|
e60735a1f2 | ||
|
|
ce3772ecee | ||
|
|
bec61e43ae | ||
|
|
d29b4d91e9 |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -11,8 +11,13 @@
|
||||
|
||||
#Patch files
|
||||
*.patch
|
||||
|
||||
#Personal
|
||||
/saveddata
|
||||
saveddata/
|
||||
|
||||
#PyCharm
|
||||
.idea/
|
||||
|
||||
#Pyfa file
|
||||
pyfaFits.html
|
||||
build/
|
||||
|
||||
22
README.md
Normal file
22
README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Pyfa
|
||||
|
||||
Pyfa is a cross-platform desktop fitting application for EVE online that can be used natively on any platform where python and wxwidgets are available.
|
||||
|
||||
It provides many advanced features such as graphs and full calculations of any possible combination of modules, fits, etc.
|
||||
|
||||
Please see the [FAQ](https://github.com/DarkFenX/Pyfa/wiki/FAQ) for answers to common questions / concerns
|
||||
|
||||
#### A note for Linux users
|
||||
pyfa currently only supports wxPython 2.8. However, there are some distros that have started to support 3.0 and subsequently dropped support for 2.8 altogether (such as Debian Jessie). If this is the case and wxPython 3.0 is the only version installed, the official pyfa releases will not run. You must either find a package for 2.8 or compile it yourself.
|
||||
|
||||
For Debian Jessie, wxPython 2.8 is available in Sid (the unstable repo). you can use apt-pinning to install select packages from unstable and still keep your stable system. See http://jaqque.sbih.org/kplug/apt-pinning.html for me details.
|
||||
|
||||
3.0 support is being worked on and can be found on the wx3 branch. It may be stable enough for you, but there are a few bugs related to it. Please see the wx3 label on the GitHub issues area for me information on known issues (biggest one currently is GTK warning spam): https://github.com/DarkFenX/Pyfa/labels/wx3
|
||||
|
||||
#### Links
|
||||
* [Development repository: http://github.com/DarkFenX/Pyfa](http://github.com/DarkFenX/Pyfa)
|
||||
* [XMPP conference:
|
||||
pyfa@conference.jabber.org](pyfa@conference.jabber.org)
|
||||
* [EVE forum thread](http://forums.eveonline.com/default.aspx?g=posts&t=247609)
|
||||
* [EVE Online website](http://www.eveonline.com/)
|
||||
|
||||
207
config.py
207
config.py
@@ -1,86 +1,121 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Load variable overrides specific to distribution type
|
||||
try:
|
||||
import configforced
|
||||
except ImportError:
|
||||
configforced = None
|
||||
|
||||
# Turns on debug mode
|
||||
debug = False
|
||||
# Defines if our saveddata will be in pyfa root or not
|
||||
saveInRoot = False
|
||||
|
||||
# Version data
|
||||
version = "1.3.1"
|
||||
tag = "git"
|
||||
expansionName = "Crius"
|
||||
expansionVersion = "1.0"
|
||||
evemonMinVersion = "4081"
|
||||
|
||||
pyfaPath = None
|
||||
savePath = None
|
||||
staticPath = None
|
||||
saveDB = None
|
||||
gameDB = None
|
||||
|
||||
def defPaths():
|
||||
global pyfaPath
|
||||
global savePath
|
||||
global staticPath
|
||||
global saveDB
|
||||
global gameDB
|
||||
global saveInRoot
|
||||
# The main pyfa directory which contains run.py
|
||||
# Python 2.X uses ANSI by default, so we need to convert the character encoding
|
||||
pyfaPath = getattr(configforced, "pyfaPath", pyfaPath)
|
||||
if pyfaPath is None:
|
||||
pyfaPath = unicode(os.path.dirname(os.path.realpath(os.path.abspath(
|
||||
sys.modules['__main__'].__file__))), sys.getfilesystemencoding())
|
||||
|
||||
# Where we store the saved fits etc, default is the current users home directory
|
||||
if saveInRoot is True:
|
||||
savePath = getattr(configforced, "savePath", None)
|
||||
if savePath is None:
|
||||
savePath = os.path.join(pyfaPath, "saveddata")
|
||||
else:
|
||||
savePath = getattr(configforced, "savePath", None)
|
||||
if savePath is None:
|
||||
savePath = unicode(os.path.expanduser(os.path.join("~", ".pyfa")),
|
||||
sys.getfilesystemencoding())
|
||||
|
||||
# Redirect stderr to file if we're requested to do so
|
||||
stderrToFile = getattr(configforced, "stderrToFile", None)
|
||||
if stderrToFile is True:
|
||||
if not os.path.exists(savePath):
|
||||
os.mkdir(savePath)
|
||||
sys.stderr = open(os.path.join(savePath, "error_log.txt"), "w")
|
||||
|
||||
# Same for stdout
|
||||
stdoutToFile = getattr(configforced, "stdoutToFile", None)
|
||||
if stdoutToFile is True:
|
||||
if not os.path.exists(savePath):
|
||||
os.mkdir(savePath)
|
||||
sys.stdout = open(os.path.join(savePath, "output_log.txt"), "w")
|
||||
|
||||
# Static EVE Data from the staticdata repository, should be in the staticdata
|
||||
# directory in our pyfa directory
|
||||
staticPath = os.path.join(pyfaPath, "staticdata")
|
||||
|
||||
# The database where we store all the fits etc
|
||||
saveDB = os.path.join(savePath, "saveddata.db")
|
||||
|
||||
# The database where the static EVE data from the datadump is kept.
|
||||
# This is not the standard sqlite datadump but a modified version created by eos
|
||||
# maintenance script
|
||||
gameDB = os.path.join(staticPath, "eve.db")
|
||||
|
||||
## DON'T MODIFY ANYTHING BELOW ##
|
||||
import eos.config
|
||||
|
||||
#Caching modifiers, disable all gamedata caching, its unneeded.
|
||||
eos.config.gamedataCache = False
|
||||
# saveddata db location modifier, shouldn't ever need to touch this
|
||||
eos.config.saveddata_connectionstring = "sqlite:///" + saveDB + "?check_same_thread=False"
|
||||
eos.config.gamedata_connectionstring = "sqlite:///" + gameDB + "?check_same_thread=False"
|
||||
import os
|
||||
import sys
|
||||
|
||||
# TODO: move all logging back to pyfa.py main loop
|
||||
# We moved it here just to avoid rebuilding windows skeleton for now (any change to pyfa.py needs it)
|
||||
import logging
|
||||
import logging.handlers
|
||||
|
||||
# Load variable overrides specific to distribution type
|
||||
try:
|
||||
import configforced
|
||||
except ImportError:
|
||||
configforced = None
|
||||
|
||||
# Turns on debug mode
|
||||
debug = False
|
||||
# Defines if our saveddata will be in pyfa root or not
|
||||
saveInRoot = False
|
||||
|
||||
if debug:
|
||||
logLevel = logging.DEBUG
|
||||
else:
|
||||
logLevel = logging.WARN
|
||||
|
||||
# Version data
|
||||
version = "1.14.1"
|
||||
tag = "git"
|
||||
expansionName = "Singularity"
|
||||
expansionVersion = "965413"
|
||||
evemonMinVersion = "4081"
|
||||
|
||||
pyfaPath = None
|
||||
savePath = None
|
||||
staticPath = None
|
||||
saveDB = None
|
||||
gameDB = None
|
||||
|
||||
|
||||
class StreamToLogger(object):
|
||||
"""
|
||||
Fake file-like stream object that redirects writes to a logger instance.
|
||||
From: http://www.electricmonk.nl/log/2011/08/14/redirect-stdout-and-stderr-to-a-logger-in-python/
|
||||
"""
|
||||
def __init__(self, logger, log_level=logging.INFO):
|
||||
self.logger = logger
|
||||
self.log_level = log_level
|
||||
self.linebuf = ''
|
||||
|
||||
def write(self, buf):
|
||||
for line in buf.rstrip().splitlines():
|
||||
self.logger.log(self.log_level, line.rstrip())
|
||||
|
||||
def __createDirs(path):
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
|
||||
def defPaths():
|
||||
global pyfaPath
|
||||
global savePath
|
||||
global staticPath
|
||||
global saveDB
|
||||
global gameDB
|
||||
global saveInRoot
|
||||
# The main pyfa directory which contains run.py
|
||||
# Python 2.X uses ANSI by default, so we need to convert the character encoding
|
||||
pyfaPath = getattr(configforced, "pyfaPath", pyfaPath)
|
||||
if pyfaPath is None:
|
||||
pyfaPath = unicode(os.path.dirname(os.path.realpath(os.path.abspath(
|
||||
sys.modules['__main__'].__file__))), sys.getfilesystemencoding())
|
||||
|
||||
# Where we store the saved fits etc, default is the current users home directory
|
||||
if saveInRoot is True:
|
||||
savePath = getattr(configforced, "savePath", None)
|
||||
if savePath is None:
|
||||
savePath = os.path.join(pyfaPath, "saveddata")
|
||||
else:
|
||||
savePath = getattr(configforced, "savePath", None)
|
||||
if savePath is None:
|
||||
savePath = unicode(os.path.expanduser(os.path.join("~", ".pyfa")),
|
||||
sys.getfilesystemencoding())
|
||||
|
||||
__createDirs(savePath)
|
||||
|
||||
format = '%(asctime)s %(name)-24s %(levelname)-8s %(message)s'
|
||||
logging.basicConfig(format=format, level=logLevel)
|
||||
handler = logging.handlers.RotatingFileHandler(os.path.join(savePath, "log.txt"), maxBytes=1000000, backupCount=3)
|
||||
formatter = logging.Formatter(format)
|
||||
handler.setFormatter(formatter)
|
||||
logging.getLogger('').addHandler(handler)
|
||||
|
||||
logging.info("Starting pyfa")
|
||||
|
||||
if hasattr(sys, 'frozen'):
|
||||
stdout_logger = logging.getLogger('STDOUT')
|
||||
sl = StreamToLogger(stdout_logger, logging.INFO)
|
||||
sys.stdout = sl
|
||||
|
||||
stderr_logger = logging.getLogger('STDERR')
|
||||
sl = StreamToLogger(stderr_logger, logging.ERROR)
|
||||
sys.stderr = sl
|
||||
|
||||
# Static EVE Data from the staticdata repository, should be in the staticdata
|
||||
# directory in our pyfa directory
|
||||
staticPath = os.path.join(pyfaPath, "staticdata")
|
||||
|
||||
# The database where we store all the fits etc
|
||||
saveDB = os.path.join(savePath, "saveddata.db")
|
||||
|
||||
# The database where the static EVE data from the datadump is kept.
|
||||
# This is not the standard sqlite datadump but a modified version created by eos
|
||||
# maintenance script
|
||||
gameDB = os.path.join(staticPath, "eve.db")
|
||||
|
||||
## DON'T MODIFY ANYTHING BELOW ##
|
||||
import eos.config
|
||||
|
||||
#Caching modifiers, disable all gamedata caching, its unneeded.
|
||||
eos.config.gamedataCache = False
|
||||
# saveddata db location modifier, shouldn't ever need to touch this
|
||||
eos.config.saveddata_connectionstring = "sqlite:///" + saveDB + "?check_same_thread=False"
|
||||
eos.config.gamedata_connectionstring = "sqlite:///" + gameDB + "?check_same_thread=False"
|
||||
|
||||
@@ -82,18 +82,25 @@ class CapSimulator(object):
|
||||
if self.scale:
|
||||
duration, capNeed = self.scale_activation(duration, capNeed)
|
||||
|
||||
if self.stagger:
|
||||
duration = int(duration/amount)
|
||||
else:
|
||||
capNeed *= amount
|
||||
|
||||
period = lcm(period, duration)
|
||||
|
||||
# set clipSize to infinite if reloads are disabled unless it's
|
||||
# a cap booster module.
|
||||
if not self.reload and capNeed > 0:
|
||||
clipSize = 0
|
||||
|
||||
if self.stagger:
|
||||
if clipSize == 0:
|
||||
duration = int(duration/amount)
|
||||
else:
|
||||
stagger_amount = (duration*clipSize+10000)/(amount*clipSize)
|
||||
for i in range(1, amount):
|
||||
heapq.heappush(self.state,
|
||||
[i*stagger_amount, duration,
|
||||
capNeed, 0, clipSize])
|
||||
else:
|
||||
capNeed *= amount
|
||||
|
||||
period = lcm(period, duration)
|
||||
|
||||
# period optimization doesn't work when reloads are active.
|
||||
if clipSize:
|
||||
disable_period = True
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import os.path
|
||||
from os.path import realpath, join, dirname, abspath
|
||||
import sys
|
||||
|
||||
debug = False
|
||||
gamedataCache = True
|
||||
saveddataCache = True
|
||||
gamedata_connectionstring = 'sqlite:///' + os.path.expanduser(os.path.join("~", ".pyfa","eve.db"))
|
||||
gamedata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "staticdata", "eve.db")), sys.getfilesystemencoding())
|
||||
saveddata_connectionstring = 'sqlite:///:memory:'
|
||||
|
||||
#Autodetect path, only change if the autodetection bugs out.
|
||||
path = os.path.dirname(unicode(__file__, sys.getfilesystemencoding()))
|
||||
path = dirname(unicode(__file__, sys.getfilesystemencoding()))
|
||||
|
||||
@@ -40,6 +40,15 @@ gamedata_meta = MetaData()
|
||||
gamedata_meta.bind = gamedata_engine
|
||||
gamedata_session = sessionmaker(bind=gamedata_engine, autoflush=False, expire_on_commit=False)()
|
||||
|
||||
# This should be moved elsewhere, maybe as an actual query. Current, without try-except, it breaks when making a new
|
||||
# game db because we haven't reached gamedata_meta.create_all()
|
||||
try:
|
||||
config.gamedata_version = gamedata_session.execute(
|
||||
"SELECT `field_value` FROM `metadata` WHERE `field_name` LIKE 'client_build'"
|
||||
).fetchone()[0]
|
||||
except:
|
||||
config.gamedata_version = None
|
||||
|
||||
saveddata_connectionstring = config.saveddata_connectionstring
|
||||
if saveddata_connectionstring is not None:
|
||||
if callable(saveddata_connectionstring):
|
||||
@@ -49,7 +58,6 @@ if saveddata_connectionstring is not None:
|
||||
|
||||
saveddata_meta = MetaData()
|
||||
saveddata_meta.bind = saveddata_engine
|
||||
migration.update(saveddata_engine)
|
||||
saveddata_session = sessionmaker(bind=saveddata_engine, autoflush=False, expire_on_commit=False)()
|
||||
|
||||
# Lock controlling any changes introduced to session
|
||||
@@ -66,7 +74,8 @@ from eos.db.saveddata.queries import getUser, getCharacter, getFit, getFitsWithS
|
||||
getCharacterList, getPrice, getDamagePatternList, getDamagePattern, \
|
||||
getFitList, getFleetList, getFleet, save, remove, commit, add, \
|
||||
getCharactersForUser, getMiscData, getSquadsIDsWithFitID, getWing, \
|
||||
getSquad, getBoosterFits, getProjectedFits
|
||||
getSquad, getBoosterFits, getProjectedFits, getTargetResistsList, getTargetResists,\
|
||||
clearPrices, countAllFits
|
||||
|
||||
#If using in memory saveddata, you'll want to reflect it so the data structure is good.
|
||||
if config.saveddata_connectionstring == "sqlite:///:memory:":
|
||||
@@ -75,3 +84,4 @@ if config.saveddata_connectionstring == "sqlite:///:memory:":
|
||||
def rollback():
|
||||
with sd_lock:
|
||||
saveddata_session.rollback()
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ attributes_table = Table("dgmattribs", gamedata_meta,
|
||||
Column("attributeID", Integer, primary_key = True),
|
||||
Column("attributeName", String),
|
||||
Column("defaultValue", Float),
|
||||
Column("maxAttributeID", Integer, ForeignKey("dgmattribs.attributeID")),
|
||||
Column("description", Unicode),
|
||||
Column("published", Boolean),
|
||||
Column("displayName", String),
|
||||
|
||||
@@ -30,6 +30,7 @@ items_table = Table("invtypes", gamedata_meta,
|
||||
Column("typeName", String, index=True),
|
||||
Column("description", String),
|
||||
Column("raceID", Integer),
|
||||
Column("factionID", Integer),
|
||||
Column("volume", Float),
|
||||
Column("mass", Float),
|
||||
Column("capacity", Float),
|
||||
@@ -53,9 +54,8 @@ mapper(Item, items_table,
|
||||
"name" : synonym("typeName"),
|
||||
"description" : deferred(items_table.c.description),
|
||||
"traits" : relation(Traits,
|
||||
primaryjoin = traits_table.c.typeID == items_table.c.typeID,
|
||||
order_by = traits_table.c.typeID,
|
||||
uselist = True)
|
||||
primaryjoin = traits_table.c.typeID == items_table.c.typeID,
|
||||
uselist = False)
|
||||
})
|
||||
|
||||
Item.category = association_proxy("group", "category")
|
||||
|
||||
@@ -23,7 +23,7 @@ from eos.types import MetaData
|
||||
from eos.db import gamedata_meta
|
||||
|
||||
metadata_table = Table("metadata", gamedata_meta,
|
||||
Column("fieldName", String, primary_key=True),
|
||||
Column("fieldValue", String))
|
||||
Column("field_name", String, primary_key=True),
|
||||
Column("field_value", String))
|
||||
|
||||
mapper(MetaData, metadata_table)
|
||||
|
||||
@@ -1,22 +1,11 @@
|
||||
|
||||
from sqlalchemy import Column, Table, Integer, String, ForeignKey, and_, select
|
||||
from sqlalchemy.orm import mapper, column_property
|
||||
from eos.types import Item, Traits
|
||||
from sqlalchemy import Column, Table, Integer, String, ForeignKey
|
||||
from sqlalchemy.orm import mapper
|
||||
from eos.types import Traits
|
||||
from eos.db import gamedata_meta
|
||||
|
||||
traits_table = Table("invtraits", gamedata_meta,
|
||||
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True),
|
||||
Column("skillID", Integer, ForeignKey("invtypes.typeID"), primary_key=True),
|
||||
Column("bonusText", String, primary_key=True))
|
||||
Column("traitText", String))
|
||||
|
||||
|
||||
from .item import items_table
|
||||
|
||||
mapper(Traits, traits_table,
|
||||
properties = {"skillName" : column_property(
|
||||
select([items_table.c.typeName],
|
||||
and_(
|
||||
items_table.c.typeID == traits_table.c.skillID,
|
||||
traits_table.c.skillID != -1
|
||||
)))
|
||||
});
|
||||
mapper(Traits, traits_table);
|
||||
|
||||
@@ -1,59 +1,46 @@
|
||||
import sqlalchemy
|
||||
import config
|
||||
import shutil
|
||||
import time
|
||||
import re
|
||||
import os
|
||||
|
||||
def getAppVersion():
|
||||
# calculate app version based on upgrade files we have
|
||||
appVersion = 0
|
||||
for fname in os.listdir(os.path.join(os.path.dirname(__file__), "migrations")):
|
||||
m = re.match("^upgrade(?P<index>\d+)\.py$", fname)
|
||||
if not m:
|
||||
continue
|
||||
index = int(m.group("index"))
|
||||
appVersion = max(appVersion, index)
|
||||
return appVersion
|
||||
|
||||
def getVersion(db):
|
||||
cursor = db.execute('PRAGMA user_version')
|
||||
return cursor.fetchone()[0]
|
||||
|
||||
def update(saveddata_engine):
|
||||
checkPriceFailures(saveddata_engine)
|
||||
checkApiDefaultChar(saveddata_engine)
|
||||
checkFitBooster(saveddata_engine)
|
||||
dbVersion = getVersion(saveddata_engine)
|
||||
appVersion = getAppVersion()
|
||||
|
||||
def checkPriceFailures(saveddata_engine):
|
||||
# Check if we have 'failed' column
|
||||
try:
|
||||
saveddata_engine.execute("SELECT failed FROM prices")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
# As we don't have any important data there, let's just drop
|
||||
# and recreate whole table
|
||||
from eos.db.saveddata.price import prices_table
|
||||
# Attempt to drop/create table only if it's already there
|
||||
try:
|
||||
prices_table.drop(saveddata_engine)
|
||||
prices_table.create(saveddata_engine)
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
pass
|
||||
if dbVersion == appVersion:
|
||||
return
|
||||
|
||||
if dbVersion < appVersion:
|
||||
# Automatically backup database
|
||||
toFile = "%s/saveddata_migration_%d-%d_%s.db"%(
|
||||
config.savePath,
|
||||
dbVersion,
|
||||
appVersion,
|
||||
time.strftime("%Y%m%d_%H%M%S"))
|
||||
|
||||
def checkApiDefaultChar(saveddata_engine):
|
||||
try:
|
||||
saveddata_engine.execute("SELECT * FROM characters LIMIT 1")
|
||||
# If table doesn't exist, it means we're doing everything from scratch
|
||||
# and sqlalchemy will process everything as needed
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
pass
|
||||
# If not, we're running on top of existing DB
|
||||
else:
|
||||
# Check that we have columns
|
||||
try:
|
||||
saveddata_engine.execute("SELECT defaultChar, chars FROM characters LIMIT 1")
|
||||
# If we don't, create them
|
||||
# This is ugly as hell, but we can't use proper migrate packages as it
|
||||
# will require us to rebuild skeletons, including mac
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE characters ADD COLUMN defaultChar INTEGER;")
|
||||
saveddata_engine.execute("ALTER TABLE characters ADD COLUMN chars VARCHAR;")
|
||||
shutil.copyfile(config.saveDB, toFile)
|
||||
|
||||
def checkFitBooster(saveddata_engine):
|
||||
try:
|
||||
saveddata_engine.execute("SELECT * FROM fits LIMIT 1")
|
||||
# If table doesn't exist, it means we're doing everything from scratch
|
||||
# and sqlalchemy will process everything as needed
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
pass
|
||||
# If not, we're running on top of existing DB
|
||||
else:
|
||||
# Check that we have columns
|
||||
try:
|
||||
saveddata_engine.execute("SELECT booster FROM fits LIMIT 1")
|
||||
# If we don't, create them
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN booster BOOLEAN;")
|
||||
# Set NULL data to 0 (needed in case of downgrade, see GH issue #62
|
||||
saveddata_engine.execute("UPDATE fits SET booster = 0 WHERE booster IS NULL;")
|
||||
for version in xrange(dbVersion, appVersion):
|
||||
module = __import__("eos.db.migrations.upgrade{}".format(version + 1), fromlist=True)
|
||||
upgrade = getattr(module, "upgrade", False)
|
||||
if upgrade:
|
||||
upgrade(saveddata_engine)
|
||||
|
||||
# when all is said and done, set version to current
|
||||
saveddata_engine.execute("PRAGMA user_version = {}".format(appVersion))
|
||||
|
||||
9
eos/db/migrations/__init__.py
Normal file
9
eos/db/migrations/__init__.py
Normal file
@@ -0,0 +1,9 @@
|
||||
"""
|
||||
The migration module includes migration logic to update database scheme and/or
|
||||
data for the user database.
|
||||
|
||||
To create a migration, simply create a file upgrade<migration number>.py and
|
||||
define an upgrade() function with the logic. Please note that there must be as
|
||||
many upgrade files as there are database versions (version 5 would include
|
||||
upgrade files 1-5)
|
||||
"""
|
||||
97
eos/db/migrations/upgrade1.py
Normal file
97
eos/db/migrations/upgrade1.py
Normal file
@@ -0,0 +1,97 @@
|
||||
"""
|
||||
Migration 1
|
||||
|
||||
- Alters fits table to introduce target resist attribute
|
||||
- Converts modules based on Oceanus Module Tiericide
|
||||
Some modules have been deleted, which causes pyfa to crash when fits are
|
||||
loaded as they no longer exist in the database. We therefore replace these
|
||||
modules with their new replacements
|
||||
|
||||
Based on http://community.eveonline.com/news/patch-notes/patch-notes-for-oceanus/
|
||||
and output of itemDiff.py
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
CONVERSIONS = {
|
||||
6135: [ # Scoped Cargo Scanner
|
||||
6133, # Interior Type-E Cargo Identifier
|
||||
],
|
||||
6527: [ # Compact Ship Scanner
|
||||
6525, # Ta3 Perfunctory Vessel Probe
|
||||
6529, # Speculative Ship Identifier I
|
||||
6531, # Practical Type-E Ship Probe
|
||||
],
|
||||
6569: [ # Scoped Survey Scanner
|
||||
6567, # ML-3 Amphilotite Mining Probe
|
||||
6571, # Rock-Scanning Sensor Array I
|
||||
6573, # 'Dactyl' Type-E Asteroid Analyzer
|
||||
],
|
||||
509: [ # 'Basic' Capacitor Flux Coil
|
||||
8163, # Partial Power Plant Manager: Capacitor Flux
|
||||
8165, # Alpha Reactor Control: Capacitor Flux
|
||||
8167, # Type-E Power Core Modification: Capacitor Flux
|
||||
8169, # Marked Generator Refitting: Capacitor Flux
|
||||
],
|
||||
8135: [ # Restrained Capacitor Flux Coil
|
||||
8131, # Local Power Plant Manager: Capacitor Flux I
|
||||
],
|
||||
8133: [ # Compact Capacitor Flux Coil
|
||||
8137, # Mark I Generator Refitting: Capacitor Flux
|
||||
],
|
||||
3469: [ # Basic Co-Processor
|
||||
8744, # Nanoelectrical Co-Processor
|
||||
8743, # Nanomechanical CPU Enhancer
|
||||
8746, # Quantum Co-Processor
|
||||
8745, # Photonic CPU Enhancer
|
||||
15425, # Naiyon's Modified Co-Processor (never existed but convert
|
||||
# anyway as some fits may include it)
|
||||
],
|
||||
8748: [ # Upgraded Co-Processor
|
||||
8747, # Nanomechanical CPU Enhancer I
|
||||
8750, # Quantum Co-Processor I
|
||||
8749, # Photonic CPU Enhancer I
|
||||
],
|
||||
1351: [ # Basic Reactor Control Unit
|
||||
8251, # Partial Power Plant Manager: Reaction Control
|
||||
8253, # Alpha Reactor Control: Reaction Control
|
||||
8257, # Marked Generator Refitting: Reaction Control
|
||||
],
|
||||
8263: [ # Compact Reactor Control Unit
|
||||
8259, # Local Power Plant Manager: Reaction Control I
|
||||
8265, # Mark I Generator Refitting: Reaction Control
|
||||
8261, # Beta Reactor Control: Reaction Control I
|
||||
],
|
||||
16537: [ # Compact Micro Auxiliary Power Core
|
||||
16539, # Micro B88 Core Augmentation
|
||||
16541, # Micro K-Exhaust Core Augmentation
|
||||
],
|
||||
31936: [ # Navy Micro Auxiliary Power Core
|
||||
16543, # Micro 'Vigor' Core Augmentation
|
||||
],
|
||||
8089: [ # Compact Light Missile Launcher
|
||||
8093, # Prototype 'Arbalest' Light Missile Launcher
|
||||
],
|
||||
8091: [ # Ample Light Missile Launcher
|
||||
7993, # Experimental TE-2100 Light Missile Launcher
|
||||
],
|
||||
# Surface Cargo Scanner I was removed from game, however no mention of
|
||||
# replacement module in patch notes. Morphing it to meta 0 module to be safe
|
||||
442: [ # Cargo Scanner I
|
||||
6129, # Surface Cargo Scanner I
|
||||
]
|
||||
}
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Update fits schema to include target resists attribute
|
||||
try:
|
||||
saveddata_engine.execute("SELECT targetResistsID FROM fits LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN targetResistsID INTEGER;")
|
||||
|
||||
# Convert modules
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?', (replacement_item, retired_item))
|
||||
saveddata_engine.execute('UPDATE "cargo" SET "itemID" = ? WHERE "itemID" = ?', (replacement_item, retired_item))
|
||||
|
||||
16
eos/db/migrations/upgrade10.py
Normal file
16
eos/db/migrations/upgrade10.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
Migration 10
|
||||
|
||||
- Adds active attribute to projected fits
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Update projectedFits schema to include active attribute
|
||||
try:
|
||||
saveddata_engine.execute("SELECT active FROM projectedFits LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE projectedFits ADD COLUMN active BOOLEAN")
|
||||
saveddata_engine.execute("UPDATE projectedFits SET active = 1")
|
||||
saveddata_engine.execute("UPDATE projectedFits SET amount = 1")
|
||||
21
eos/db/migrations/upgrade2.py
Normal file
21
eos/db/migrations/upgrade2.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Migration 2
|
||||
|
||||
- Includes old upgrade paths pre-1.5.0. See GH issue #190 for why this is needed
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Update characters schema to include default chars
|
||||
try:
|
||||
saveddata_engine.execute("SELECT defaultChar, chars FROM characters LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE characters ADD COLUMN defaultChar INTEGER")
|
||||
saveddata_engine.execute("ALTER TABLE characters ADD COLUMN chars VARCHAR")
|
||||
|
||||
# Update fits schema to include booster attribute
|
||||
try:
|
||||
saveddata_engine.execute("SELECT booster FROM fits LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN booster BOOLEAN")
|
||||
13
eos/db/migrations/upgrade3.py
Normal file
13
eos/db/migrations/upgrade3.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""
|
||||
Migration 3
|
||||
|
||||
- Adds mode column for fits (t3 dessy)
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
try:
|
||||
saveddata_engine.execute("SELECT modeID FROM fits LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN modeID INTEGER")
|
||||
141
eos/db/migrations/upgrade4.py
Normal file
141
eos/db/migrations/upgrade4.py
Normal file
@@ -0,0 +1,141 @@
|
||||
"""
|
||||
Migration 4
|
||||
|
||||
- Converts modules based on Proteus Module Tiericide
|
||||
Some modules have been unpublished (and unpublished module attributes are removed
|
||||
from database), which causes pyfa to crash. We therefore replace these
|
||||
modules with their new replacements
|
||||
|
||||
Based on http://community.eveonline.com/news/patch-notes/patch-notes-for-proteus/
|
||||
and output of itemDiff.py
|
||||
"""
|
||||
|
||||
|
||||
CONVERSIONS = {
|
||||
506: ( # 'Basic' Capacitor Power Relay
|
||||
8205, # Alpha Reactor Control: Capacitor Power Relay
|
||||
8209, # Marked Generator Refitting: Capacitor Power Relay
|
||||
8203, # Partial Power Plant Manager: Capacity Power Relay
|
||||
8207, # Type-E Power Core Modification: Capacitor Power Relay
|
||||
),
|
||||
8177: ( # Mark I Compact Capacitor Power Relay
|
||||
8173, # Beta Reactor Control: Capacitor Power Relay I
|
||||
),
|
||||
8175: ( # Type-D Restrained Capacitor Power Relay
|
||||
8171, # Local Power Plant Manager: Capacity Power Relay I
|
||||
),
|
||||
|
||||
421: ( # 'Basic' Capacitor Recharger
|
||||
4425, # AGM Capacitor Charge Array,
|
||||
4421, # F-a10 Buffer Capacitor Regenerator
|
||||
4423, # Industrial Capacitor Recharger
|
||||
4427, # Secondary Parallel Link-Capacitor
|
||||
),
|
||||
4435: ( # Eutectic Compact Cap Recharger
|
||||
4433, # Barton Reactor Capacitor Recharger I
|
||||
4431, # F-b10 Nominal Capacitor Regenerator
|
||||
4437, # Fixed Parallel Link-Capacitor I
|
||||
),
|
||||
|
||||
1315: ( # 'Basic' Expanded Cargohold
|
||||
5483, # Alpha Hull Mod Expanded Cargo
|
||||
5479, # Marked Modified SS Expanded Cargo
|
||||
5481, # Partial Hull Conversion Expanded Cargo
|
||||
5485, # Type-E Altered SS Expanded Cargo
|
||||
),
|
||||
5493: ( # Type-D Restrained Expanded Cargo
|
||||
5491, # Beta Hull Mod Expanded Cargo
|
||||
5489, # Local Hull Conversion Expanded Cargo I
|
||||
5487, # Mark I Modified SS Expanded Cargo
|
||||
),
|
||||
|
||||
1401: ( # 'Basic' Inertial Stabilizers
|
||||
5523, # Alpha Hull Mod Inertial Stabilizers
|
||||
5521, # Partial Hull Conversion Inertial Stabilizers
|
||||
5525, # Type-E Altered SS Inertial Stabilizers
|
||||
),
|
||||
5533: ( # Type-D Restrained Inertial Stabilizers
|
||||
5531, # Beta Hull Mod Inertial Stabilizers
|
||||
5529, # Local Hull Conversion Inertial Stabilizers I
|
||||
5527, # Mark I Modified SS Inertial Stabilizers
|
||||
5519, # Marked Modified SS Inertial Stabilizers
|
||||
),
|
||||
|
||||
5239: ( # EP-S Gaussian Scoped Mining Laser
|
||||
5241, # Dual Diode Mining Laser I
|
||||
),
|
||||
5233: ( # Single Diode Basic Mining Laser
|
||||
5231, # EP-R Argon Ion Basic Excavation Pulse
|
||||
5237, # Rubin Basic Particle Bore Stream
|
||||
5235, # Xenon Basic Drilling Beam
|
||||
),
|
||||
5245: ( # Particle Bore Compact Mining Laser
|
||||
5243, # XeCl Drilling Beam I
|
||||
),
|
||||
|
||||
22619: ( # Frigoris Restrained Ice Harvester Upgrade
|
||||
22617, # Crisium Ice Harvester Upgrade
|
||||
),
|
||||
22611: ( # Elara Restrained Mining Laser Upgrade
|
||||
22609, # Erin Mining Laser Upgrade
|
||||
),
|
||||
|
||||
1242: ( # 'Basic' Nanofiber Internal Structure
|
||||
5591, # Alpha Hull Mod Nanofiber Structure
|
||||
5595, # Marked Modified SS Nanofiber Structure
|
||||
5559, # Partial Hull Conversion Nanofiber Structure
|
||||
5593, # Type-E Altered SS Nanofiber Structure
|
||||
),
|
||||
5599: ( # Type-D Restrained Nanofiber Structure
|
||||
5597, # Beta Hull Mod Nanofiber Structure
|
||||
5561, # Local Hull Conversion Nanofiber Structure I
|
||||
5601, # Mark I Modified SS Nanofiber Structure
|
||||
),
|
||||
|
||||
1192: ( # 'Basic' Overdrive Injector System
|
||||
5613, # Alpha Hull Mod Overdrive Injector
|
||||
5617, # Marked Modified SS Overdrive Injector
|
||||
5611, # Partial Hull Conversion Overdrive Injector
|
||||
5615, # Type-E Altered SS Overdrive Injector
|
||||
),
|
||||
5631: ( # Type-D Restrained Overdrive Injector
|
||||
5629, # Beta Hull Mod Overdrive Injector
|
||||
5627, # Local Hull Conversion Overdrive Injector I
|
||||
5633, # Mark I Modified SS Overdrive Injector
|
||||
),
|
||||
|
||||
1537: ( # 'Basic' Power Diagnostic System
|
||||
8213, # Alpha Reactor Control: Diagnostic System
|
||||
8217, # Marked Generator Refitting: Diagnostic System
|
||||
8211, # Partial Power Plant Manager: Diagnostic System
|
||||
8215, # Type-E Power Core Modification: Diagnostic System
|
||||
8255, # Type-E Power Core Modification: Reaction Control
|
||||
),
|
||||
8225: ( # Mark I Compact Power Diagnostic System
|
||||
8221, # Beta Reactor Control: Diagnostic System I
|
||||
8219, # Local Power Plant Manager: Diagnostic System I
|
||||
8223, # Type-D Power Core Modification: Diagnostic System
|
||||
),
|
||||
|
||||
1240: ( # 'Basic' Reinforced Bulkheads
|
||||
5677, # Alpha Hull Mod Reinforced Bulkheads
|
||||
5681, # Marked Modified SS Reinforced Bulkheads
|
||||
5675, # Partial Hull Conversion Reinforced Bulkheads
|
||||
5679, # Type-E Altered SS Reinforced Bulkheads
|
||||
),
|
||||
5649: ( # Mark I Compact Reinforced Bulkheads
|
||||
5645, # Beta Hull Mod Reinforced Bulkheads
|
||||
),
|
||||
5647: ( # Type-D Restrained Reinforced Bulkheads
|
||||
5643, # Local Hull Conversion Reinforced Bulkheads I
|
||||
),
|
||||
}
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
|
||||
# Convert modules
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?', (replacement_item, retired_item))
|
||||
saveddata_engine.execute('UPDATE "cargo" SET "itemID" = ? WHERE "itemID" = ?', (replacement_item, retired_item))
|
||||
|
||||
8
eos/db/migrations/upgrade5.py
Normal file
8
eos/db/migrations/upgrade5.py
Normal file
@@ -0,0 +1,8 @@
|
||||
"""
|
||||
Migration 5
|
||||
|
||||
Simply deletes damage profiles with a blank name. See GH issue #256
|
||||
"""
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
saveddata_engine.execute('DELETE FROM damagePatterns WHERE name LIKE ?', ("",))
|
||||
9
eos/db/migrations/upgrade6.py
Normal file
9
eos/db/migrations/upgrade6.py
Normal file
@@ -0,0 +1,9 @@
|
||||
"""
|
||||
Migration 6
|
||||
|
||||
Overwrites damage profile 0 to reset bad uniform values (bad values set with bug)
|
||||
"""
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
saveddata_engine.execute('DELETE FROM damagePatterns WHERE name LIKE ? OR ID LIKE ?', ("Uniform", "1"))
|
||||
saveddata_engine.execute('INSERT INTO damagePatterns VALUES (?, ?, ?, ?, ?, ?, ?)', (1, "Uniform", 25, 25, 25, 25, None))
|
||||
24
eos/db/migrations/upgrade7.py
Normal file
24
eos/db/migrations/upgrade7.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""
|
||||
Migration 7
|
||||
|
||||
- Converts Scorpion Ishukone Watch to Scorpion
|
||||
|
||||
Mosaic introduced proper skinning system, and Ishukone Scorp
|
||||
was the only ship which was presented as stand-alone ship in
|
||||
Pyfa.
|
||||
"""
|
||||
|
||||
|
||||
CONVERSIONS = {
|
||||
640: ( # Scorpion
|
||||
4005, # Scorpion Ishukone Watch
|
||||
)
|
||||
}
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
|
||||
# Convert ships
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "fits" SET "shipID" = ? WHERE "shipID" = ?', (replacement_item, retired_item))
|
||||
|
||||
85
eos/db/migrations/upgrade8.py
Normal file
85
eos/db/migrations/upgrade8.py
Normal file
@@ -0,0 +1,85 @@
|
||||
"""
|
||||
Migration 8
|
||||
|
||||
- Converts modules based on Carnyx Module Tiericide
|
||||
Some modules have been unpublished (and unpublished module attributes are removed
|
||||
from database), which causes pyfa to crash. We therefore replace these
|
||||
modules with their new replacements
|
||||
"""
|
||||
|
||||
|
||||
CONVERSIONS = {
|
||||
8529: ( # Large F-S9 Regolith Compact Shield Extender
|
||||
8409, # Large Subordinate Screen Stabilizer I
|
||||
),
|
||||
8419: ( # Large Azeotropic Restrained Shield Extender
|
||||
8489, # Large Supplemental Barrier Emitter I
|
||||
),
|
||||
8517: ( # Medium F-S9 Regolith Compact Shield Extender
|
||||
8397, # Medium Subordinate Screen Stabilizer I
|
||||
),
|
||||
8433: ( # Medium Azeotropic Restrained Shield Extender
|
||||
8477, # Medium Supplemental Barrier Emitter I
|
||||
),
|
||||
20627: ( # Small 'Trapper' Shield Extender
|
||||
8437, # Micro Azeotropic Ward Salubrity I
|
||||
8505, # Micro F-S9 Regolith Shield Induction
|
||||
3849, # Micro Shield Extender I
|
||||
3851, # Micro Shield Extender II
|
||||
8387, # Micro Subordinate Screen Stabilizer I
|
||||
8465, # Micro Supplemental Barrier Emitter I
|
||||
),
|
||||
8521: ( # Small F-S9 Regolith Compact Shield Extender
|
||||
8401, # Small Subordinate Screen Stabilizer I
|
||||
),
|
||||
8427: ( # Small Azeotropic Restrained Shield Extender
|
||||
8481, # Small Supplemental Barrier Emitter I
|
||||
),
|
||||
11343: ( # 100mm Crystalline Carbonide Restrained Plates
|
||||
11345, # 100mm Reinforced Nanofiber Plates I
|
||||
),
|
||||
11341: ( # 100mm Rolled Tungsten Compact Plates
|
||||
11339, # 100mm Reinforced Titanium Plates I
|
||||
),
|
||||
11327: ( # 1600mm Crystalline Carbonide Restrained Plates
|
||||
11329, # 1600mm Reinforced Nanofiber Plates I
|
||||
),
|
||||
11325: ( # 1600mm Rolled Tungsten Compact Plates
|
||||
11323, # 1600mm Reinforced Titanium Plates I
|
||||
),
|
||||
11351: ( # 200mm Crystalline Carbonide Restrained Plates
|
||||
11353, # 200mm Reinforced Nanofiber Plates I
|
||||
),
|
||||
11349: ( # 200mm Rolled Tungsten Compact Plates
|
||||
11347, # 200mm Reinforced Titanium Plates I
|
||||
),
|
||||
11311: ( # 400mm Crystalline Carbonide Restrained Plates
|
||||
11313, # 400mm Reinforced Nanofiber Plates I
|
||||
),
|
||||
11309: ( # 400mm Rolled Tungsten Compact Plates
|
||||
11307, # 400mm Reinforced Titanium Plates I
|
||||
),
|
||||
23791: ( # 'Citadella' 100mm Steel Plates
|
||||
11335, # 50mm Reinforced Crystalline Carbonide Plates I
|
||||
11337, # 50mm Reinforced Nanofiber Plates I
|
||||
11333, # 50mm Reinforced Rolled Tungsten Plates I
|
||||
11291, # 50mm Reinforced Steel Plates I
|
||||
20343, # 50mm Reinforced Steel Plates II
|
||||
11331, # 50mm Reinforced Titanium Plates I
|
||||
),
|
||||
11319: ( # 800mm Crystalline Carbonide Restrained Plates
|
||||
11321, # 800mm Reinforced Nanofiber Plates I
|
||||
),
|
||||
11317: ( # 800mm Rolled Tungsten Compact Plates
|
||||
11315, # 800mm Reinforced Titanium Plates I
|
||||
),
|
||||
}
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
|
||||
# Convert modules
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?', (replacement_item, retired_item))
|
||||
saveddata_engine.execute('UPDATE "cargo" SET "itemID" = ? WHERE "itemID" = ?', (replacement_item, retired_item))
|
||||
|
||||
23
eos/db/migrations/upgrade9.py
Normal file
23
eos/db/migrations/upgrade9.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Migration 9
|
||||
|
||||
Effectively drops UNIQUE constraint from boosters table. SQLite does not support
|
||||
this, so we have to copy the table to the updated schema and then rename it
|
||||
"""
|
||||
|
||||
tmpTable = """
|
||||
CREATE TABLE boostersTemp (
|
||||
'ID' INTEGER NOT NULL,
|
||||
'itemID' INTEGER,
|
||||
'fitID' INTEGER NOT NULL,
|
||||
'active' BOOLEAN,
|
||||
PRIMARY KEY(ID),
|
||||
FOREIGN KEY('fitID') REFERENCES fits ('ID')
|
||||
)
|
||||
"""
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
saveddata_engine.execute(tmpTable)
|
||||
saveddata_engine.execute("INSERT INTO boostersTemp (ID, itemID, fitID, active) SELECT ID, itemID, fitID, active FROM boosters")
|
||||
saveddata_engine.execute("DROP TABLE boosters")
|
||||
saveddata_engine.execute("ALTER TABLE boostersTemp RENAME TO boosters")
|
||||
@@ -1,3 +1,3 @@
|
||||
__all__ = ["character", "fit", "module", "user", "skill", "price",
|
||||
"booster", "drone", "implant", "fleet", "damagePattern",
|
||||
"miscData"]
|
||||
"miscData", "targetResists"]
|
||||
|
||||
@@ -29,7 +29,7 @@ boosters_table = Table("boosters", saveddata_meta,
|
||||
Column("itemID", Integer),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable = False),
|
||||
Column("active", Boolean),
|
||||
UniqueConstraint("itemID", "fitID"))
|
||||
)
|
||||
|
||||
activeSideEffects_table = Table("boostersActiveSideEffects", saveddata_meta,
|
||||
Column("boosterID", ForeignKey("boosters.ID"), primary_key = True),
|
||||
|
||||
@@ -17,19 +17,20 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
#===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, String, Boolean
|
||||
from sqlalchemy.orm import relation, mapper
|
||||
from sqlalchemy import *
|
||||
from sqlalchemy.orm import *
|
||||
from sqlalchemy.sql import and_
|
||||
from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.orm.collections import attribute_mapped_collection
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.db.saveddata.module import modules_table
|
||||
from eos.db.saveddata.drone import drones_table
|
||||
from eos.db.saveddata.cargo import cargo_table
|
||||
from eos.db.saveddata.implant import fitImplants_table
|
||||
from eos.types import Fit, Module, User, Booster, Drone, Cargo, Implant, Character, DamagePattern
|
||||
from eos.effectHandlerHelpers import HandledModuleList, HandledDroneList, \
|
||||
HandledImplantBoosterList, HandledProjectedModList, HandledProjectedDroneList, \
|
||||
HandledProjectedFitList, HandledCargoList
|
||||
from eos.types import Fit, Module, User, Booster, Drone, Cargo, Implant, Character, DamagePattern, TargetResists
|
||||
from eos.effectHandlerHelpers import *
|
||||
|
||||
fits_table = Table("fits", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable = True, index = True),
|
||||
@@ -38,35 +39,127 @@ fits_table = Table("fits", saveddata_meta,
|
||||
Column("timestamp", Integer, nullable = False),
|
||||
Column("characterID", ForeignKey("characters.ID"), nullable = True),
|
||||
Column("damagePatternID", ForeignKey("damagePatterns.ID"), nullable=True),
|
||||
Column("booster", Boolean, nullable = False, index = True, default = 0))
|
||||
Column("booster", Boolean, nullable = False, index = True, default = 0),
|
||||
Column("targetResistsID", ForeignKey("targetResists.ID"), nullable=True),
|
||||
Column("modeID", Integer, nullable=True),
|
||||
)
|
||||
|
||||
projectedFits_table = Table("projectedFits", saveddata_meta,
|
||||
Column("sourceID", ForeignKey("fits.ID"), primary_key = True),
|
||||
Column("victimID", ForeignKey("fits.ID"), primary_key = True),
|
||||
Column("amount", Integer))
|
||||
Column("amount", Integer, nullable = False, default = 1),
|
||||
Column("active", Boolean, nullable = False, default = 1),
|
||||
)
|
||||
|
||||
class ProjectedFit(object):
|
||||
def __init__(self, sourceID, source_fit, amount=1, active=True):
|
||||
self.sourceID = sourceID
|
||||
self.source_fit = source_fit
|
||||
self.active = active
|
||||
self.__amount = amount
|
||||
|
||||
@reconstructor
|
||||
def init(self):
|
||||
if self.source_fit.isInvalid:
|
||||
# Very rare for this to happen, but be prepared for it
|
||||
eos.db.saveddata_session.delete(self.source_fit)
|
||||
eos.db.saveddata_session.flush()
|
||||
eos.db.saveddata_session.refresh(self.victim_fit)
|
||||
|
||||
# We have a series of setters and getters here just in case someone
|
||||
# downgrades and screws up the table with NULL values
|
||||
@property
|
||||
def amount(self):
|
||||
return self.__amount or 1
|
||||
|
||||
@amount.setter
|
||||
def amount(self, amount):
|
||||
self.__amount = amount
|
||||
|
||||
def __repr__(self):
|
||||
return "ProjectedFit(sourceID={}, victimID={}, amount={}, active={}) at {}".format(
|
||||
self.sourceID, self.victimID, self.amount, self.active, hex(id(self))
|
||||
)
|
||||
|
||||
Fit._Fit__projectedFits = association_proxy(
|
||||
"victimOf", # look at the victimOf association...
|
||||
"source_fit", # .. and return the source fits
|
||||
creator=lambda sourceID, source_fit: ProjectedFit(sourceID, source_fit)
|
||||
)
|
||||
|
||||
mapper(Fit, fits_table,
|
||||
properties = {"_Fit__modules" : relation(Module, collection_class = HandledModuleList,
|
||||
primaryjoin = and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == False),
|
||||
order_by = modules_table.c.position, cascade='all, delete, delete-orphan'),
|
||||
"_Fit__projectedModules" : relation(Module, collection_class = HandledProjectedModList, cascade='all, delete, delete-orphan', single_parent=True,
|
||||
primaryjoin = and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == True)),
|
||||
"owner" : relation(User, backref = "fits"),
|
||||
"_Fit__boosters" : relation(Booster, collection_class = HandledImplantBoosterList, cascade='all, delete, delete-orphan', single_parent=True),
|
||||
"_Fit__drones" : relation(Drone, collection_class = HandledDroneList, cascade='all, delete, delete-orphan', single_parent=True,
|
||||
primaryjoin = and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == False)),
|
||||
"_Fit__cargo" : relation(Cargo, collection_class = HandledCargoList, cascade='all, delete, delete-orphan', single_parent=True,
|
||||
primaryjoin = and_(cargo_table.c.fitID == fits_table.c.ID)),
|
||||
"_Fit__projectedDrones" : relation(Drone, collection_class = HandledProjectedDroneList, cascade='all, delete, delete-orphan', single_parent=True,
|
||||
primaryjoin = and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == True)),
|
||||
"_Fit__implants" : relation(Implant, collection_class = HandledImplantBoosterList, cascade='all, delete, delete-orphan', single_parent=True,
|
||||
primaryjoin = fitImplants_table.c.fitID == fits_table.c.ID,
|
||||
secondaryjoin = fitImplants_table.c.implantID == Implant.ID,
|
||||
secondary = fitImplants_table),
|
||||
"_Fit__character" : relation(Character, backref = "fits"),
|
||||
"_Fit__damagePattern" : relation(DamagePattern),
|
||||
"_Fit__projectedFits" : relation(Fit,
|
||||
primaryjoin = projectedFits_table.c.victimID == fits_table.c.ID,
|
||||
secondaryjoin = fits_table.c.ID == projectedFits_table.c.sourceID,
|
||||
secondary = projectedFits_table,
|
||||
collection_class = HandledProjectedFitList)
|
||||
})
|
||||
properties = {
|
||||
"_Fit__modules": relation(
|
||||
Module,
|
||||
collection_class=HandledModuleList,
|
||||
primaryjoin=and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == False),
|
||||
order_by=modules_table.c.position,
|
||||
cascade='all, delete, delete-orphan'),
|
||||
"_Fit__projectedModules": relation(
|
||||
Module,
|
||||
collection_class=HandledProjectedModList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == True)),
|
||||
"owner": relation(
|
||||
User,
|
||||
backref="fits"),
|
||||
"itemID": fits_table.c.shipID,
|
||||
"shipID": fits_table.c.shipID,
|
||||
"_Fit__boosters": relation(
|
||||
Booster,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True),
|
||||
"_Fit__drones": relation(
|
||||
Drone,
|
||||
collection_class=HandledDroneCargoList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == False)),
|
||||
"_Fit__cargo": relation(
|
||||
Cargo,
|
||||
collection_class=HandledDroneCargoList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(cargo_table.c.fitID == fits_table.c.ID)),
|
||||
"_Fit__projectedDrones": relation(
|
||||
Drone,
|
||||
collection_class=HandledProjectedDroneList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == True)),
|
||||
"_Fit__implants": relation(
|
||||
Implant,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
backref='fit',
|
||||
single_parent=True,
|
||||
primaryjoin=fitImplants_table.c.fitID == fits_table.c.ID,
|
||||
secondaryjoin=fitImplants_table.c.implantID == Implant.ID,
|
||||
secondary=fitImplants_table),
|
||||
"_Fit__character": relation(
|
||||
Character,
|
||||
backref="fits"),
|
||||
"_Fit__damagePattern": relation(DamagePattern),
|
||||
"_Fit__targetResists": relation(TargetResists),
|
||||
"projectedOnto": relationship(
|
||||
ProjectedFit,
|
||||
primaryjoin=projectedFits_table.c.sourceID == fits_table.c.ID,
|
||||
backref='source_fit',
|
||||
collection_class=attribute_mapped_collection('victimID'),
|
||||
cascade='all, delete, delete-orphan'),
|
||||
"victimOf": relationship(
|
||||
ProjectedFit,
|
||||
primaryjoin=fits_table.c.ID == projectedFits_table.c.victimID,
|
||||
backref='victim_fit',
|
||||
collection_class=attribute_mapped_collection('sourceID'),
|
||||
cascade='all, delete, delete-orphan'),
|
||||
}
|
||||
)
|
||||
|
||||
mapper(ProjectedFit, projectedFits_table,
|
||||
properties = {
|
||||
"_ProjectedFit__amount": projectedFits_table.c.amount,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
from eos.db.util import processEager, processWhere
|
||||
from eos.db import saveddata_session, sd_lock
|
||||
from eos.types import User, Character, Fit, Price, DamagePattern, Fleet, MiscData, Wing, Squad
|
||||
from eos.types import User, Character, Fit, Price, DamagePattern, Fleet, MiscData, Wing, Squad, TargetResists
|
||||
from eos.db.saveddata.fleet import squadmembers_table
|
||||
from eos.db.saveddata.fit import projectedFits_table
|
||||
from sqlalchemy.sql import and_
|
||||
@@ -185,6 +185,12 @@ def getFit(lookfor, eager=None):
|
||||
fit = saveddata_session.query(Fit).options(*eager).filter(Fit.ID == fitID).first()
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
|
||||
if fit and fit.isInvalid:
|
||||
with sd_lock:
|
||||
removeInvalid([fit])
|
||||
return None
|
||||
|
||||
return fit
|
||||
|
||||
@cachedQuery(Fleet, 1, "fleetID")
|
||||
@@ -244,9 +250,10 @@ def getFitsWithShip(shipID, ownerID=None, where=None, eager=None):
|
||||
filter = processWhere(filter, where)
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fits = saveddata_session.query(Fit).options(*eager).filter(filter).all()
|
||||
fits = removeInvalid(saveddata_session.query(Fit).options(*eager).filter(filter).all())
|
||||
else:
|
||||
raise TypeError("ShipID must be integer")
|
||||
|
||||
return fits
|
||||
|
||||
def getBoosterFits(ownerID=None, where=None, eager=None):
|
||||
@@ -264,9 +271,15 @@ def getBoosterFits(ownerID=None, where=None, eager=None):
|
||||
filter = processWhere(filter, where)
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fits = saveddata_session.query(Fit).options(*eager).filter(filter).all()
|
||||
fits = removeInvalid(saveddata_session.query(Fit).options(*eager).filter(filter).all())
|
||||
|
||||
return fits
|
||||
|
||||
def countAllFits():
|
||||
with sd_lock:
|
||||
count = saveddata_session.query(Fit).count()
|
||||
return count
|
||||
|
||||
def countFitsWithShip(shipID, ownerID=None, where=None, eager=None):
|
||||
"""
|
||||
Get all the fits using a certain ship.
|
||||
@@ -290,7 +303,8 @@ def countFitsWithShip(shipID, ownerID=None, where=None, eager=None):
|
||||
def getFitList(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fits = saveddata_session.query(Fit).options(*eager).all()
|
||||
fits = removeInvalid(saveddata_session.query(Fit).options(*eager).all())
|
||||
|
||||
return fits
|
||||
|
||||
def getFleetList(eager=None):
|
||||
@@ -308,6 +322,12 @@ def getPrice(typeID):
|
||||
raise TypeError("Need integer as argument")
|
||||
return price
|
||||
|
||||
def clearPrices():
|
||||
with sd_lock:
|
||||
deleted_rows = saveddata_session.query(Price).delete()
|
||||
commit()
|
||||
return deleted_rows
|
||||
|
||||
def getMiscData(field):
|
||||
if isinstance(field, basestring):
|
||||
with sd_lock:
|
||||
@@ -322,6 +342,12 @@ def getDamagePatternList(eager=None):
|
||||
patterns = saveddata_session.query(DamagePattern).options(*eager).all()
|
||||
return patterns
|
||||
|
||||
def getTargetResistsList(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
patterns = saveddata_session.query(TargetResists).options(*eager).all()
|
||||
return patterns
|
||||
|
||||
@cachedQuery(DamagePattern, 1, "lookfor")
|
||||
def getDamagePattern(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
@@ -340,6 +366,24 @@ def getDamagePattern(lookfor, eager=None):
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return pattern
|
||||
|
||||
@cachedQuery(TargetResists, 1, "lookfor")
|
||||
def getTargetResists(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
if eager is None:
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(TargetResists).get(lookfor)
|
||||
else:
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(TargetResists).options(*eager).filter(TargetResists.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(TargetResists).options(*eager).filter(TargetResists.name == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return pattern
|
||||
|
||||
def searchFits(nameLike, where=None, eager=None):
|
||||
if not isinstance(nameLike, basestring):
|
||||
raise TypeError("Need string as argument")
|
||||
@@ -350,7 +394,8 @@ def searchFits(nameLike, where=None, eager=None):
|
||||
filter = processWhere(Fit.name.like(nameLike, escape="\\"), where)
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fits = saveddata_session.query(Fit).options(*eager).filter(filter).all()
|
||||
fits = removeInvalid(saveddata_session.query(Fit).options(*eager).filter(filter).all())
|
||||
|
||||
return fits
|
||||
|
||||
def getSquadsIDsWithFitID(fitID):
|
||||
@@ -361,7 +406,7 @@ def getSquadsIDsWithFitID(fitID):
|
||||
return squads
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
|
||||
|
||||
def getProjectedFits(fitID):
|
||||
if isinstance(fitID, int):
|
||||
with sd_lock:
|
||||
@@ -369,7 +414,17 @@ def getProjectedFits(fitID):
|
||||
fits = saveddata_session.query(Fit).filter(filter).all()
|
||||
return fits
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
raise TypeError("Need integer as argument")
|
||||
|
||||
def removeInvalid(fits):
|
||||
invalids = [f for f in fits if f.isInvalid]
|
||||
|
||||
if invalids:
|
||||
map(fits.remove, invalids)
|
||||
map(saveddata_session.delete, invalids)
|
||||
saveddata_session.commit()
|
||||
|
||||
return fits
|
||||
|
||||
def add(stuff):
|
||||
with sd_lock:
|
||||
|
||||
35
eos/db/saveddata/targetResists.py
Normal file
35
eos/db/saveddata/targetResists.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#===============================================================================
|
||||
# Copyright (C) 2014 Ryan Holmes
|
||||
#
|
||||
# This file is part of eos.
|
||||
#
|
||||
# eos is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# eos 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 Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
#===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, Float, ForeignKey, String
|
||||
from sqlalchemy.orm import mapper
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import TargetResists
|
||||
|
||||
targetResists_table = Table("targetResists", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("name", String),
|
||||
Column("emAmount", Float),
|
||||
Column("thermalAmount", Float),
|
||||
Column("kineticAmount", Float),
|
||||
Column("explosiveAmount", Float),
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True))
|
||||
|
||||
mapper(TargetResists, targetResists_table)
|
||||
@@ -17,8 +17,12 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
#===============================================================================
|
||||
|
||||
#from sqlalchemy.orm.attributes import flag_modified
|
||||
import eos.db
|
||||
import eos.types
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class HandledList(list):
|
||||
def filteredItemPreAssign(self, filter, *args, **kwargs):
|
||||
@@ -101,6 +105,14 @@ class HandledList(list):
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def remove(self, thing):
|
||||
# We must flag it as modified, otherwise it not be removed from the database
|
||||
# @todo: flag_modified isn't in os x skel. need to rebuild to include
|
||||
#flag_modified(thing, "itemID")
|
||||
if thing.isInvalid: # see GH issue #324
|
||||
thing.itemID = 0
|
||||
list.remove(self, thing)
|
||||
|
||||
class HandledModuleList(HandledList):
|
||||
def append(self, mod):
|
||||
emptyPosition = float("Inf")
|
||||
@@ -115,10 +127,14 @@ class HandledModuleList(HandledList):
|
||||
del self[emptyPosition]
|
||||
mod.position = emptyPosition
|
||||
HandledList.insert(self, emptyPosition, mod)
|
||||
if mod.isInvalid:
|
||||
self.remove(mod)
|
||||
return
|
||||
|
||||
mod.position = len(self)
|
||||
HandledList.append(self, mod)
|
||||
if mod.isInvalid:
|
||||
self.remove(mod)
|
||||
|
||||
def insert(self, index, mod):
|
||||
mod.position = index
|
||||
@@ -143,139 +159,82 @@ class HandledModuleList(HandledList):
|
||||
dummy.position = index
|
||||
self[index] = dummy
|
||||
|
||||
def toModule(self, index, mod):
|
||||
mod.position = index
|
||||
self[index] = mod
|
||||
|
||||
def freeSlot(self, slot):
|
||||
for i in range(len(self) -1, -1, -1):
|
||||
mod = self[i]
|
||||
if mod.getModifiedItemAttr("subSystemSlot") == slot:
|
||||
del self[i]
|
||||
|
||||
class HandledDroneList(HandledList):
|
||||
class HandledDroneCargoList(HandledList):
|
||||
def find(self, item):
|
||||
for d in self:
|
||||
if d.item == item:
|
||||
yield d
|
||||
for o in self:
|
||||
if o.item == item:
|
||||
yield o
|
||||
|
||||
def findFirst(self, item):
|
||||
for d in self.find(item):
|
||||
return d
|
||||
for o in self.find(item):
|
||||
return o
|
||||
|
||||
def append(self, drone):
|
||||
list.append(self, drone)
|
||||
def append(self, thing):
|
||||
HandledList.append(self, thing)
|
||||
|
||||
def remove(self, drone):
|
||||
HandledList.remove(self, drone)
|
||||
|
||||
def appendItem(self, item, amount = 1):
|
||||
if amount < 1: ValueError("Amount of drones to add should be >= 1")
|
||||
d = self.findFirst(item)
|
||||
|
||||
if d is None:
|
||||
d = eos.types.Drone(item)
|
||||
self.append(d)
|
||||
|
||||
d.amount += amount
|
||||
return d
|
||||
|
||||
def removeItem(self, item, amount):
|
||||
if amount < 1: ValueError("Amount of drones to remove should be >= 1")
|
||||
d = self.findFirst(item)
|
||||
if d is None: return
|
||||
d.amount -= amount
|
||||
if d.amount <= 0:
|
||||
self.remove(d)
|
||||
return None
|
||||
|
||||
return d
|
||||
|
||||
class HandledCargoList(HandledList):
|
||||
# shameless copy of HandledDroneList
|
||||
# I have no idea what this does, but I needed it
|
||||
# @todo: investigate this
|
||||
def find(self, item):
|
||||
for d in self:
|
||||
if d.item == item:
|
||||
yield d
|
||||
|
||||
def findFirst(self, item):
|
||||
for d in self.find(item):
|
||||
return d
|
||||
|
||||
def append(self, cargo):
|
||||
list.append(self, cargo)
|
||||
|
||||
def remove(self, cargo):
|
||||
HandledList.remove(self, cargo)
|
||||
|
||||
def appendItem(self, item, qty = 1):
|
||||
if qty < 1: ValueError("Amount of cargo to add should be >= 1")
|
||||
d = self.findFirst(item)
|
||||
|
||||
if d is None:
|
||||
d = eos.types.Cargo(item)
|
||||
self.append(d)
|
||||
|
||||
d.qty += qty
|
||||
return d
|
||||
|
||||
def removeItem(self, item, qty):
|
||||
if qty < 1: ValueError("Amount of cargo to remove should be >= 1")
|
||||
d = self.findFirst(item)
|
||||
if d is None: return
|
||||
d.qty -= qty
|
||||
if d.qty <= 0:
|
||||
self.remove(d)
|
||||
return None
|
||||
|
||||
return d
|
||||
if thing.isInvalid:
|
||||
self.remove(thing)
|
||||
|
||||
class HandledImplantBoosterList(HandledList):
|
||||
def __init__(self):
|
||||
self.__slotCache = {}
|
||||
def append(self, thing):
|
||||
if thing.isInvalid:
|
||||
HandledList.append(self, thing)
|
||||
self.remove(thing)
|
||||
return
|
||||
|
||||
def append(self, implant):
|
||||
if self.__slotCache.has_key(implant.slot):
|
||||
raise ValueError("Implant/Booster slot already in use, remove the old one first or set replace = True")
|
||||
self.__slotCache[implant.slot] = implant
|
||||
HandledList.append(self, implant)
|
||||
# if needed, remove booster that was occupying slot
|
||||
oldObj = next((m for m in self if m.slot == thing.slot), None)
|
||||
if oldObj:
|
||||
logging.info("Slot %d occupied with %s, replacing with %s", thing.slot, oldObj.item.name, thing.item.name)
|
||||
oldObj.itemID = 0 # hack to remove from DB. See GH issue #324
|
||||
self.remove(oldObj)
|
||||
|
||||
def remove(self, implant):
|
||||
HandledList.remove(self, implant)
|
||||
del self.__slotCache[implant.slot]
|
||||
# While we deleted this implant, in edge case seems like not all references
|
||||
# to it are removed and object still lives in session; forcibly remove it,
|
||||
# or otherwise when adding the same booster twice booster's table (typeID, fitID)
|
||||
# constraint will report database integrity error
|
||||
# TODO: make a proper fix, probably by adjusting fit-boosters sqlalchemy relationships
|
||||
eos.db.remove(implant)
|
||||
|
||||
def freeSlot(self, slot):
|
||||
if hasattr(slot, "slot"):
|
||||
slot = slot.slot
|
||||
|
||||
try:
|
||||
implant = self.__slotCache[slot]
|
||||
except KeyError:
|
||||
return False
|
||||
try:
|
||||
self.remove(implant)
|
||||
except ValueError:
|
||||
return False
|
||||
return True
|
||||
HandledList.append(self, thing)
|
||||
|
||||
class HandledProjectedModList(HandledList):
|
||||
def append(self, proj):
|
||||
if proj.isInvalid:
|
||||
# we must include it before we remove it. doing it this way ensures
|
||||
# rows and relationships in database are removed as well
|
||||
HandledList.append(self, proj)
|
||||
self.remove(proj)
|
||||
return
|
||||
|
||||
proj.projected = True
|
||||
isSystemEffect = proj.item.group.name == "Effect Beacon"
|
||||
|
||||
if isSystemEffect:
|
||||
# remove other system effects - only 1 per fit plz
|
||||
oldEffect = next((m for m in self if m.item.group.name == "Effect Beacon"), None)
|
||||
|
||||
if oldEffect:
|
||||
logging.info("System effect occupied with %s, replacing with %s", oldEffect.item.name, proj.item.name)
|
||||
self.remove(oldEffect)
|
||||
|
||||
HandledList.append(self, proj)
|
||||
|
||||
# Remove non-projectable modules
|
||||
if not proj.item.isType("projected") and not isSystemEffect:
|
||||
self.remove(proj)
|
||||
|
||||
class HandledProjectedDroneList(HandledDroneCargoList):
|
||||
def append(self, proj):
|
||||
proj.projected = True
|
||||
HandledList.append(self, proj)
|
||||
|
||||
class HandledProjectedDroneList(HandledDroneList):
|
||||
def append(self, proj):
|
||||
proj.projected = True
|
||||
list.append(self, proj)
|
||||
|
||||
class HandledProjectedFitList(HandledList):
|
||||
def append(self, proj):
|
||||
proj.projected = True
|
||||
list.append(self, proj)
|
||||
# Remove invalid or non-projectable drones
|
||||
if proj.isInvalid or not proj.item.isType("projected"):
|
||||
self.remove(proj)
|
||||
|
||||
class HandledItem(object):
|
||||
def preAssignItemAttr(self, *args, **kwargs):
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# accerationControlCapNeedBonusPostPercentCapacitorNeedLocationShipGroupAfterburner
|
||||
#
|
||||
# Used by:
|
||||
# Modules named like: Dynamic Fuel Valve (8 of 8)
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# accerationControlSkillAb&MwdSpeedBoost
|
||||
#
|
||||
# Used by:
|
||||
# Implant: Zor's Custom Navigation Hyper-Link
|
||||
# Skill: Acceleration Control
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# accerationControlSpeedFBonusPostPercentSpeedFactorLocationShipGroupAfterburner
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Eifyr and Co. 'Rogue' Acceleration Control AC (6 of 6)
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# accessDifficultyBonusModifierRequiringArchaelogy
|
||||
#
|
||||
# Used by:
|
||||
# Modules named like: Emission Scope Sharpener (8 of 8)
|
||||
# Implant: Poteque 'Prospector' Archaeology AC-905
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# accessDifficultyBonusModifierRequiringHacking
|
||||
#
|
||||
# Used by:
|
||||
# Modules named like: Memetic Algorithm Bank (8 of 8)
|
||||
# Implant: Poteque 'Prospector' Environmental Analysis EY-1005
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# adaptiveArmorHardener
|
||||
#
|
||||
# Used by:
|
||||
# Module: Reactive Armor Hardener
|
||||
type = "active"
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
# addToSignatureRadius2
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Shield Extender (37 of 37)
|
||||
# Modules from group: Missile Launcher Bomb (2 of 2)
|
||||
# Modules from group: Shield Extender (25 of 25)
|
||||
type = "passive"
|
||||
def handler(fit, module, context):
|
||||
fit.ship.increaseItemAttr("signatureRadius", module.getModifiedItemAttr("signatureRadiusAdd"))
|
||||
@@ -1,3 +1,5 @@
|
||||
# advancedDroneInterfacingMaxGroupDCUSkillLevel
|
||||
#
|
||||
# Used by:
|
||||
# Skill: Advanced Drone Interfacing
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# afterburnerDurationBonusPostPercentDurationLocationShipModulesRequiringAfterburner
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Eifyr and Co. 'Rogue' Afterburner AB (6 of 6)
|
||||
# Implant: Zor's Custom Navigation Link
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# agilityMultiplierEffect
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Inertia Stabilizer (12 of 12)
|
||||
# Modules from group: Nanofiber Internal Structure (14 of 14)
|
||||
# Modules from group: Reinforced Bulkhead (12 of 12)
|
||||
# Modules from group: Inertial Stabilizer (7 of 7)
|
||||
# Modules from group: Nanofiber Internal Structure (7 of 7)
|
||||
# Modules from group: Reinforced Bulkhead (8 of 8)
|
||||
type = "passive"
|
||||
def handler(fit, module, context):
|
||||
fit.ship.boostItemAttr("agility",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# agilityMultiplierEffectPassive
|
||||
#
|
||||
# Used by:
|
||||
# Modules named like: Polycarbon Engine Housing (8 of 8)
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# ammoFallofMultiplier
|
||||
#
|
||||
# Used by:
|
||||
# Charges from group: Advanced Artillery Ammo (6 of 6)
|
||||
# Charges from group: Advanced Autocannon Ammo (6 of 6)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# ammoInfluenceCapNeed
|
||||
#
|
||||
# Used by:
|
||||
# Items from category: Charge (458 of 828)
|
||||
# Items from category: Charge (458 of 831)
|
||||
type = "passive"
|
||||
def handler(fit, module, context):
|
||||
# Dirty hack to work around cap charges setting cap booster
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# ammoInfluenceRange
|
||||
#
|
||||
# Used by:
|
||||
# Items from category: Charge (559 of 828)
|
||||
# Items from category: Charge (559 of 831)
|
||||
type = "passive"
|
||||
def handler(fit, module, context):
|
||||
module.multiplyItemAttr("maxRange", module.getModifiedChargeAttr("weaponRangeMultiplier"))
|
||||
@@ -1,7 +1,9 @@
|
||||
# ammoSpeedMultiplier
|
||||
#
|
||||
# Used by:
|
||||
# Charges from group: Festival Charges (8 of 8)
|
||||
# Charges from group: Interdiction Probe (2 of 2)
|
||||
# Charges from group: Survey Probe (3 of 3)
|
||||
# Charge: Warp Disrupt Probe
|
||||
type = "passive"
|
||||
def handler(fit, module, context):
|
||||
module.multiplyItemAttr("speed", module.getModifiedChargeAttr("speedMultiplier") or 1)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# ammoTrackingMultiplier
|
||||
#
|
||||
# Used by:
|
||||
# Charges from group: Advanced Artillery Ammo (6 of 6)
|
||||
# Charges from group: Advanced Autocannon Ammo (6 of 6)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# angelsetbonus
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: grade Halo (18 of 18)
|
||||
runTime = "early"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# antiWarpScramblingPassive
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Warp Core Stabilizer (8 of 8)
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# archaeologySkillVirusBonus
|
||||
#
|
||||
# Used by:
|
||||
# Modules named like: Emission Scope Sharpener (8 of 8)
|
||||
# Implant: Poteque 'Prospector' Archaeology AC-905
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# armorAllRepairSystemsAmountBonusPassive
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Exile Booster (4 of 4)
|
||||
type = "passive"
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# armorDamageAmountBonusCapitalArmorRepairers
|
||||
#
|
||||
# Used by:
|
||||
# Modules named like: Auxiliary Nano Pump (8 of 8)
|
||||
type = "passive"
|
||||
def handler(fit, implant, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Repair Systems"),
|
||||
"armorDamageAmount", implant.getModifiedItemAttr("repairBonus"),
|
||||
stackingPenalties = True)
|
||||
stackingPenalties=True)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# armoredSquadronCommand
|
||||
#
|
||||
# Used by:
|
||||
# Skill: Armored Warfare Specialist
|
||||
runTime = "early"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# armoredWarfareMindlink
|
||||
#
|
||||
# Used by:
|
||||
# Implant: Armored Warfare Mindlink
|
||||
# Implant: Federation Navy Warfare Mindlink
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# armorHPBonusAdd
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Armor Reinforcer (57 of 57)
|
||||
# Modules from group: Armor Reinforcer (41 of 41)
|
||||
type = "passive"
|
||||
def handler(fit, module, context):
|
||||
fit.ship.increaseItemAttr("armorHP", module.getModifiedItemAttr("armorHPBonusAdd"))
|
||||
@@ -1,3 +1,5 @@
|
||||
# armorHPBonusAddPassive
|
||||
#
|
||||
# Used by:
|
||||
# Subsystems from group: Defensive Systems (16 of 16)
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# armorHPMultiply
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Armor Coating (202 of 202)
|
||||
# Modules from group: Armor Plating Energized (187 of 187)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# armorReinforcerMassAdd
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Armor Reinforcer (57 of 57)
|
||||
# Modules from group: Armor Reinforcer (41 of 41)
|
||||
type = "passive"
|
||||
def handler(fit, module, context):
|
||||
fit.ship.increaseItemAttr("mass", module.getModifiedItemAttr("massAddition"))
|
||||
@@ -1,3 +1,5 @@
|
||||
# armorRepair
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Armor Repair Unit (100 of 100)
|
||||
runTime = "late"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# armorRepairProjectorMaxRangeBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Augoror
|
||||
# Ship: Exequror
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# armorTankingGang
|
||||
#
|
||||
# Used by:
|
||||
# Skill: Armored Warfare
|
||||
type = "gang"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# armorTankingGang2
|
||||
#
|
||||
# Used by:
|
||||
# Implant: Armored Warfare Mindlink
|
||||
# Implant: Federation Navy Warfare Mindlink
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# armorUpgradesMassPenaltyReductionBonus
|
||||
#
|
||||
# Used by:
|
||||
# Skill: Armor Layering
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# astrogeologyMiningAmountBonusPostPercentMiningAmountLocationShipModulesRequiringMining
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Inherent Implants 'Highwall' Mining MX (3 of 3)
|
||||
# Implant: Michi's Excavation Augmentor
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# baseMaxScanDeviationModifierModuleOnline2None
|
||||
#
|
||||
# Used by:
|
||||
# Variations of module: Scan Pinpointing Array I (2 of 2)
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# baseMaxScanDeviationModifierRequiringAstrometrics
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Poteque 'Prospector' Astrometric Pinpointing AP (3 of 3)
|
||||
# Skill: Astrometric Pinpointing
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# baseSensorStrengthModifierModule
|
||||
#
|
||||
# Used by:
|
||||
# Variations of module: Scan Rangefinding Array I (2 of 2)
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# baseSensorStrengthModifierRequiringAstrometrics
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Scan Probe Launcher (4 of 7)
|
||||
# Implants named like: Poteque 'Prospector' Astrometric Rangefinding AR (3 of 3)
|
||||
|
||||
9
eos/effects/battlecruiserdronespeed.py
Normal file
9
eos/effects/battlecruiserdronespeed.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# battlecruiserDroneSpeed
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Myrmidon
|
||||
# Ship: Prophecy
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
fit.drones.filteredItemBoost(lambda drone: drone.item.requiresSkill("Drones"),
|
||||
"maxVelocity", ship.getModifiedItemAttr("roleBonusCBC"))
|
||||
10
eos/effects/battlecruisermetrange.py
Normal file
10
eos/effects/battlecruisermetrange.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# battlecruiserMETRange
|
||||
#
|
||||
# Used by:
|
||||
# Ships named like: Harbinger (2 of 2)
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Medium Energy Turret"),
|
||||
"maxRange", ship.getModifiedItemAttr("roleBonusCBC"))
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Medium Energy Turret"),
|
||||
"falloff", ship.getModifiedItemAttr("roleBonusCBC"))
|
||||
11
eos/effects/battlecruisermhtrange.py
Normal file
11
eos/effects/battlecruisermhtrange.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# battlecruiserMHTRange
|
||||
#
|
||||
# Used by:
|
||||
# Ships named like: Brutix (2 of 2)
|
||||
# Ship: Ferox
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Medium Hybrid Turret"),
|
||||
"maxRange", ship.getModifiedItemAttr("roleBonusCBC"))
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Medium Hybrid Turret"),
|
||||
"falloff", ship.getModifiedItemAttr("roleBonusCBC"))
|
||||
9
eos/effects/battlecruisermissilerange.py
Normal file
9
eos/effects/battlecruisermissilerange.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# battlecruiserMissileRange
|
||||
#
|
||||
# Used by:
|
||||
# Ships named like: Drake (2 of 2)
|
||||
# Ship: Cyclone
|
||||
type = "passive"
|
||||
def handler(fit, skill, context):
|
||||
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
|
||||
"maxVelocity", skill.getModifiedItemAttr("roleBonusCBC"))
|
||||
10
eos/effects/battlecruisermptrange.py
Normal file
10
eos/effects/battlecruisermptrange.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# battlecruiserMPTRange
|
||||
#
|
||||
# Used by:
|
||||
# Ships named like: Hurricane (2 of 2)
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Medium Projectile Turret"),
|
||||
"maxRange", ship.getModifiedItemAttr("roleBonusCBC"))
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Medium Projectile Turret"),
|
||||
"falloff", ship.getModifiedItemAttr("roleBonusCBC"))
|
||||
@@ -1,3 +1,5 @@
|
||||
# bcLargeEnergyTurretCapacitorNeedBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Oracle
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# bcLargeEnergyTurretCPUNeedBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Oracle
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# bcLargeEnergyTurretPowerNeedBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Oracle
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# bcLargeHybridTurretCapacitorNeedBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Naga
|
||||
# Ship: Talos
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# bcLargeHybridTurretCPUNeedBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Naga
|
||||
# Ship: Talos
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# bcLargeHybridTurretPowerNeedBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Naga
|
||||
# Ship: Talos
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# bcLargeProjectileTurretCPUNeedBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Tornado
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# bcLargeProjectileTurretPowerNeedBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Tornado
|
||||
type = "passive"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# biologyTimeBonusFixed
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Biology BY (2 of 2)
|
||||
# Skill: Biology
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# blockadeRunnerCloakCpuPercentBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Blockade Runner (4 of 4)
|
||||
type = "passive"
|
||||
runTime = "early"
|
||||
def handler(fit, ship, context):
|
||||
level = fit.character.getSkill("Transport Ships").level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Cloaking Device",
|
||||
"cpu", ship.getModifiedItemAttr("eliteIndustrialCovertCloakBonus") * level)
|
||||
"cpu", ship.getModifiedItemAttr("eliteIndustrialCovertCloakBonus"), skill="Transport Ships")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# boosterArmorHpPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants from group: Booster (12 of 37)
|
||||
# Implants from group: Booster (12 of 39)
|
||||
type = "boosterSideEffect"
|
||||
def handler(fit, booster, context):
|
||||
fit.ship.boostItemAttr("armorHP", booster.getModifiedItemAttr("boosterArmorHPPenalty"))
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# boosterArmorRepairAmountPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants from group: Booster (9 of 37)
|
||||
# Implants from group: Booster (9 of 39)
|
||||
type = "boosterSideEffect"
|
||||
def handler(fit, booster, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Armor Repair Unit",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# boosterCapacitorCapacityPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Blue Pill Booster (3 of 5)
|
||||
# Implants named like: Exile Booster (3 of 4)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# boosterMaxVelocityPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants from group: Booster (12 of 37)
|
||||
# Implants from group: Booster (12 of 39)
|
||||
type = "boosterSideEffect"
|
||||
def handler(fit, booster, context):
|
||||
fit.ship.boostItemAttr("maxVelocity", booster.getModifiedItemAttr("boosterMaxVelocityPenalty"))
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# boosterMissileExplosionCloudPenaltyFixed
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Exile Booster (3 of 4)
|
||||
# Implants named like: Mindflood Booster (3 of 4)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# boosterMissileExplosionVelocityPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Blue Pill Booster (3 of 5)
|
||||
type = "boosterSideEffect"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# boosterMissileVelocityPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Crash Booster (3 of 4)
|
||||
# Implants named like: X Instinct Booster (3 of 4)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# boosterModifyBoosterArmorPenalties
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Nanite Control NC (2 of 2)
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Neurotoxin Control NC (2 of 2)
|
||||
# Implants named like: grade Edge (10 of 12)
|
||||
# Skill: Neurotoxin Control
|
||||
type = "passive"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# boosterModifyBoosterMaxVelocityAndCapacitorPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Nanite Control NC (2 of 2)
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Neurotoxin Control NC (2 of 2)
|
||||
# Implants named like: grade Edge (10 of 12)
|
||||
# Skill: Neurotoxin Control
|
||||
type = "passive"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# boosterModifyBoosterMissilePenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Nanite Control NC (2 of 2)
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Neurotoxin Control NC (2 of 2)
|
||||
# Implants named like: grade Edge (10 of 12)
|
||||
# Skill: Neurotoxin Control
|
||||
type = "passive"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# boosterModifyBoosterShieldPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Nanite Control NC (2 of 2)
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Neurotoxin Control NC (2 of 2)
|
||||
# Implants named like: grade Edge (10 of 12)
|
||||
# Skill: Neurotoxin Control
|
||||
type = "passive"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# boosterModifyBoosterTurretPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Nanite Control NC (2 of 2)
|
||||
# Implants named like: Eifyr and Co. 'Alchemist' Neurotoxin Control NC (2 of 2)
|
||||
# Implants named like: grade Edge (10 of 12)
|
||||
# Skill: Neurotoxin Control
|
||||
type = "passive"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# boosterShieldCapacityPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants from group: Booster (12 of 37)
|
||||
# Implants from group: Booster (12 of 39)
|
||||
type = "boosterSideEffect"
|
||||
def handler(fit, booster, context):
|
||||
fit.ship.boostItemAttr("shieldCapacity", booster.getModifiedItemAttr("boosterShieldCapacityPenalty"))
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# boosterTurretFalloffPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Drop Booster (3 of 4)
|
||||
# Implants named like: X Instinct Booster (3 of 4)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# boosterTurretOptimalRangePenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants from group: Booster (9 of 37)
|
||||
# Implants from group: Booster (9 of 39)
|
||||
type = "boosterSideEffect"
|
||||
def handler(fit, booster, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# boosterTurretTrackingPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Exile Booster (3 of 4)
|
||||
# Implants named like: Frentix Booster (3 of 4)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# caldarisetbonus3
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: High grade Talon (6 of 6)
|
||||
runTime = "early"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# caldarisetLGbonus
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Low grade Talon (6 of 6)
|
||||
runTime = "early"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# caldariShipECMBurstOptimalRangeCB3
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Scorpion
|
||||
# Ship: Scorpion Ishukone Watch
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
level = fit.character.getSkill("Caldari Battleship").level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "ECM Burst",
|
||||
"ecmBurstRange", ship.getModifiedItemAttr("shipBonusCB3") * level)
|
||||
"ecmBurstRange", ship.getModifiedItemAttr("shipBonusCB3"), skill="Caldari Battleship")
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# caldariShipEwCapacitorNeedCC
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Chameleon
|
||||
# Ship: Falcon
|
||||
# Ship: Rook
|
||||
type = "passive"
|
||||
def handler(fit, ship, context):
|
||||
level = fit.character.getSkill("Caldari Cruiser").level
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "ECM",
|
||||
"capacitorNeed", ship.getModifiedItemAttr("shipBonusCC") * level)
|
||||
"capacitorNeed", ship.getModifiedItemAttr("shipBonusCC"), skill="Caldari Cruiser")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user