Compare commits
476 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7956ca0409 | ||
|
|
5b27d0559f | ||
|
|
85157fdf85 | ||
|
|
caf8e7f2d6 | ||
|
|
124bb027ab | ||
|
|
d5ca14ca52 | ||
|
|
99982aa547 | ||
|
|
3f4493c0ea | ||
|
|
cdb604b29f | ||
|
|
d3b8cebc8a | ||
|
|
7d245660bc | ||
|
|
b1e40427a3 | ||
|
|
73925df24b | ||
|
|
04fbd3b548 | ||
|
|
d9dd94d6c3 | ||
|
|
963353a1dc | ||
|
|
3411dcfd91 | ||
|
|
ae6434affb | ||
|
|
f773e0a935 | ||
|
|
7ab3ad9e08 | ||
|
|
3f3a82ca6c | ||
|
|
e902cc5780 | ||
|
|
fcb6952119 | ||
|
|
3eecd57979 | ||
|
|
6e73b9fefd | ||
|
|
f0b0285f77 | ||
|
|
e706a015b3 | ||
|
|
a804f9a1ad | ||
|
|
9e1b7dbb87 | ||
|
|
551ffe9ed3 | ||
|
|
cbe1ce5bcd | ||
|
|
917afd5067 | ||
|
|
c3fb9231a4 | ||
|
|
2ed2f8e262 | ||
|
|
390d90ac47 | ||
|
|
4c877e7a5a | ||
|
|
972fe433f7 | ||
|
|
ecaf6f96a9 | ||
|
|
8541e2a869 | ||
|
|
48a2963472 | ||
|
|
f245a02372 | ||
|
|
1c16343b46 | ||
|
|
d0f66f2d16 | ||
|
|
df0c6ed269 | ||
|
|
9a4e26a5be | ||
|
|
2b87f91279 | ||
|
|
9b48b61b9b | ||
|
|
57e67b3699 | ||
|
|
15e60c3d24 | ||
|
|
ebf07db6c6 | ||
|
|
1559767201 | ||
|
|
6e5e52df37 | ||
|
|
e9289c102b | ||
|
|
81d61d7e29 | ||
|
|
9ab4ec2d4f | ||
|
|
565332dfcd | ||
|
|
f94fbd740a | ||
|
|
a2719ec2f7 | ||
|
|
1da12cb18e | ||
|
|
e0cddcd061 | ||
|
|
78f632a4f6 | ||
|
|
52754535a0 | ||
|
|
a9db667c9c | ||
|
|
f442632fbc | ||
|
|
362086cc83 | ||
|
|
73d59569ff | ||
|
|
cb4fadf84c | ||
|
|
e85d144928 | ||
|
|
07099f4057 | ||
|
|
96c13c344a | ||
|
|
8f42822d9e | ||
|
|
c5ba79cfbb | ||
|
|
f69f76856a | ||
|
|
3a23d820cc | ||
|
|
c917d22db5 | ||
|
|
c3f8b102fa | ||
|
|
5e566db47d | ||
|
|
5b2c5907ed | ||
|
|
dd78a41171 | ||
|
|
201fb4e241 | ||
|
|
8abd25fe40 | ||
|
|
d59c897921 | ||
|
|
cb89d13d9f | ||
|
|
a1aa78adc0 | ||
|
|
4bbbd33917 | ||
|
|
42ccc53166 | ||
|
|
35ad21da38 | ||
|
|
72efef818f | ||
|
|
5571bae8b2 | ||
|
|
8b2cfe44f2 | ||
|
|
5ea7215ec0 | ||
|
|
e2ac90a040 | ||
|
|
6ab84240a2 | ||
|
|
12a526fa9e | ||
|
|
82e3db1ffb | ||
|
|
e779bb84e2 | ||
|
|
bd0fcbef3a | ||
|
|
0456cb2f96 | ||
|
|
cafd92f169 | ||
|
|
05f08970c9 | ||
|
|
f66485c48a | ||
|
|
2153c05183 | ||
|
|
f66c36e42b | ||
|
|
8771de9c1f | ||
|
|
fa3cf90421 | ||
|
|
636ee1de23 | ||
|
|
b36bf8fb21 | ||
|
|
55ad52919e | ||
|
|
0648feaa7b | ||
|
|
e16ae88ed9 | ||
|
|
c5c673e360 | ||
|
|
5cd21da7b1 | ||
|
|
da0f89ef91 | ||
|
|
efc3f1ba7d | ||
|
|
8d7f0b56f1 | ||
|
|
89b6e8f8c3 | ||
|
|
c6e715aa5c | ||
|
|
0e93136157 | ||
|
|
89c84aac96 | ||
|
|
649ba9f3e4 | ||
|
|
2d38fd4773 | ||
|
|
23f0f48c80 | ||
|
|
6254fa3e23 | ||
|
|
8686c02b1f | ||
|
|
33618f12f7 | ||
|
|
5f0ce58c29 | ||
|
|
c329f5eeb8 | ||
|
|
320a0230f4 | ||
|
|
d94d49f0a9 | ||
|
|
9bfc5b35b6 | ||
|
|
0f30ea554d | ||
|
|
50dd74dbe8 | ||
|
|
9c355d8f96 | ||
|
|
f81179db4b | ||
|
|
2d7eed4aac | ||
|
|
96828a5611 | ||
|
|
8a0f8ae609 | ||
|
|
ac8f805fcb | ||
|
|
9f3c2ca7a8 | ||
|
|
2e8d7d3610 | ||
|
|
3179016aed | ||
|
|
514db91d7a | ||
|
|
269d3f326d | ||
|
|
b04fcb0d15 | ||
|
|
a29b3da8a6 | ||
|
|
18a5e35e80 | ||
|
|
3072dbb3ff | ||
|
|
b103f0df7e | ||
|
|
9f7e4e0dc0 | ||
|
|
29d175c7b3 | ||
|
|
0c971a127c | ||
|
|
40ce7b7c0b | ||
|
|
a8060a5e15 | ||
|
|
cc063d1934 | ||
|
|
531721ef5e | ||
|
|
2936b88c3d | ||
|
|
2365112292 | ||
|
|
1daef5354d | ||
|
|
6f19d45c6d | ||
|
|
ac7908c62c | ||
|
|
c000b19986 | ||
|
|
1da127c898 | ||
|
|
fcdf55632f | ||
|
|
dd3bc66896 | ||
|
|
da67cdba9b | ||
|
|
8850da6cdb | ||
|
|
7d46d7e22d | ||
|
|
b3157303cd | ||
|
|
65e17119af | ||
|
|
f7b509f9a9 | ||
|
|
dea775058d | ||
|
|
3c405f51d8 | ||
|
|
337f0a9c8a | ||
|
|
53936a3e66 | ||
|
|
30a6e29b39 | ||
|
|
f3dc3bc654 | ||
|
|
0a935cf149 | ||
|
|
5697da7ec2 | ||
|
|
a7086b78cb | ||
|
|
e032c9c5b1 | ||
|
|
46b0aded03 | ||
|
|
d23398ce29 | ||
|
|
5e0a5da6d5 | ||
|
|
6e112b9ed5 | ||
|
|
b30b3fcbf1 | ||
|
|
455fea75c0 | ||
|
|
bd181559ed | ||
|
|
967128cb69 | ||
|
|
5fa43138b3 | ||
|
|
f0baba10df | ||
|
|
7058018aed | ||
|
|
d45d7204d2 | ||
|
|
b596447095 | ||
|
|
25df05a15d | ||
|
|
4a33365195 | ||
|
|
5d5646df79 | ||
|
|
405a965046 | ||
|
|
4138088d4a | ||
|
|
de44e6f932 | ||
|
|
d4df989427 | ||
|
|
6c8b143936 | ||
|
|
0f94557699 | ||
|
|
a52b9e58e9 | ||
|
|
0d8904d59f | ||
|
|
d956cb7861 | ||
|
|
e848cec815 | ||
|
|
ce8f1d385d | ||
|
|
90e338b969 | ||
|
|
1978f5cb92 | ||
|
|
979bc494f0 | ||
|
|
cc9b6ea04b | ||
|
|
8cbb327659 | ||
|
|
2f6e306f8e | ||
|
|
065747f425 | ||
|
|
c4f41fb5fa | ||
|
|
e4f3ed05cc | ||
|
|
0e84d6c557 | ||
|
|
c384848870 | ||
|
|
1fc9b2941d | ||
|
|
e9be07f281 | ||
|
|
df7dc30e7e | ||
|
|
d0235f6d93 | ||
|
|
de646cf252 | ||
|
|
21838f2d9a | ||
|
|
266398b1de | ||
|
|
0cc646bab9 | ||
|
|
cebca64e5e | ||
|
|
bd0de82a8e | ||
|
|
0f5ae8d9b6 | ||
|
|
5ae7805bb1 | ||
|
|
6a382c4445 | ||
|
|
3b0c8b6117 | ||
|
|
0e1e4cad6d | ||
|
|
e0b92198b0 | ||
|
|
ce3b94696a | ||
|
|
cacf286176 | ||
|
|
a02bbe3964 | ||
|
|
866d410695 | ||
|
|
ea6f31c021 | ||
|
|
d522fff511 | ||
|
|
ca27cd3250 | ||
|
|
20a1618e41 | ||
|
|
2830729cb4 | ||
|
|
c0e15f61c6 | ||
|
|
4355f35eef | ||
|
|
029e61edaf | ||
|
|
b18f82505b | ||
|
|
f8a65de47f | ||
|
|
e5a0ef1877 | ||
|
|
8647fe460c | ||
|
|
a4950e9015 | ||
|
|
82d50cfa0d | ||
|
|
efea46006a | ||
|
|
d9800dcf19 | ||
|
|
266b3ce985 | ||
|
|
3b61a07c55 | ||
|
|
5dc092ace5 | ||
|
|
7b32fe08ac | ||
|
|
fd6e318ae3 | ||
|
|
504c395ea2 | ||
|
|
9ed210d5b5 | ||
|
|
c7f0f6215a | ||
|
|
34c692c972 | ||
|
|
56f34873a6 | ||
|
|
b4dfcf53fb | ||
|
|
3c26676b66 | ||
|
|
3fb7411b9d | ||
|
|
cac8e528a3 | ||
|
|
2afc8b1abe | ||
|
|
06e82a04b4 | ||
|
|
782df18501 | ||
|
|
a87d659e5d | ||
|
|
cd35c9319c | ||
|
|
dfe3d5c82a | ||
|
|
ccd8cdd099 | ||
|
|
72062e6213 | ||
|
|
10836acab2 | ||
|
|
08ab8fbc5b | ||
|
|
da5aaf2f78 | ||
|
|
4484b68a3a | ||
|
|
81fce93186 | ||
|
|
d58987e427 | ||
|
|
05a5ebff00 | ||
|
|
2f28afc7ae | ||
|
|
0134c3b9a1 | ||
|
|
9f433fd072 | ||
|
|
7729bd9210 | ||
|
|
ce5803dd9c | ||
|
|
821ede8579 | ||
|
|
592f9a2298 | ||
|
|
c30c07b91c | ||
|
|
73d9dd60e6 | ||
|
|
dbdbe155f3 | ||
|
|
7d41260863 | ||
|
|
d53ff0f502 | ||
|
|
f37f4573bf | ||
|
|
ee392e07c4 | ||
|
|
59b09a255a | ||
|
|
3e73c2eb34 | ||
|
|
3625b4395a | ||
|
|
1444a24e70 | ||
|
|
73dfa25ef0 | ||
|
|
a01284ff1c | ||
|
|
8cc81cebdd | ||
|
|
c33aeb7275 | ||
|
|
c0237905b6 | ||
|
|
eda6d738a4 | ||
|
|
eef3b420a9 | ||
|
|
caef752a74 | ||
|
|
e13bd7af52 | ||
|
|
c263575788 | ||
|
|
5bd80d3d06 | ||
|
|
47cbc71e8a | ||
|
|
fdba8d147f | ||
|
|
4720b611b0 | ||
|
|
1f43410780 | ||
|
|
ead595e666 | ||
|
|
89cf40423b | ||
|
|
95d6944298 | ||
|
|
a3c19d1d1c | ||
|
|
88185cb886 | ||
|
|
7962aa7b1b | ||
|
|
220ce23e8f | ||
|
|
66752b2cbf | ||
|
|
f59a65f314 | ||
|
|
725034ebc5 | ||
|
|
0210020658 | ||
|
|
22dc6512c0 | ||
|
|
709b4524e6 | ||
|
|
bc462ede3e | ||
|
|
277bd14453 | ||
|
|
59fed2c516 | ||
|
|
d19486ce15 | ||
|
|
b55fcfaf04 | ||
|
|
60e5085724 | ||
|
|
5adde95807 | ||
|
|
3da0b8bc29 | ||
|
|
0104e8954a | ||
|
|
78e065feff | ||
|
|
30fe7930a9 | ||
|
|
453054f6c7 | ||
|
|
231f9a91c2 | ||
|
|
c553790eaf | ||
|
|
f2e8506ea7 | ||
|
|
76b22dfe17 | ||
|
|
1202c335d9 | ||
|
|
f70d671f1d | ||
|
|
1305a1f2b6 | ||
|
|
f5108c34db | ||
|
|
d553c60b65 | ||
|
|
be84cf1db7 | ||
|
|
854d7cb09c | ||
|
|
b70f401a91 | ||
|
|
496b28226d | ||
|
|
fec7c8fd0b | ||
|
|
f8e5e15051 | ||
|
|
78b273455d | ||
|
|
de35692666 | ||
|
|
49b2e42d8c | ||
|
|
307ccd10e8 | ||
|
|
1225f2074a | ||
|
|
afee4469f0 | ||
|
|
3b716e6e5e | ||
|
|
961b389b40 | ||
|
|
e9c691575f | ||
|
|
27236feec3 | ||
|
|
2e598a7ef7 | ||
|
|
0527a506ac | ||
|
|
1082d8a173 | ||
|
|
7ae41b71b2 | ||
|
|
de5a734919 | ||
|
|
987c55ed8f | ||
|
|
57783fe80f | ||
|
|
f24c2ddd22 | ||
|
|
58a242f753 | ||
|
|
5c2cf6dd15 | ||
|
|
287f3bc510 | ||
|
|
caaa6bcd0c | ||
|
|
b01c961251 | ||
|
|
826c73c903 | ||
|
|
b6a28ae15f | ||
|
|
ad0d55faed | ||
|
|
910ae6315d | ||
|
|
25b4d3a45b | ||
|
|
f355cb3a72 | ||
|
|
ff58648f94 | ||
|
|
f16e14e0b4 | ||
|
|
729c46ab00 | ||
|
|
3b546de070 | ||
|
|
ba64f75f88 | ||
|
|
4b8f2ce9e7 | ||
|
|
8c5c7fba29 | ||
|
|
bec26d5d05 | ||
|
|
8f369daf1e | ||
|
|
43cbdc1e57 | ||
|
|
cf4d0706ae | ||
|
|
2857eff884 | ||
|
|
050f1b4add | ||
|
|
2bbcd96ce3 | ||
|
|
1cbd8ee901 | ||
|
|
7e86cb0f84 | ||
|
|
0e7dccccfe | ||
|
|
9d75dea31a | ||
|
|
610f501608 | ||
|
|
361f7fc5bb | ||
|
|
951b35a345 | ||
|
|
6c317d56ee | ||
|
|
2acb3e759e | ||
|
|
9712ec4fbf | ||
|
|
ae0da59ed2 | ||
|
|
8e4db5a8c3 | ||
|
|
7f392006d1 | ||
|
|
828b18d0fd | ||
|
|
ad535ccc78 | ||
|
|
9dee761f6d | ||
|
|
f5531b458b | ||
|
|
a7c89f7b40 | ||
|
|
048ae0205c | ||
|
|
e6a0784466 | ||
|
|
53d15425f3 | ||
|
|
a79257271e | ||
|
|
94256876e4 | ||
|
|
d319b74d7a | ||
|
|
acb7c0878e | ||
|
|
47fcbefe8b | ||
|
|
c2cb5d763f | ||
|
|
208148b670 | ||
|
|
cf02c74272 | ||
|
|
f77cd0b834 | ||
|
|
461f5219e5 | ||
|
|
373ead8da6 | ||
|
|
3371086d54 | ||
|
|
45c3533501 | ||
|
|
4286f2ea5a | ||
|
|
344546a583 | ||
|
|
46f61ecfa3 | ||
|
|
2ec9c5addb | ||
|
|
d09f21fe15 | ||
|
|
33410f0618 | ||
|
|
2c98baade8 | ||
|
|
380f90d065 | ||
|
|
1781c6dcf0 | ||
|
|
cff3d0ee95 | ||
|
|
d1fc2dd6ec | ||
|
|
218712835e | ||
|
|
5a60cff9a1 | ||
|
|
18554e3186 | ||
|
|
2e2303c9aa | ||
|
|
fbf455c9fe | ||
|
|
00dcda6fad | ||
|
|
3be7538daa | ||
|
|
9e0638c54c | ||
|
|
a5ff46fbd1 | ||
|
|
6900938208 | ||
|
|
4887817142 | ||
|
|
0d721b55a7 | ||
|
|
65f71b6f6b | ||
|
|
89b508d0f6 | ||
|
|
6344f7a975 | ||
|
|
11eea37aa7 | ||
|
|
bff44c46f8 | ||
|
|
7a0ea759ef | ||
|
|
f9419977c0 | ||
|
|
da33a372cb | ||
|
|
0db141d0a6 | ||
|
|
79445225de | ||
|
|
a0f5e4cbb3 | ||
|
|
3b23c9eacd | ||
|
|
d4ce1ef3db | ||
|
|
b4f063b07a | ||
|
|
ffe840e245 | ||
|
|
2e3c3e92f1 | ||
|
|
5e20d6973f | ||
|
|
c68739d78c | ||
|
|
5392aaa27e | ||
|
|
fee82d294b |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -117,3 +117,8 @@ ENV/
|
||||
# Pycharm project settings
|
||||
.idea
|
||||
eos.iml
|
||||
gitversion
|
||||
.version
|
||||
/.version
|
||||
*.swp
|
||||
|
||||
|
||||
14
.mailmap
Normal file
14
.mailmap
Normal file
@@ -0,0 +1,14 @@
|
||||
cncfanatics <diego.duclos@gmail.com> cncfanatics <cncfanatics@titanium.(none)>
|
||||
blitzmann <holmes.ryan.90@gmail.com>
|
||||
blitzmann <holmes.ryan.90@gmail.com> blitzmann <ryan.xgamer99@gmail.com>
|
||||
blitzmann <holmes.ryan.90@gmail.com>
|
||||
blitzmann <holmes.ryan.90@gmail.com> blitzman <ryan.xgamer99@gmail.com>
|
||||
blitzmann <holmes.ryan.90@gmail.com> Ryan Holmes <ryan.holmes.90@gmail.com>
|
||||
blitzmann <holmes.ryan.90@gmail.com>
|
||||
Corollax <corollax@gmail.com> Corollax <corollax@corollax-laptop.(none)>
|
||||
Corollax <corollax@gmail.com> Corollax <corollax@corollax-N76VM.(none)>
|
||||
Mr. Nukealizer <mr.nukealizer@gmail.com> Mr. Nukealizer <MrNukealizer@users.noreply.github.com>
|
||||
DarkPhoenix <phoenix@mail.ru>
|
||||
Sakari Orisi <sakari@evefit.org>
|
||||
Will Wykeham <will@wykeham.net> Will Wykeham <will.wykeham@paconsulting.com>
|
||||
OISumeko <camerongrout@gmail.com> OISumeko <cameron@sporadic.co.nz>
|
||||
@@ -1,11 +1,13 @@
|
||||
# Submit a bug report bug report or feature request
|
||||
<!--
|
||||
|
||||
Submit a bug report bug report or feature request
|
||||
|
||||
Here you can inform pyfa developers of potential bugs or suggest features / improvements to the project. Please check
|
||||
to make sure that the bug hasn't been reported or feature requested before submitting. If you have general questions
|
||||
about the project and want to reach out to the developers personally, please check out out our [Slack]
|
||||
(https://pyfainvite.azurewebsites.net/).
|
||||
|
||||
---
|
||||
-->
|
||||
|
||||
## Bug Report
|
||||
|
||||
|
||||
11
README.md
11
README.md
@@ -36,13 +36,8 @@ The following is a list of pyfa packages available for certain distributions. Pl
|
||||
### Dependencies
|
||||
If you wish to help with development or simply need to run pyfa through a Python interpreter, the following software is required:
|
||||
|
||||
* Python 2.7
|
||||
* `wxPython` 2.8/3.0
|
||||
* `sqlalchemy` >= 1.0.5
|
||||
* `dateutil`
|
||||
* `matplotlib` (for some Linux distributions you may need to install separate wxPython bindings such as `python-matplotlib-wx`)
|
||||
* `requests`
|
||||
* `logbook` >= 1.0.0
|
||||
* Python 3.6
|
||||
* Requirements as listed in `requirements.txt`
|
||||
|
||||
## Bug Reporting
|
||||
The preferred method of reporting bugs is through the project's [GitHub Issues interface](https://github.com/pyfa-org/Pyfa/issues). Alternatively, posting a report in the [pyfa thread](http://forums.eveonline.com/default.aspx?g=posts&t=247609) on the official EVE Online forums is acceptable. Guidelines for bug reporting can be found on [this wiki page](https://github.com/DarkFenX/Pyfa/wiki/Bug-Reporting).
|
||||
@@ -52,7 +47,7 @@ pyfa is licensed under the GNU GPL v3.0, see LICENSE
|
||||
|
||||
## Resources
|
||||
* Development repository: [https://github.com/pyfa-org/Pyfa](https://github.com/pyfa-org/Pyfa)
|
||||
* [EVE forum thread](https://forums.eveonline.com/default.aspx?g=posts&t=466425)
|
||||
* [EVE forum thread](https://forums.eveonline.com/t/27156)
|
||||
* [EVE University guide using pyfa](http://wiki.eveuniversity.org/Guide_to_using_PYFA)
|
||||
* [EVE Online website](http://www.eveonline.com/)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ def DBInMemory_test():
|
||||
gamedataCache = True
|
||||
saveddataCache = True
|
||||
gamedata_version = ""
|
||||
gamedata_connectionstring = 'sqlite:///' + realpath(join(dirname(abspath(unicode(__file__))), "..", "eve.db"))
|
||||
gamedata_connectionstring = 'sqlite:///' + realpath(join(dirname(abspath(str(__file__))), "..", "eve.db"))
|
||||
saveddata_connectionstring = 'sqlite:///:memory:'
|
||||
|
||||
class ReadOnlyException(Exception):
|
||||
@@ -100,8 +100,8 @@ def DBInMemory():
|
||||
import eos.db
|
||||
|
||||
# Output debug info to help us troubleshoot Travis
|
||||
print(eos.db.saveddata_engine)
|
||||
print(eos.db.gamedata_engine)
|
||||
print((eos.db.saveddata_engine))
|
||||
print((eos.db.gamedata_engine))
|
||||
|
||||
helper = {
|
||||
'config': eos.config,
|
||||
|
||||
@@ -41,7 +41,7 @@ def CurseFit(DB, Gamedata, Saveddata):
|
||||
mod.state = Saveddata['State'].ONLINE
|
||||
|
||||
# Add 5 neuts
|
||||
for _ in xrange(5):
|
||||
for _ in range(5):
|
||||
fit.modules.append(mod)
|
||||
|
||||
return fit
|
||||
@@ -60,7 +60,7 @@ def HeronFit(DB, Gamedata, Saveddata):
|
||||
mod.state = Saveddata['State'].ONLINE
|
||||
|
||||
# Add 5 neuts
|
||||
for _ in xrange(4):
|
||||
for _ in range(4):
|
||||
fit.modules.append(mod)
|
||||
|
||||
return fit
|
||||
@@ -94,8 +94,8 @@ def GetUnicodePath(root, file=None, codec=None):
|
||||
path = os.path.join(path, file)
|
||||
|
||||
if codec:
|
||||
path = unicode(path, codec)
|
||||
path = str(path, codec)
|
||||
else:
|
||||
path = unicode(path)
|
||||
path = str(path)
|
||||
|
||||
return path
|
||||
|
||||
151
config.py
151
config.py
@@ -1,7 +1,8 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
from logbook import Logger
|
||||
from logbook import CRITICAL, DEBUG, ERROR, FingersCrossedHandler, INFO, Logger, NestedSetup, NullHandler, \
|
||||
StreamHandler, TimedRotatingFileHandler, WARNING
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -19,10 +20,11 @@ debug = False
|
||||
saveInRoot = False
|
||||
|
||||
# Version data
|
||||
version = "1.29.1"
|
||||
tag = "Stable"
|
||||
expansionName = "YC119.5"
|
||||
expansionVersion = "1.0"
|
||||
|
||||
version = "2.0.0b4"
|
||||
tag = "git"
|
||||
expansionName = "YC120.2"
|
||||
expansionVersion = "1.2"
|
||||
evemonMinVersion = "4081"
|
||||
|
||||
pyfaPath = None
|
||||
@@ -30,6 +32,16 @@ savePath = None
|
||||
saveDB = None
|
||||
gameDB = None
|
||||
logPath = None
|
||||
loggingLevel = None
|
||||
logging_setup = None
|
||||
|
||||
LOGLEVEL_MAP = {
|
||||
"critical": CRITICAL,
|
||||
"error": ERROR,
|
||||
"warning": WARNING,
|
||||
"info": INFO,
|
||||
"debug": DEBUG,
|
||||
}
|
||||
|
||||
|
||||
def isFrozen():
|
||||
@@ -45,23 +57,35 @@ def __createDirs(path):
|
||||
|
||||
|
||||
def getPyfaRoot():
|
||||
base = getattr(sys.modules['__main__'], "__file__", sys.executable) if isFrozen() else sys.argv[0]
|
||||
if hasattr(sys, '_MEIPASS'):
|
||||
return sys._MEIPASS
|
||||
base = getattr(sys.modules['__main__'], "__file__", sys.executable) if isFrozen() else __file__
|
||||
root = os.path.dirname(os.path.realpath(os.path.abspath(base)))
|
||||
root = unicode(root, sys.getfilesystemencoding())
|
||||
root = root
|
||||
return root
|
||||
|
||||
|
||||
def getVersion():
|
||||
if os.path.isfile(os.path.join(pyfaPath, '.version')):
|
||||
with open(os.path.join(pyfaPath, '.version')) as f:
|
||||
gitVersion = f.readline()
|
||||
return gitVersion
|
||||
# if no version file exists, then user is running from source or not an official build
|
||||
return version + " (git)"
|
||||
|
||||
|
||||
def getDefaultSave():
|
||||
return unicode(os.path.expanduser(os.path.join("~", ".pyfa")), sys.getfilesystemencoding())
|
||||
return os.path.expanduser(os.path.join("~", ".pyfa"))
|
||||
|
||||
|
||||
def defPaths(customSavePath):
|
||||
def defPaths(customSavePath=None):
|
||||
global debug
|
||||
global pyfaPath
|
||||
global savePath
|
||||
global saveDB
|
||||
global gameDB
|
||||
global saveInRoot
|
||||
global logPath
|
||||
|
||||
pyfalog.debug("Configuring Pyfa")
|
||||
|
||||
@@ -86,12 +110,12 @@ def defPaths(customSavePath):
|
||||
|
||||
__createDirs(savePath)
|
||||
|
||||
if isFrozen():
|
||||
os.environ["REQUESTS_CA_BUNDLE"] = os.path.join(pyfaPath, "cacert.pem").encode('utf8')
|
||||
os.environ["SSL_CERT_FILE"] = os.path.join(pyfaPath, "cacert.pem").encode('utf8')
|
||||
# if isFrozen():
|
||||
# os.environ["REQUESTS_CA_BUNDLE"] = os.path.join(pyfaPath, "cacert.pem")
|
||||
# os.environ["SSL_CERT_FILE"] = os.path.join(pyfaPath, "cacert.pem")
|
||||
|
||||
# The database where we store all the fits etc
|
||||
saveDB = os.path.join(savePath, "saveddata.db")
|
||||
saveDB = os.path.join(savePath, "saveddata-py3-dev.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
|
||||
@@ -100,6 +124,13 @@ def defPaths(customSavePath):
|
||||
if not gameDB:
|
||||
gameDB = os.path.join(pyfaPath, "eve.db")
|
||||
|
||||
if debug:
|
||||
logFile = "pyfa_debug.log"
|
||||
else:
|
||||
logFile = "pyfa.log"
|
||||
|
||||
logPath = os.path.join(savePath, logFile)
|
||||
|
||||
# DON'T MODIFY ANYTHING BELOW
|
||||
import eos.config
|
||||
|
||||
@@ -109,6 +140,100 @@ def defPaths(customSavePath):
|
||||
eos.config.saveddata_connectionstring = "sqlite:///" + saveDB + "?check_same_thread=False"
|
||||
eos.config.gamedata_connectionstring = "sqlite:///" + gameDB + "?check_same_thread=False"
|
||||
|
||||
print(eos.config.saveddata_connectionstring)
|
||||
print(eos.config.gamedata_connectionstring)
|
||||
|
||||
# initialize the settings
|
||||
from service.settings import EOSSettings
|
||||
eos.config.settings = EOSSettings.getInstance().EOSSettings # this is kind of confusing, but whatever
|
||||
|
||||
|
||||
def defLogging():
|
||||
global debug
|
||||
global logPath
|
||||
global loggingLevel
|
||||
global logging_setup
|
||||
|
||||
try:
|
||||
if debug:
|
||||
logging_setup = NestedSetup([
|
||||
# make sure we never bubble up to the stderr handler
|
||||
# if we run out of setup handling
|
||||
NullHandler(),
|
||||
StreamHandler(
|
||||
sys.stdout,
|
||||
bubble=False,
|
||||
level=loggingLevel
|
||||
),
|
||||
TimedRotatingFileHandler(
|
||||
logPath,
|
||||
level=0,
|
||||
backup_count=3,
|
||||
bubble=True,
|
||||
date_format='%Y-%m-%d',
|
||||
),
|
||||
])
|
||||
else:
|
||||
logging_setup = NestedSetup([
|
||||
# make sure we never bubble up to the stderr handler
|
||||
# if we run out of setup handling
|
||||
NullHandler(),
|
||||
FingersCrossedHandler(
|
||||
TimedRotatingFileHandler(
|
||||
logPath,
|
||||
level=0,
|
||||
backup_count=3,
|
||||
bubble=False,
|
||||
date_format='%Y-%m-%d',
|
||||
),
|
||||
action_level=ERROR,
|
||||
buffer_size=1000,
|
||||
# pull_information=True,
|
||||
# reset=False,
|
||||
)
|
||||
])
|
||||
except:
|
||||
print("Critical error attempting to setup logging. Falling back to console only.")
|
||||
logging_setup = NestedSetup([
|
||||
# make sure we never bubble up to the stderr handler
|
||||
# if we run out of setup handling
|
||||
NullHandler(),
|
||||
StreamHandler(
|
||||
sys.stdout,
|
||||
bubble=False
|
||||
)
|
||||
])
|
||||
|
||||
with logging_setup.threadbound():
|
||||
|
||||
# Output all stdout (print) messages as warnings
|
||||
try:
|
||||
sys.stdout = LoggerWriter(pyfalog.warning)
|
||||
except:
|
||||
pyfalog.critical("Cannot redirect. Continuing without writing stdout to log.")
|
||||
|
||||
# Output all stderr (stacktrace) messages as critical
|
||||
try:
|
||||
sys.stderr = LoggerWriter(pyfalog.critical)
|
||||
except:
|
||||
pyfalog.critical("Cannot redirect. Continuing without writing stderr to log.")
|
||||
|
||||
|
||||
class LoggerWriter(object):
|
||||
def __init__(self, level):
|
||||
# self.level is really like using log.debug(message)
|
||||
# at least in my case
|
||||
self.level = level
|
||||
|
||||
def write(self, message):
|
||||
# if statement reduces the amount of newlines that are
|
||||
# printed to the logger
|
||||
if message.strip() != '':
|
||||
self.level(message.replace("\n", ""))
|
||||
|
||||
def flush(self):
|
||||
# create a flush method so things can be flushed when
|
||||
# the system wants to. Not sure if simply 'printing'
|
||||
# sys.stderr is the correct way to do it, but it seemed
|
||||
# to work properly for me.
|
||||
self.level(sys.stderr)
|
||||
|
||||
70
dist_assets/linux/pyfa-linux.spec
Normal file
70
dist_assets/linux/pyfa-linux.spec
Normal file
@@ -0,0 +1,70 @@
|
||||
# -*- mode: python -*-
|
||||
|
||||
import os
|
||||
from itertools import chain
|
||||
import subprocess
|
||||
|
||||
label = subprocess.check_output([
|
||||
"git", "describe", "--tags"]).strip()
|
||||
|
||||
with open('gitversion', 'w+') as f:
|
||||
f.write(label.decode())
|
||||
|
||||
block_cipher = None
|
||||
|
||||
|
||||
added_files = [
|
||||
( 'imgs/gui/*.png', 'imgs/gui' ),
|
||||
( 'imgs/gui/*.gif', 'imgs/gui' ),
|
||||
( 'imgs/icons/*.png', 'imgs/icons' ),
|
||||
( 'imgs/renders/*.png', 'imgs/renders' ),
|
||||
( 'dist_assets/win/pyfa.ico', '.' ),
|
||||
( 'dist_assets/cacert.pem', '.' ),
|
||||
( 'eve.db', '.' ),
|
||||
( 'README.md', '.' ),
|
||||
( 'LICENSE', '.' ),
|
||||
( 'gitversion', '.' ),
|
||||
]
|
||||
|
||||
import_these = []
|
||||
|
||||
# Walk directories that do dynamic importing
|
||||
paths = ('eos/effects', 'eos/db/migrations', 'service/conversions')
|
||||
for root, folders, files in chain.from_iterable(os.walk(path) for path in paths):
|
||||
for file_ in files:
|
||||
if file_.endswith(".py") and not file_.startswith("_"):
|
||||
mod_name = "{}.{}".format(
|
||||
root.replace("/", "."),
|
||||
file_.split(".py")[0],
|
||||
)
|
||||
import_these.append(mod_name)
|
||||
|
||||
|
||||
a = Analysis(['pyfa.py'],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=added_files,
|
||||
hiddenimports=import_these,
|
||||
hookspath=[],
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher)
|
||||
pyz = PYZ(a.pure, a.zipped_data,
|
||||
cipher=block_cipher)
|
||||
exe = EXE(pyz,
|
||||
a.scripts,
|
||||
exclude_binaries=True,
|
||||
name='pyfa',
|
||||
debug=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
console=True )
|
||||
coll = COLLECT(exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
name='pyfa')
|
||||
73
dist_assets/mac/pyfa.spec
Normal file
73
dist_assets/mac/pyfa.spec
Normal file
@@ -0,0 +1,73 @@
|
||||
# -*- mode: python -*-
|
||||
|
||||
import os
|
||||
from itertools import chain
|
||||
import subprocess
|
||||
import requests.certs
|
||||
|
||||
label = subprocess.check_output([
|
||||
"git", "describe", "--tags"]).strip()
|
||||
|
||||
with open('.version', 'w+') as f:
|
||||
f.write(label.decode())
|
||||
|
||||
block_cipher = None
|
||||
|
||||
added_files = [
|
||||
('../../imgs/gui/*.png', 'imgs/gui'),
|
||||
('../../imgs/gui/*.gif', 'imgs/gui'),
|
||||
('../../imgs/icons/*.png', 'imgs/icons'),
|
||||
('../../imgs/renders/*.png', 'imgs/renders'),
|
||||
('../../dist_assets/win/pyfa.ico', '.'),
|
||||
(requests.certs.where(), '.'), # is this needed anymore?
|
||||
('../../eve.db', '.'),
|
||||
('../../README.md', '.'),
|
||||
('../../LICENSE', '.'),
|
||||
('../../.version', '.'),
|
||||
]
|
||||
|
||||
|
||||
import_these = []
|
||||
|
||||
# Walk directories that do dynamic importing
|
||||
paths = ('eos/effects', 'eos/db/migrations', 'service/conversions')
|
||||
for root, folders, files in chain.from_iterable(os.walk(path) for path in paths):
|
||||
for file_ in files:
|
||||
if file_.endswith(".py") and not file_.startswith("_"):
|
||||
mod_name = "{}.{}".format(
|
||||
root.replace("/", "."),
|
||||
file_.split(".py")[0],
|
||||
)
|
||||
import_these.append(mod_name)
|
||||
|
||||
a = Analysis([r'../../pyfa.py'],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=added_files,
|
||||
hiddenimports=import_these,
|
||||
hookspath=['dist_assets/pyinstaller_hooks'],
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher)
|
||||
pyz = PYZ(a.pure, a.zipped_data,
|
||||
cipher=block_cipher)
|
||||
exe = EXE(pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
name='pyfa',
|
||||
debug=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
runtime_tmpdir=None,
|
||||
console=False ,
|
||||
icon='dist_assets/mac/pyfa.icns',
|
||||
)
|
||||
|
||||
app = BUNDLE(exe,
|
||||
name='pyfa.app',
|
||||
icon=None,
|
||||
bundle_identifier=None)
|
||||
78
dist_assets/pyinstaller_hooks/hook-matplotlib.backends.py
Normal file
78
dist_assets/pyinstaller_hooks/hook-matplotlib.backends.py
Normal file
@@ -0,0 +1,78 @@
|
||||
# This apes hook-matplotlib.backends.py, but REMOVES backends, all but
|
||||
# the ones in the list below.
|
||||
# Courtesy of https://github.com/bpteague/cytoflow/blob/70f9291/packaging/hook-matplotlib.backends.py
|
||||
|
||||
KEEP = ["WXAgg", "WX", "agg"]
|
||||
|
||||
from PyInstaller.compat import is_darwin
|
||||
from PyInstaller.utils.hooks import (
|
||||
eval_statement, exec_statement, logger)
|
||||
|
||||
|
||||
def get_matplotlib_backend_module_names():
|
||||
"""
|
||||
List the names of all matplotlib backend modules importable under the
|
||||
current Python installation.
|
||||
Returns
|
||||
----------
|
||||
list
|
||||
List of the fully-qualified names of all such modules.
|
||||
"""
|
||||
# Statement safely importing a single backend module.
|
||||
import_statement = """
|
||||
import os, sys
|
||||
# Preserve stdout.
|
||||
sys_stdout = sys.stdout
|
||||
try:
|
||||
# Redirect output printed by this importation to "/dev/null", preventing
|
||||
# such output from being erroneously interpreted as an error.
|
||||
with open(os.devnull, 'w') as dev_null:
|
||||
sys.stdout = dev_null
|
||||
__import__('%s')
|
||||
# If this is an ImportError, print this exception's message without a traceback.
|
||||
# ImportError messages are human-readable and require no additional context.
|
||||
except ImportError as exc:
|
||||
sys.stdout = sys_stdout
|
||||
print(exc)
|
||||
# Else, print this exception preceded by a traceback. traceback.print_exc()
|
||||
# prints to stderr rather than stdout and must not be called here!
|
||||
except Exception:
|
||||
sys.stdout = sys_stdout
|
||||
import traceback
|
||||
print(traceback.format_exc())
|
||||
"""
|
||||
|
||||
# List of the human-readable names of all available backends.
|
||||
backend_names = eval_statement(
|
||||
'import matplotlib; print(matplotlib.rcsetup.all_backends)')
|
||||
|
||||
# List of the fully-qualified names of all importable backend modules.
|
||||
module_names = []
|
||||
|
||||
# If the current system is not OS X and the "CocoaAgg" backend is available,
|
||||
# remove this backend from consideration. Attempting to import this backend
|
||||
# on non-OS X systems halts the current subprocess without printing output
|
||||
# or raising exceptions, preventing its reliable detection.
|
||||
if not is_darwin and 'CocoaAgg' in backend_names:
|
||||
backend_names.remove('CocoaAgg')
|
||||
|
||||
# For safety, attempt to import each backend in a unique subprocess.
|
||||
for backend_name in backend_names:
|
||||
if backend_name in KEEP:
|
||||
continue
|
||||
|
||||
module_name = 'matplotlib.backends.backend_%s' % backend_name.lower()
|
||||
stdout = exec_statement(import_statement % module_name)
|
||||
|
||||
# If no output was printed, this backend is importable.
|
||||
if not stdout:
|
||||
module_names.append(module_name)
|
||||
logger.info(' Matplotlib backend "%s": removed' % backend_name)
|
||||
|
||||
return module_names
|
||||
|
||||
# Freeze all importable backends, as PyInstaller is unable to determine exactly
|
||||
# which backends are required by the current program.
|
||||
e=get_matplotlib_backend_module_names()
|
||||
print(e)
|
||||
excludedimports = e
|
||||
@@ -1,35 +1,36 @@
|
||||
# -*- mode: python -*-
|
||||
|
||||
# Note: This script is provided AS-IS for those that may be interested.
|
||||
# pyfa does not currently support pyInstaller (or any other build process) 100% at the moment
|
||||
|
||||
# Command line to build:
|
||||
# (Run from directory where pyfa.py and pyfa.spec lives.)
|
||||
# c:\Python27\scripts\pyinstaller.exe --clean --noconfirm --windowed --upx-dir=.\scripts\upx.exe pyfa.spec
|
||||
|
||||
# Don't forget to change the path to where your pyfa.py and pyfa.spec lives
|
||||
# pathex=['C:\\Users\\Ebag333\\Documents\\GitHub\\Ebag333\\Pyfa'],
|
||||
|
||||
import os
|
||||
from itertools import chain
|
||||
import subprocess
|
||||
import requests.certs
|
||||
|
||||
label = subprocess.check_output([
|
||||
"git", "describe", "--tags"]).strip()
|
||||
|
||||
with open('.version', 'w+') as f:
|
||||
f.write(label.decode())
|
||||
|
||||
block_cipher = None
|
||||
|
||||
added_files = [
|
||||
( 'imgs/gui/*.png', 'imgs/gui' ),
|
||||
( 'imgs/gui/*.gif', 'imgs/gui' ),
|
||||
( 'imgs/icons/*.png', 'imgs/icons' ),
|
||||
( 'imgs/renders/*.png', 'imgs/renders' ),
|
||||
( 'dist_assets/win/pyfa.ico', '.' ),
|
||||
( 'dist_assets/cacert.pem', '.' ),
|
||||
( 'eve.db', '.' ),
|
||||
( 'README.md', '.' ),
|
||||
( 'LICENSE', '.' ),
|
||||
('../../imgs/gui/*.png', 'imgs/gui'),
|
||||
('../../imgs/gui/*.gif', 'imgs/gui'),
|
||||
('../../imgs/icons/*.png', 'imgs/icons'),
|
||||
('../../imgs/renders/*.png', 'imgs/renders'),
|
||||
('../../dist_assets/win/pyfa.ico', '.'),
|
||||
(requests.certs.where(), '.'), # is this needed anymore?
|
||||
('../../eve.db', '.'),
|
||||
('../../README.md', '.'),
|
||||
('../../LICENSE', '.'),
|
||||
('../../.version', '.'),
|
||||
]
|
||||
|
||||
import_these = []
|
||||
|
||||
# Walk eos.effects and add all effects so we can import them properly
|
||||
for root, folders, files in os.walk("eos/effects"):
|
||||
# Walk directories that do dynamic importing
|
||||
paths = ('eos/effects', 'eos/db/migrations', 'service/conversions')
|
||||
for root, folders, files in chain.from_iterable(os.walk(path) for path in paths):
|
||||
for file_ in files:
|
||||
if file_.endswith(".py") and not file_.startswith("_"):
|
||||
mod_name = "{}.{}".format(
|
||||
@@ -38,25 +39,24 @@ for root, folders, files in os.walk("eos/effects"):
|
||||
)
|
||||
import_these.append(mod_name)
|
||||
|
||||
a = Analysis(
|
||||
['pyfa.py'],
|
||||
pathex=['C:\\projects\\pyfa\\'],
|
||||
a = Analysis(['../../pyfa.py'],
|
||||
pathex=[
|
||||
# Need this, see https://github.com/pyinstaller/pyinstaller/issues/1566
|
||||
# To get this, download and install windows 10 SDK
|
||||
# If not building on Windows 10, this might be optional
|
||||
r'C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86'],
|
||||
binaries=[],
|
||||
datas=added_files,
|
||||
hiddenimports=import_these,
|
||||
hookspath=[],
|
||||
hookspath=['dist_assets/pyinstaller_hooks'],
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
excludes=['Tkinter'],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher,
|
||||
)
|
||||
cipher=block_cipher)
|
||||
|
||||
pyz = PYZ(
|
||||
a.pure,
|
||||
a.zipped_data,
|
||||
cipher=block_cipher,
|
||||
)
|
||||
pyz = PYZ(a.pure, a.zipped_data,
|
||||
cipher=block_cipher)
|
||||
|
||||
exe = EXE(pyz,
|
||||
a.scripts,
|
||||
@@ -67,7 +67,6 @@ exe = EXE(pyz,
|
||||
upx=True,
|
||||
name='pyfa',
|
||||
icon='dist_assets/win/pyfa.ico',
|
||||
onefile=False,
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
@@ -77,7 +76,6 @@ coll = COLLECT(
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
onefile=False,
|
||||
name='pyfa',
|
||||
icon='dist_assets/win/pyfa.ico',
|
||||
)
|
||||
)
|
||||
45
dist_assets/win/version_resource.py
Normal file
45
dist_assets/win/version_resource.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# UTF-8
|
||||
#
|
||||
# For more details about fixed file info 'ffi' see:
|
||||
# http://msdn.microsoft.com/en-us/library/ms646997.aspx
|
||||
VSVersionInfo(
|
||||
ffi=FixedFileInfo(
|
||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
||||
# Set not needed items to zero 0.
|
||||
filevers=(1, 15, 1, 0),
|
||||
prodvers=(1, 15, 1, 0),
|
||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
||||
mask=0x3f,
|
||||
# Contains a bitmask that specifies the Boolean attributes of the file.
|
||||
flags=0x0,
|
||||
# The operating system for which this file was designed.
|
||||
# 0x4 - NT and there is no need to change it.
|
||||
OS=0x40004,
|
||||
# The general type of file.
|
||||
# 0x1 - the file is an application.
|
||||
fileType=0x1,
|
||||
# The function of the file.
|
||||
# 0x0 - the function is not defined for this fileType
|
||||
subtype=0x0,
|
||||
# Creation date and time stamp.
|
||||
date=(0, 0)
|
||||
),
|
||||
kids=[
|
||||
StringFileInfo(
|
||||
[
|
||||
StringTable(
|
||||
u'040904E4',
|
||||
[StringStruct(u'LegalCopyright', u''),
|
||||
StringStruct(u'InternalName', u'pyfa.exe'),
|
||||
StringStruct(u'FileVersion', u'1.15.1.0'),
|
||||
StringStruct(u'CompanyName', u''),
|
||||
StringStruct(u'OriginalFilename', u'pyfa.exe'),
|
||||
StringStruct(u'ProductVersion', u'1.15.1.0'),
|
||||
StringStruct(u'FileDescription', u'Python fitting assistant'),
|
||||
StringStruct(u'LegalTrademarks', u''),
|
||||
StringStruct(u'Comments', u''),
|
||||
StringStruct(u'ProductName', u'pyfa')])
|
||||
]),
|
||||
VarFileInfo([VarStruct(u'Translation', [1033, 1252])])
|
||||
]
|
||||
)
|
||||
@@ -1,6 +1,7 @@
|
||||
import heapq
|
||||
import time
|
||||
from math import sqrt, exp
|
||||
from functools import reduce
|
||||
|
||||
DAY = 24 * 60 * 60 * 1000
|
||||
|
||||
@@ -87,7 +88,7 @@ class CapSimulator(object):
|
||||
mods[(duration, capNeed, clipSize, disableStagger)] = 1
|
||||
|
||||
# Loop over grouped modules, configure staggering and push to the simulation state
|
||||
for (duration, capNeed, clipSize, disableStagger), amount in mods.iteritems():
|
||||
for (duration, capNeed, clipSize, disableStagger), amount in mods.items():
|
||||
if self.stagger and not disableStagger:
|
||||
if clipSize == 0:
|
||||
duration = int(duration / amount)
|
||||
@@ -192,7 +193,7 @@ class CapSimulator(object):
|
||||
|
||||
# calculate EVE's stability value
|
||||
try:
|
||||
avgDrain = reduce(float.__add__, map(lambda x: x[2] / x[1], self.state), 0.0)
|
||||
avgDrain = reduce(float.__add__, [x[2] / x[1] for x in self.state], 0.0)
|
||||
self.cap_stable_eve = 0.25 * (1.0 + sqrt(-(2.0 * avgDrain * tau - capCapacity) / capCapacity)) ** 2
|
||||
except ValueError:
|
||||
self.cap_stable_eve = 0.0
|
||||
|
||||
@@ -11,14 +11,14 @@ debug = False
|
||||
gamedataCache = True
|
||||
saveddataCache = True
|
||||
gamedata_version = ""
|
||||
gamedata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "eve.db")), sys.getfilesystemencoding())
|
||||
gamedata_connectionstring = 'sqlite:///' + realpath(join(dirname(abspath(__file__)), "..", "eve.db"))
|
||||
pyfalog.debug("Gamedata connection string: {0}", gamedata_connectionstring)
|
||||
|
||||
if istravis is True or hasattr(sys, '_called_from_test'):
|
||||
# Running in Travis. Run saveddata database in memory.
|
||||
saveddata_connectionstring = 'sqlite:///:memory:'
|
||||
else:
|
||||
saveddata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "saveddata", "saveddata.db")), sys.getfilesystemencoding())
|
||||
saveddata_connectionstring = 'sqlite:///' + realpath(join(dirname(abspath(__file__)), "..", "saveddata", "saveddata-py3-db.db"))
|
||||
|
||||
pyfalog.debug("Saveddata connection string: {0}", saveddata_connectionstring)
|
||||
|
||||
@@ -28,4 +28,4 @@ settings = {
|
||||
}
|
||||
|
||||
# Autodetect path, only change if the autodetection bugs out.
|
||||
path = dirname(unicode(__file__, sys.getfilesystemencoding()))
|
||||
path = dirname(__file__)
|
||||
|
||||
@@ -22,7 +22,7 @@ import threading
|
||||
from sqlalchemy import MetaData, create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
import migration
|
||||
from . import migration
|
||||
from eos import config
|
||||
from logbook import Logger
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ mapper(Item, items_table,
|
||||
properties={
|
||||
"group" : relation(Group, backref="items"),
|
||||
"icon" : relation(Icon),
|
||||
"_Item__attributes": relation(Attribute, collection_class=attribute_mapped_collection('name')),
|
||||
"_Item__attributes": relation(Attribute, cascade='all, delete, delete-orphan', collection_class=attribute_mapped_collection('name')),
|
||||
"effects": relation(Effect, secondary=typeeffects_table, collection_class=attribute_mapped_collection('name')),
|
||||
"metaGroup" : relation(MetaType,
|
||||
primaryjoin=metatypes_table.c.typeID == items_table.c.typeID,
|
||||
|
||||
@@ -81,7 +81,7 @@ def getItem(lookfor, eager=None):
|
||||
item = gamedata_session.query(Item).get(lookfor)
|
||||
else:
|
||||
item = gamedata_session.query(Item).options(*processEager(eager)).filter(Item.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
elif isinstance(lookfor, str):
|
||||
if lookfor in itemNameMap:
|
||||
id = itemNameMap[lookfor]
|
||||
if eager is None:
|
||||
@@ -154,7 +154,7 @@ def getGroup(lookfor, eager=None):
|
||||
group = gamedata_session.query(Group).get(lookfor)
|
||||
else:
|
||||
group = gamedata_session.query(Group).options(*processEager(eager)).filter(Group.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
elif isinstance(lookfor, str):
|
||||
if lookfor in groupNameMap:
|
||||
id = groupNameMap[lookfor]
|
||||
if eager is None:
|
||||
@@ -181,7 +181,7 @@ def getCategory(lookfor, eager=None):
|
||||
else:
|
||||
category = gamedata_session.query(Category).options(*processEager(eager)).filter(
|
||||
Category.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
elif isinstance(lookfor, str):
|
||||
if lookfor in categoryNameMap:
|
||||
id = categoryNameMap[lookfor]
|
||||
if eager is None:
|
||||
@@ -210,7 +210,7 @@ def getMetaGroup(lookfor, eager=None):
|
||||
else:
|
||||
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(
|
||||
MetaGroup.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
elif isinstance(lookfor, str):
|
||||
if lookfor in metaGroupNameMap:
|
||||
id = metaGroupNameMap[lookfor]
|
||||
if eager is None:
|
||||
@@ -245,7 +245,7 @@ def getMarketGroup(lookfor, eager=None):
|
||||
def getItemsByCategory(filter, where=None, eager=None):
|
||||
if isinstance(filter, int):
|
||||
filter = Category.ID == filter
|
||||
elif isinstance(filter, basestring):
|
||||
elif isinstance(filter, str):
|
||||
filter = Category.name == filter
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
@@ -257,7 +257,7 @@ def getItemsByCategory(filter, where=None, eager=None):
|
||||
|
||||
@cachedQuery(3, "where", "nameLike", "join")
|
||||
def searchItems(nameLike, where=None, join=None, eager=None):
|
||||
if not isinstance(nameLike, basestring):
|
||||
if not isinstance(nameLike, str):
|
||||
raise TypeError("Need string as argument")
|
||||
|
||||
if join is None:
|
||||
@@ -268,7 +268,7 @@ def searchItems(nameLike, where=None, join=None, eager=None):
|
||||
|
||||
items = gamedata_session.query(Item).options(*processEager(eager)).join(*join)
|
||||
for token in nameLike.split(' '):
|
||||
token_safe = u"%{0}%".format(sqlizeString(token))
|
||||
token_safe = "%{0}%".format(sqlizeString(token))
|
||||
if where is not None:
|
||||
items = items.filter(and_(Item.name.like(token_safe, escape="\\"), where))
|
||||
else:
|
||||
@@ -279,12 +279,12 @@ def searchItems(nameLike, where=None, join=None, eager=None):
|
||||
|
||||
@cachedQuery(3, "where", "nameLike", "join")
|
||||
def searchSkills(nameLike, where=None, eager=None):
|
||||
if not isinstance(nameLike, basestring):
|
||||
if not isinstance(nameLike, str):
|
||||
raise TypeError("Need string as argument")
|
||||
|
||||
items = gamedata_session.query(Item).options(*processEager(eager)).join(Item.group, Group.category)
|
||||
for token in nameLike.split(' '):
|
||||
token_safe = u"%{0}%".format(sqlizeString(token))
|
||||
token_safe = "%{0}%".format(sqlizeString(token))
|
||||
if where is not None:
|
||||
items = items.filter(and_(Item.name.like(token_safe, escape="\\"), Category.ID == 16, where))
|
||||
else:
|
||||
@@ -317,12 +317,12 @@ def getVariations(itemids, groupIDs=None, where=None, eager=None):
|
||||
vars = gamedata_session.query(Item).options(*processEager(eager)).join((groups_table, joinon)).filter(
|
||||
filter).all()
|
||||
|
||||
return vars
|
||||
return vars
|
||||
|
||||
|
||||
@cachedQuery(1, "attr")
|
||||
def getAttributeInfo(attr, eager=None):
|
||||
if isinstance(attr, basestring):
|
||||
if isinstance(attr, str):
|
||||
filter = AttributeInfo.name == attr
|
||||
elif isinstance(attr, int):
|
||||
filter = AttributeInfo.ID == attr
|
||||
@@ -337,7 +337,7 @@ def getAttributeInfo(attr, eager=None):
|
||||
|
||||
@cachedQuery(1, "field")
|
||||
def getMetaData(field):
|
||||
if isinstance(field, basestring):
|
||||
if isinstance(field, str):
|
||||
data = gamedata_session.query(MetaData).get(field)
|
||||
else:
|
||||
raise TypeError("Need string as argument")
|
||||
@@ -367,7 +367,7 @@ def getRequiredFor(itemID, attrMapping):
|
||||
|
||||
skillToLevelClauses = []
|
||||
|
||||
for attrSkill, attrLevel in attrMapping.iteritems():
|
||||
for attrSkill, attrLevel in attrMapping.items():
|
||||
skillToLevelClauses.append(and_(Attribute1.attributeID == attrSkill, Attribute2.attributeID == attrLevel))
|
||||
|
||||
queryOr = or_(*skillToLevelClauses)
|
||||
|
||||
@@ -3,7 +3,7 @@ import shutil
|
||||
import time
|
||||
|
||||
import config
|
||||
import migrations
|
||||
from . import migrations
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -34,7 +34,7 @@ def update(saveddata_engine):
|
||||
|
||||
shutil.copyfile(config.saveDB, toFile)
|
||||
|
||||
for version in xrange(dbVersion, appVersion):
|
||||
for version in range(dbVersion, appVersion):
|
||||
func = migrations.updates[version + 1]
|
||||
if func:
|
||||
pyfalog.info("Applying database update: {0}", version + 1)
|
||||
|
||||
@@ -15,7 +15,27 @@ updates = {}
|
||||
appVersion = 0
|
||||
|
||||
prefix = __name__ + "."
|
||||
for importer, modname, ispkg in pkgutil.iter_modules(__path__, prefix):
|
||||
|
||||
# load modules to work based with and without pyinstaller
|
||||
# from: https://github.com/webcomics/dosage/blob/master/dosagelib/loader.py
|
||||
# see: https://github.com/pyinstaller/pyinstaller/issues/1905
|
||||
|
||||
# load modules using iter_modules()
|
||||
# (should find all filters in normal build, but not pyinstaller)
|
||||
module_names = [m[1] for m in pkgutil.iter_modules(__path__, prefix)]
|
||||
|
||||
# special handling for PyInstaller
|
||||
importers = map(pkgutil.get_importer, __path__)
|
||||
toc = set()
|
||||
for i in importers:
|
||||
if hasattr(i, 'toc'):
|
||||
toc |= i.toc
|
||||
|
||||
for elm in toc:
|
||||
if elm.startswith(prefix):
|
||||
module_names.append(elm)
|
||||
|
||||
for modname in module_names:
|
||||
# loop through python files, extracting update number and function, and
|
||||
# adding it to a list
|
||||
modname_tail = modname.rsplit('.', 1)[-1]
|
||||
|
||||
@@ -91,7 +91,7 @@ def upgrade(saveddata_engine):
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN targetResistsID INTEGER;")
|
||||
|
||||
# Convert modules
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for replacement_item, list in CONVERSIONS.items():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?',
|
||||
(replacement_item, retired_item))
|
||||
|
||||
@@ -108,7 +108,7 @@ CONVERSIONS = {
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Convert modules
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for replacement_item, list in CONVERSIONS.items():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?',
|
||||
(replacement_item, retired_item))
|
||||
|
||||
@@ -332,7 +332,7 @@ CONVERSIONS = {
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Convert modules
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for replacement_item, list in CONVERSIONS.items():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?',
|
||||
(replacement_item, retired_item))
|
||||
|
||||
@@ -16,23 +16,27 @@ def upgrade(saveddata_engine):
|
||||
JOIN wings w on w.ID = s.wingID
|
||||
JOIN gangs g on g.ID = w.gangID
|
||||
"""
|
||||
try:
|
||||
results = saveddata_session.execute(sql)
|
||||
|
||||
results = saveddata_session.execute(sql)
|
||||
inserts = []
|
||||
|
||||
inserts = []
|
||||
for row in results:
|
||||
boosted = row["boostedFit"]
|
||||
types = ("squad", "wing", "gang")
|
||||
for x in types:
|
||||
value = row["{}Boost".format(x)]
|
||||
if value is None:
|
||||
continue
|
||||
|
||||
for row in results:
|
||||
boosted = row["boostedFit"]
|
||||
types = ("squad", "wing", "gang")
|
||||
for x in types:
|
||||
value = row["{}Boost".format(x)]
|
||||
if value is None:
|
||||
continue
|
||||
|
||||
inserts.append({"boosterID": value, "boostedID": boosted, "active": 1})
|
||||
try:
|
||||
saveddata_session.execute(commandFits_table.insert(),
|
||||
{"boosterID": value, "boostedID": boosted, "active": 1})
|
||||
except Exception:
|
||||
pass
|
||||
saveddata_session.commit()
|
||||
inserts.append({"boosterID": value, "boostedID": boosted, "active": 1})
|
||||
try:
|
||||
saveddata_session.execute(commandFits_table.insert(),
|
||||
{"boosterID": value, "boostedID": boosted, "active": 1})
|
||||
except Exception:
|
||||
pass
|
||||
saveddata_session.commit()
|
||||
except:
|
||||
# Shouldn't fail unless you have updated database without the old fleet schema and manually modify the database version
|
||||
# If it does, simply fail. Fleet data migration isn't critically important here
|
||||
pass
|
||||
|
||||
@@ -60,7 +60,7 @@ CONVERSIONS = {
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Convert modules
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for replacement_item, list in CONVERSIONS.items():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?',
|
||||
(replacement_item, retired_item))
|
||||
|
||||
@@ -29,7 +29,7 @@ def upgrade(saveddata_engine):
|
||||
"targetResists": 2
|
||||
}
|
||||
|
||||
for table in tables.keys():
|
||||
for table in list(tables.keys()):
|
||||
|
||||
# midnight brain, there's probably a much more simple way to do this, but fuck it
|
||||
if tables[table] > 0:
|
||||
|
||||
4246
eos/db/migrations/upgrade25.py
Normal file
4246
eos/db/migrations/upgrade25.py
Normal file
File diff suppressed because it is too large
Load Diff
9
eos/db/migrations/upgrade26.py
Normal file
9
eos/db/migrations/upgrade26.py
Normal file
@@ -0,0 +1,9 @@
|
||||
"""
|
||||
Migration 26
|
||||
|
||||
- Deletes invalid command fit relationships caused by a bug (see #1244)
|
||||
"""
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
saveddata_engine.execute("DELETE FROM commandFits WHERE boosterID NOT IN (SELECT ID FROM fits) OR boostedID NOT IN (SELECT ID FROM fits)")
|
||||
9
eos/db/migrations/upgrade27.py
Normal file
9
eos/db/migrations/upgrade27.py
Normal file
@@ -0,0 +1,9 @@
|
||||
"""
|
||||
Migration 27
|
||||
|
||||
- Resets all alpha clones to 1 (CCP consolidated all alpha's into one skillset)
|
||||
"""
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
saveddata_engine.execute("UPDATE characters SET alphaCloneID = 1 WHERE alphaCloneID IS NOT NULL")
|
||||
@@ -133,7 +133,7 @@ CONVERSIONS = {
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Convert modules
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for replacement_item, list in CONVERSIONS.items():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?',
|
||||
(replacement_item, retired_item))
|
||||
|
||||
@@ -7,5 +7,5 @@ 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 (?, ?, ?, ?, ?, ?, ?)',
|
||||
saveddata_engine.execute('INSERT INTO damagePatterns (ID, name, emAmount, thermalAmount, kineticAmount, explosiveAmount, ownerID) VALUES (?, ?, ?, ?, ?, ?, ?)',
|
||||
(1, "Uniform", 25, 25, 25, 25, None))
|
||||
|
||||
@@ -17,7 +17,7 @@ CONVERSIONS = {
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Convert ships
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for replacement_item, list in CONVERSIONS.items():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "fits" SET "shipID" = ? WHERE "shipID" = ?',
|
||||
(replacement_item, retired_item))
|
||||
|
||||
@@ -77,7 +77,7 @@ CONVERSIONS = {
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Convert modules
|
||||
for replacement_item, list in CONVERSIONS.iteritems():
|
||||
for replacement_item, list in CONVERSIONS.items():
|
||||
for retired_item in list:
|
||||
saveddata_engine.execute('UPDATE "modules" SET "itemID" = ? WHERE "itemID" = ?',
|
||||
(replacement_item, retired_item))
|
||||
|
||||
@@ -18,35 +18,38 @@
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy import Table, Column, ForeignKey, Integer, Boolean, DateTime
|
||||
from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.orm import mapper, relation
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.booster import Booster
|
||||
from eos.saveddata.boosterSideEffect import BoosterSideEffect
|
||||
|
||||
boosters_table = Table("boosters", saveddata_meta,
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("itemID", Integer),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False),
|
||||
Column("active", Boolean),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("itemID", Integer),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False),
|
||||
Column("active", Boolean),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
|
||||
)
|
||||
|
||||
# Legacy booster side effect code, should disable but a mapper relies on it.
|
||||
activeSideEffects_table = Table("boostersActiveSideEffects", saveddata_meta,
|
||||
Column("boosterID", ForeignKey("boosters.ID"), primary_key=True),
|
||||
Column("effectID", Integer, primary_key=True))
|
||||
|
||||
booster_side_effect_table = Table("boosterSideEffects", saveddata_meta,
|
||||
Column("boosterID", Integer, ForeignKey("boosters.ID"), primary_key=True, index=True),
|
||||
Column("effectID", Integer, nullable=False, primary_key=True),
|
||||
Column("active", Boolean, default=False)
|
||||
)
|
||||
|
||||
|
||||
class ActiveSideEffectsDummy(object):
|
||||
def __init__(self, effectID):
|
||||
self.effectID = effectID
|
||||
|
||||
|
||||
mapper(ActiveSideEffectsDummy, activeSideEffects_table)
|
||||
mapper(Booster, boosters_table,
|
||||
properties={"_Booster__activeSideEffectDummies": relation(ActiveSideEffectsDummy)})
|
||||
properties={
|
||||
"_Booster__sideEffects": relation(
|
||||
BoosterSideEffect,
|
||||
backref="booster",
|
||||
cascade='all, delete, delete-orphan'),
|
||||
}
|
||||
)
|
||||
|
||||
Booster._Booster__activeSideEffectIDs = association_proxy("_Booster__activeSideEffectDummies", "effectID")
|
||||
|
||||
mapper(BoosterSideEffect, booster_side_effect_table)
|
||||
|
||||
@@ -68,7 +68,7 @@ class DefaultDatabaseValues(object):
|
||||
["[Hybrid Charges]Uranium", "0", "38.4", "57.6", "0"],
|
||||
["[Missiles]Mjolnir", "100", "0", "0", "0"], ["[Missiles]Inferno", "0", "100", "0", "0"],
|
||||
["[Missiles]Scourge", "0", "0", "100", "0"], ["[Missiles]Nova", "0", "0", "0", "100"],
|
||||
["[Missiles][Structure) Standup Missile", "100", "100", "100", "100"],
|
||||
["[Missiles][Structure] Standup Missile", "100", "100", "100", "100"],
|
||||
["[Projectile Ammo][T2] Tremor", "0", "0", "24", "40"],
|
||||
["[Projectile Ammo][T2] Quake", "0", "0", "40", "72"],
|
||||
["[Projectile Ammo][T2] Hail", "0", "0", "26.4", "96.8"],
|
||||
|
||||
@@ -25,8 +25,10 @@ from eos.saveddata.price import Price
|
||||
|
||||
prices_table = Table("prices", saveddata_meta,
|
||||
Column("typeID", Integer, primary_key=True),
|
||||
Column("price", Float),
|
||||
Column("price", Float, default=0.0),
|
||||
Column("time", Integer, nullable=False),
|
||||
Column("failed", Integer))
|
||||
|
||||
mapper(Price, prices_table)
|
||||
mapper(Price, prices_table, properties={
|
||||
"_Price__price": prices_table.c.price,
|
||||
})
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
import sys
|
||||
|
||||
from sqlalchemy.sql import and_
|
||||
from sqlalchemy import desc, select
|
||||
|
||||
@@ -107,9 +109,9 @@ if configVal is True:
|
||||
if type not in queryCache:
|
||||
return
|
||||
functionCache = queryCache[type]
|
||||
for _, localCache in functionCache.iteritems():
|
||||
for _, localCache in functionCache.items():
|
||||
toDelete = set()
|
||||
for cacheKey, info in localCache.iteritems():
|
||||
for cacheKey, info in localCache.items():
|
||||
IDs = info[1]
|
||||
if ID in IDs:
|
||||
toDelete.add(cacheKey)
|
||||
@@ -154,7 +156,7 @@ def getUser(lookfor, eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
user = saveddata_session.query(User).options(*eager).filter(User.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
elif isinstance(lookfor, str):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
user = saveddata_session.query(User).options(*eager).filter(User.username == lookfor).first()
|
||||
@@ -173,7 +175,7 @@ def getCharacter(lookfor, eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
character = saveddata_session.query(Character).options(*eager).filter(Character.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
elif isinstance(lookfor, str):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
character = saveddata_session.query(Character).options(*eager).filter(
|
||||
@@ -335,7 +337,7 @@ def clearPrices():
|
||||
|
||||
|
||||
def getMiscData(field):
|
||||
if isinstance(field, basestring):
|
||||
if isinstance(field, str):
|
||||
with sd_lock:
|
||||
data = saveddata_session.query(MiscData).get(field)
|
||||
else:
|
||||
@@ -389,7 +391,7 @@ def getDamagePattern(lookfor, eager=None):
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(DamagePattern).options(*eager).filter(
|
||||
DamagePattern.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
elif isinstance(lookfor, str):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(DamagePattern).options(*eager).filter(
|
||||
@@ -410,7 +412,7 @@ def getTargetResists(lookfor, eager=None):
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(TargetResists).options(*eager).filter(
|
||||
TargetResists.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
elif isinstance(lookfor, str):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(TargetResists).options(*eager).filter(
|
||||
@@ -431,7 +433,7 @@ def getImplantSet(lookfor, eager=None):
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(ImplantSet).options(*eager).filter(
|
||||
TargetResists.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
elif isinstance(lookfor, str):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(ImplantSet).options(*eager).filter(TargetResists.name == lookfor).first()
|
||||
@@ -441,10 +443,10 @@ def getImplantSet(lookfor, eager=None):
|
||||
|
||||
|
||||
def searchFits(nameLike, where=None, eager=None):
|
||||
if not isinstance(nameLike, basestring):
|
||||
if not isinstance(nameLike, str):
|
||||
raise TypeError("Need string as argument")
|
||||
# Prepare our string for request
|
||||
nameLike = u"%{0}%".format(sqlizeString(nameLike))
|
||||
nameLike = "%{0}%".format(sqlizeString(nameLike))
|
||||
|
||||
# Add any extra components to the search to our where clause
|
||||
filter = processWhere(Fit.name.like(nameLike, escape="\\"), where)
|
||||
@@ -482,7 +484,7 @@ def getCrestCharacter(lookfor, eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
character = saveddata_session.query(CrestChar).options(*eager).filter(CrestChar.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
elif isinstance(lookfor, str):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
character = saveddata_session.query(CrestChar).options(*eager).filter(CrestChar.name == lookfor).first()
|
||||
@@ -513,8 +515,8 @@ def removeInvalid(fits):
|
||||
invalids = [f for f in fits if f.isInvalid]
|
||||
|
||||
if invalids:
|
||||
map(fits.remove, invalids)
|
||||
map(saveddata_session.delete, invalids)
|
||||
list(map(fits.remove, invalids))
|
||||
list(map(saveddata_session.delete, invalids))
|
||||
saveddata_session.commit()
|
||||
|
||||
return fits
|
||||
@@ -539,5 +541,10 @@ def remove(stuff):
|
||||
|
||||
def commit():
|
||||
with sd_lock:
|
||||
saveddata_session.commit()
|
||||
saveddata_session.flush()
|
||||
try:
|
||||
saveddata_session.commit()
|
||||
saveddata_session.flush()
|
||||
except Exception:
|
||||
saveddata_session.rollback()
|
||||
exc_info = sys.exc_info()
|
||||
raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
|
||||
|
||||
@@ -39,7 +39,7 @@ def processEager(eager):
|
||||
return tuple()
|
||||
else:
|
||||
l = []
|
||||
if isinstance(eager, basestring):
|
||||
if isinstance(eager, str):
|
||||
eager = (eager,)
|
||||
|
||||
for e in eager:
|
||||
@@ -50,7 +50,7 @@ def processEager(eager):
|
||||
|
||||
def _replacements(eagerString):
|
||||
splitEager = eagerString.split(".")
|
||||
for i in xrange(len(splitEager)):
|
||||
for i in range(len(splitEager)):
|
||||
part = splitEager[i]
|
||||
replacement = replace.get(part)
|
||||
if replacement:
|
||||
|
||||
@@ -115,7 +115,7 @@ class HandledList(list):
|
||||
class HandledModuleList(HandledList):
|
||||
def append(self, mod):
|
||||
emptyPosition = float("Inf")
|
||||
for i in xrange(len(self)):
|
||||
for i in range(len(self)):
|
||||
currMod = self[i]
|
||||
if currMod.isEmpty and not mod.isEmpty and currMod.slot == mod.slot:
|
||||
currPos = mod.position or i
|
||||
@@ -149,7 +149,7 @@ class HandledModuleList(HandledList):
|
||||
oldPos = mod.position
|
||||
|
||||
mod.position = None
|
||||
for i in xrange(oldPos, len(self)):
|
||||
for i in range(oldPos, len(self)):
|
||||
self[i].position -= 1
|
||||
|
||||
def toDummy(self, index):
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#
|
||||
# Used by:
|
||||
# Modules named like: Memetic Algorithm Bank (8 of 8)
|
||||
# Implant: Neural Lace 'Blackglass' Net Intrusion 920-40
|
||||
# Implant: Poteque 'Prospector' Environmental Analysis EY-1005
|
||||
# Implant: Poteque 'Prospector' Hacking HC-905
|
||||
type = "passive"
|
||||
|
||||
9
eos/effects/agilitybonus.py
Normal file
9
eos/effects/agilitybonus.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# agilityBonus
|
||||
#
|
||||
# Used by:
|
||||
# Subsystems named like: Propulsion Interdiction Nullifier (4 of 4)
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.ship.increaseItemAttr("agility", src.getModifiedItemAttr("agilityBonusAdd"))
|
||||
@@ -1,9 +1,7 @@
|
||||
# ammoInfluenceCapNeed
|
||||
#
|
||||
# Used by:
|
||||
# Items from category: Charge (466 of 913)
|
||||
# Charges from group: Frequency Crystal (185 of 185)
|
||||
# Charges from group: Hybrid Charge (209 of 209)
|
||||
# Items from category: Charge (478 of 925)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# ammoInfluenceRange
|
||||
#
|
||||
# Used by:
|
||||
# Items from category: Charge (571 of 913)
|
||||
# Items from category: Charge (572 of 925)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# ammoSpeedMultiplier
|
||||
#
|
||||
# Used by:
|
||||
# Charges from group: Festival Charges (22 of 22)
|
||||
# Charges from group: Festival Charges (23 of 23)
|
||||
# Charges from group: Interdiction Probe (2 of 2)
|
||||
# Charges from group: Survey Probe (3 of 3)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# Charges from group: Advanced Blaster Charge (8 of 8)
|
||||
# Charges from group: Advanced Pulse Laser Crystal (8 of 8)
|
||||
# Charges from group: Advanced Railgun Charge (8 of 8)
|
||||
# Charges from group: Projectile Ammo (129 of 129)
|
||||
# Charges from group: Projectile Ammo (128 of 128)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -6,4 +6,4 @@ type = "passive"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
fit.ship.increaseItemAttr("warmScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength"))
|
||||
fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength"))
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# armorHPBonusAddPassive
|
||||
#
|
||||
# Used by:
|
||||
# Subsystems from group: Defensive Systems (16 of 16)
|
||||
# Subsystems from group: Defensive Systems (9 of 12)
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
fit.ship.increaseItemAttr("armorHP", module.getModifiedItemAttr("armorHPBonusAdd"))
|
||||
fit.ship.increaseItemAttr("armorHP", module.getModifiedItemAttr("armorHPBonusAdd") or 0)
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
# boosterArmorHpPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants from group: Booster (12 of 48)
|
||||
# Implants from group: Booster (12 of 54)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Armor Capacity"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterArmorHPPenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.ship.boostItemAttr("armorHP", booster.getModifiedItemAttr("boosterArmorHPPenalty"))
|
||||
fit.ship.boostItemAttr("armorHP", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -5,9 +5,14 @@
|
||||
# Implants named like: Mindflood Booster (3 of 4)
|
||||
# Implants named like: Sooth Sayer Booster (3 of 4)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Armor Repair Amount"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterArmorRepairAmountPenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Armor Repair Unit",
|
||||
"armorDamageAmount", booster.getModifiedItemAttr("boosterArmorRepairAmountPenalty"))
|
||||
"armorDamageAmount", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -4,8 +4,13 @@
|
||||
# Implants named like: Blue Pill Booster (3 of 5)
|
||||
# Implants named like: Exile Booster (3 of 4)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Cap Capacity"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterCapacitorCapacityPenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.ship.boostItemAttr("capacitorCapacity", booster.getModifiedItemAttr("boosterCapacitorCapacityPenalty"))
|
||||
fit.ship.boostItemAttr("capacitorCapacity", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
# boosterMaxVelocityPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants from group: Booster (12 of 48)
|
||||
# Implants from group: Booster (12 of 54)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Velocity"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterMaxVelocityPenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.ship.boostItemAttr("maxVelocity", booster.getModifiedItemAttr("boosterMaxVelocityPenalty"))
|
||||
fit.ship.boostItemAttr("maxVelocity", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -4,9 +4,14 @@
|
||||
# Implants named like: Exile Booster (3 of 4)
|
||||
# Implants named like: Mindflood Booster (3 of 4)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Missile Explosion Radius"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterMissileAOECloudPenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
|
||||
"aoeCloudSize", booster.getModifiedItemAttr("boosterMissileAOECloudPenalty"))
|
||||
"aoeCloudSize", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -3,9 +3,14 @@
|
||||
# Used by:
|
||||
# Implants named like: Blue Pill Booster (3 of 5)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Missile Explosion Velocity"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterAOEVelocityPenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
|
||||
"aoeVelocity", booster.getModifiedItemAttr("boosterAOEVelocityPenalty"))
|
||||
"aoeVelocity", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -4,9 +4,14 @@
|
||||
# Implants named like: Crash Booster (3 of 4)
|
||||
# Implants named like: X Instinct Booster (3 of 4)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Missile Velocity"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterMissileVelocityPenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
|
||||
"maxVelocity", "boosterMissileVelocityPenalty")
|
||||
"maxVelocity", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -9,7 +9,7 @@ type = "passive"
|
||||
|
||||
def handler(fit, container, context):
|
||||
level = container.level if "skill" in context else 1
|
||||
attrs = ("boosterTurretFalloffPenalty", "boosterTurretOptimalRange", "boosterTurretTrackingPenalty")
|
||||
attrs = ("boosterTurretFalloffPenalty", "boosterTurretOptimalRangePenalty", "boosterTurretTrackingPenalty")
|
||||
for attr in attrs:
|
||||
fit.boosters.filteredItemBoost(lambda booster: True, attr,
|
||||
container.getModifiedItemAttr("boosterAttributeModifier") * level)
|
||||
|
||||
20
eos/effects/boostershieldboostamountpenaltyshieldskills.py
Normal file
20
eos/effects/boostershieldboostamountpenaltyshieldskills.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# boosterShieldBoostAmountPenaltyShieldSkills
|
||||
#
|
||||
# Used by:
|
||||
# Implants named like: Crash Booster (3 of 4)
|
||||
# Implants named like: Frentix Booster (3 of 4)
|
||||
# Implants named like: Mindflood Booster (3 of 4)
|
||||
type = "boosterSideEffect"
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Shield Boost"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterShieldBoostAmountPenalty"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Operation"), "shieldBonus",
|
||||
src.getModifiedItemAttr("boosterShieldBoostAmountPenalty"))
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Shield Operation"), "shieldBonus",
|
||||
src.getModifiedItemAttr("boosterShieldBoostAmountPenalty"))
|
||||
@@ -1,10 +1,15 @@
|
||||
# boosterShieldCapacityPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Implants from group: Booster (12 of 48)
|
||||
# Implants from group: Booster (12 of 54)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Shield Capacity"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterShieldCapacityPenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.ship.boostItemAttr("shieldCapacity", booster.getModifiedItemAttr("boosterShieldCapacityPenalty"))
|
||||
fit.ship.boostItemAttr("shieldCapacity", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -4,9 +4,14 @@
|
||||
# Implants named like: Drop Booster (3 of 4)
|
||||
# Implants named like: X Instinct Booster (3 of 4)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Turret Falloff"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterTurretFalloffPenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
|
||||
"falloff", booster.getModifiedItemAttr("boosterTurretFalloffPenalty"))
|
||||
"falloff", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -5,9 +5,14 @@
|
||||
# Implants named like: Mindflood Booster (3 of 4)
|
||||
# Implants named like: Sooth Sayer Booster (3 of 4)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Turret Optimal Range"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterTurretOptimalRangePenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
|
||||
"maxRange", booster.getModifiedItemAttr("boosterTurretOptimalRange"))
|
||||
"maxRange", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -4,9 +4,14 @@
|
||||
# Implants named like: Exile Booster (3 of 4)
|
||||
# Implants named like: Frentix Booster (3 of 4)
|
||||
type = "boosterSideEffect"
|
||||
activeByDefault = False
|
||||
|
||||
# User-friendly name for the side effect
|
||||
displayName = "Turret Tracking"
|
||||
|
||||
# Attribute that this effect targets
|
||||
attr = "boosterTurretTrackingPenalty"
|
||||
|
||||
|
||||
def handler(fit, booster, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
|
||||
"trackingSpeed", booster.getModifiedItemAttr("boosterTurretTrackingPenalty"))
|
||||
"trackingSpeed", booster.getModifiedItemAttr(attr))
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
# capacitorCapacityAddPassive
|
||||
#
|
||||
# Used by:
|
||||
# Subsystems from group: Engineering Systems (16 of 16)
|
||||
# Subsystem: Tengu Offensive - Magnetic Infusion Basin
|
||||
# Items from category: Subsystem (20 of 48)
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
fit.ship.increaseItemAttr("capacitorCapacity",
|
||||
module.getModifiedItemAttr("capacitorCapacity"))
|
||||
fit.ship.increaseItemAttr("capacitorCapacity", module.getModifiedItemAttr("capacitorCapacity") or 0)
|
||||
|
||||
@@ -10,4 +10,6 @@ type = "passive"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
fit.ship.multiplyItemAttr("capacitorCapacity", module.getModifiedItemAttr("capacitorCapacityMultiplier"))
|
||||
# We default this to None as there are times when the source attribute doesn't exist (for example, Cap Power Relay).
|
||||
# It will return 0 as it doesn't exist, which would nullify whatever the target attribute is
|
||||
fit.ship.multiplyItemAttr("capacitorCapacity", module.getModifiedItemAttr("capacitorCapacityMultiplier", None))
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# capacityAddPassive
|
||||
#
|
||||
# Used by:
|
||||
# Subsystems from group: Defensive Systems (16 of 16)
|
||||
# Subsystems named like: Defensive Covert Reconfiguration (4 of 4)
|
||||
# Subsystem: Legion Defensive - Nanobot Injector
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, subsystem, context):
|
||||
fit.ship.increaseItemAttr("capacity", subsystem.getModifiedItemAttr("capacity") or 0)
|
||||
fit.ship.increaseItemAttr("capacity", subsystem.getModifiedItemAttr("cargoCapacityAdd") or 0)
|
||||
|
||||
@@ -6,6 +6,6 @@ type = "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
for x in xrange(1, 4):
|
||||
for x in range(1, 4):
|
||||
value = module.getModifiedChargeAttr("warfareBuff{}Multiplier".format(x))
|
||||
module.multiplyItemAttr("warfareBuff{}Value".format(x), value)
|
||||
|
||||
21
eos/effects/citadelrigbonus.py
Normal file
21
eos/effects/citadelrigbonus.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Not used by any item
|
||||
type = "passive"
|
||||
runTime = "early"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
|
||||
for attr in [
|
||||
"structureRigDoomsdayDamageLossTargetBonus",
|
||||
"structureRigScanResBonus",
|
||||
"structureRigPDRangeBonus",
|
||||
"structureRigPDCapUseBonus",
|
||||
"structureRigMissileExploVeloBonus",
|
||||
"structureRigMissileVelocityBonus",
|
||||
"structureRigEwarOptimalBonus",
|
||||
"structureRigEwarFalloffBonus",
|
||||
"structureRigEwarCapUseBonus",
|
||||
"structureRigMissileExplosionRadiusBonus"
|
||||
]:
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Jury Rigging"),
|
||||
attr, src.getModifiedItemAttr("structureRoleBonus"))
|
||||
@@ -8,6 +8,5 @@ type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Leadership"),
|
||||
"maxRange",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Leadership"), "maxRange",
|
||||
src.getModifiedItemAttr("areaOfEffectBonus") * src.level)
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
# Ships from group: Carrier (4 of 4)
|
||||
# Ships from group: Combat Battlecruiser (13 of 13)
|
||||
# Ships from group: Command Ship (8 of 8)
|
||||
# Ships from group: Force Auxiliary (5 of 5)
|
||||
# Ships from group: Force Auxiliary (6 of 6)
|
||||
# Ships from group: Supercarrier (6 of 6)
|
||||
# Ships from group: Titan (6 of 6)
|
||||
# Subsystems named like: Defensive Warfare Processor (4 of 4)
|
||||
# Ships from group: Titan (7 of 7)
|
||||
# Subsystems named like: Offensive Support Processor (4 of 4)
|
||||
# Ship: Orca
|
||||
# Ship: Rorqual
|
||||
type = "passive"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Enforcer
|
||||
# Ship: Marshal
|
||||
# Ship: Pacifier
|
||||
type = "passive"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# covertCynoCpuPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Subsystems from group: Offensive Systems (12 of 16)
|
||||
# Subsystems from group: Defensive Systems (8 of 12)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# covertOpsAndReconOpsCloakModuleDelayBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Black Ops (4 of 4)
|
||||
# Ships from group: Black Ops (5 of 5)
|
||||
# Ships from group: Blockade Runner (4 of 4)
|
||||
# Ships from group: Covert Ops (7 of 7)
|
||||
# Ships from group: Expedition Frigate (2 of 2)
|
||||
# Ships from group: Force Recon Ship (7 of 7)
|
||||
# Ships from group: Stealth Bomber (4 of 4)
|
||||
# Ships from group: Force Recon Ship (8 of 8)
|
||||
# Ships from group: Stealth Bomber (5 of 5)
|
||||
# Ships named like: Stratios (2 of 2)
|
||||
# Subsystems named like: Offensive Covert Reconfiguration (4 of 4)
|
||||
# Subsystems named like: Defensive Covert Reconfiguration (4 of 4)
|
||||
# Ship: Astero
|
||||
# Ship: Rabisu
|
||||
type = "passive"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# covertOpsCloakCpuPenalty
|
||||
#
|
||||
# Used by:
|
||||
# Subsystems from group: Offensive Systems (12 of 16)
|
||||
# Subsystems from group: Defensive Systems (8 of 12)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -8,4 +8,4 @@ runTime = "early"
|
||||
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Cloaking"),
|
||||
"cpu", ship.getModifiedItemAttr("eliteBonusCoverOps1"), skill="Covert Ops")
|
||||
"cpu", ship.getModifiedItemAttr("eliteBonusCovertOps1"), skill="Covert Ops")
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
# Ship: Astero
|
||||
# Ship: Enforcer
|
||||
# Ship: Pacifier
|
||||
# Ship: Victor
|
||||
# Ship: Victorieux Luxury Yacht
|
||||
# Ship: Virtuoso
|
||||
type = "passive"
|
||||
runTime = "early"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# covertOpsCpuBonus1
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Stealth Bomber (4 of 4)
|
||||
# Subsystems named like: Offensive Covert Reconfiguration (4 of 4)
|
||||
# Ships from group: Stealth Bomber (4 of 5)
|
||||
# Subsystems named like: Defensive Covert Reconfiguration (4 of 4)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# covertOpsStealthBomberSiegeMissileLauncherCPUNeedBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Virtuoso
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Missile Launcher Torpedo",
|
||||
"cpu", ship.getModifiedItemAttr("stealthBomberLauncherCPU"))
|
||||
@@ -1,7 +1,7 @@
|
||||
# covertOpsStealthBomberSiegeMissileLauncerPowerNeedBonus
|
||||
# covertOpsStealthBomberSiegeMissileLauncherPowerNeedBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Stealth Bomber (4 of 4)
|
||||
# Ships from group: Stealth Bomber (5 of 5)
|
||||
type = "passive"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# covertOpsStealthBomberTargettingDelayBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Black Ops (4 of 4)
|
||||
# Ships from group: Stealth Bomber (4 of 4)
|
||||
# Ships from group: Black Ops (5 of 5)
|
||||
# Ships from group: Stealth Bomber (5 of 5)
|
||||
# Ship: Caedes
|
||||
# Ship: Chremoas
|
||||
# Ship: Endurance
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# cpuOutputAddCpuOutputPassive
|
||||
#
|
||||
# Used by:
|
||||
# Items from category: Subsystem (40 of 80)
|
||||
# Subsystems from group: Offensive Systems (8 of 12)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# cynosuralDurationBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Force Recon Ship (6 of 7)
|
||||
# Ships from group: Force Recon Ship (7 of 8)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# cynosuralTheoryConsumptionBonus
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Force Recon Ship (6 of 7)
|
||||
# Ships from group: Force Recon Ship (7 of 8)
|
||||
# Skill: Cynosural Field Theory
|
||||
type = "passive"
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# damageControl
|
||||
#
|
||||
# Used by:
|
||||
# Variations of module: Damage Control I (16 of 16)
|
||||
# Module: Civilian Damage Control
|
||||
# Modules from group: Damage Control (22 of 27)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# doHacking
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Data Miners (15 of 16)
|
||||
# Modules from group: Data Miners (9 of 9)
|
||||
type = "active"
|
||||
|
||||
|
||||
|
||||
16
eos/effects/doomsdayaoedamp.py
Normal file
16
eos/effects/doomsdayaoedamp.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# doomsdayAOEDamp
|
||||
#
|
||||
# Used by:
|
||||
# Module: Sensor Dampening Burst Projector
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context, *args, **kwargs):
|
||||
if "projected" not in context:
|
||||
return
|
||||
|
||||
fit.ship.boostItemAttr("maxTargetRange", module.getModifiedItemAttr("maxTargetRangeBonus"),
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
fit.ship.boostItemAttr("scanResolution", module.getModifiedItemAttr("scanResolutionBonus"),
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
18
eos/effects/doomsdayaoeecm.py
Normal file
18
eos/effects/doomsdayaoeecm.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# doomsdayAOEECM
|
||||
#
|
||||
# Used by:
|
||||
# Module: ECM Jammer Burst Projector
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, module, context, **kwargs):
|
||||
if "projected" in context:
|
||||
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
|
||||
strModifier = 1 - module.getModifiedItemAttr("scan{0}StrengthBonus".format(fit.scanType)) / fit.scanStrength
|
||||
|
||||
if 'effect' in kwargs:
|
||||
strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
fit.ecmProjectedStr *= strModifier
|
||||
21
eos/effects/doomsdayaoeneut.py
Normal file
21
eos/effects/doomsdayaoeneut.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# doomsdayAOENeut
|
||||
#
|
||||
# Used by:
|
||||
# Module: Energy Neutralization Burst Projector
|
||||
from eos.saveddata.module import State
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict
|
||||
|
||||
type = "active", "projected"
|
||||
|
||||
|
||||
def handler(fit, src, context, **kwargs):
|
||||
if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or
|
||||
hasattr(src, "amountActive")):
|
||||
amount = src.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
|
||||
if 'effect' in kwargs:
|
||||
amount *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
|
||||
|
||||
time = src.getModifiedItemAttr("duration")
|
||||
|
||||
fit.addDrain(src, time, amount, 0)
|
||||
11
eos/effects/doomsdayaoepaint.py
Normal file
11
eos/effects/doomsdayaoepaint.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# doomsdayAOEPaint
|
||||
#
|
||||
# Used by:
|
||||
# Module: Target Illumination Burst Projector
|
||||
type = "projected", "active"
|
||||
|
||||
|
||||
def handler(fit, container, context, *args, **kwargs):
|
||||
if "projected" in context:
|
||||
fit.ship.boostItemAttr("signatureRadius", container.getModifiedItemAttr("signatureRadiusBonus"),
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
29
eos/effects/doomsdayaoetrack.py
Normal file
29
eos/effects/doomsdayaoetrack.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# doomsdayAOETrack
|
||||
#
|
||||
# Used by:
|
||||
# Module: Weapon Disruption Burst Projector
|
||||
|
||||
type = "active", "projected"
|
||||
|
||||
|
||||
def handler(fit, module, context, *args, **kwargs):
|
||||
if "projected" in context:
|
||||
for srcAttr, tgtAttr in (
|
||||
("aoeCloudSizeBonus", "aoeCloudSize"),
|
||||
("aoeVelocityBonus", "aoeVelocity"),
|
||||
("missileVelocityBonus", "maxVelocity"),
|
||||
("explosionDelayBonus", "explosionDelay"),
|
||||
):
|
||||
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
|
||||
tgtAttr, module.getModifiedItemAttr(srcAttr),
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
|
||||
"trackingSpeed", module.getModifiedItemAttr("trackingSpeedBonus"),
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
|
||||
"maxRange", module.getModifiedItemAttr("maxRangeBonus"),
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
|
||||
"falloff", module.getModifiedItemAttr("falloffBonus"),
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
12
eos/effects/doomsdayaoeweb.py
Normal file
12
eos/effects/doomsdayaoeweb.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# doomsdayAOEWeb
|
||||
#
|
||||
# Used by:
|
||||
# Module: Stasis Webification Burst Projector
|
||||
type = "active", "projected"
|
||||
|
||||
|
||||
def handler(fit, module, context, *args, **kwargs):
|
||||
if "projected" not in context:
|
||||
return
|
||||
fit.ship.boostItemAttr("maxVelocity", module.getModifiedItemAttr("speedFactor"),
|
||||
stackingPenalties=True, *args, **kwargs)
|
||||
@@ -1,8 +1,7 @@
|
||||
# droneBandwidthAddPassive
|
||||
#
|
||||
# Used by:
|
||||
# Subsystems from group: Engineering Systems (13 of 16)
|
||||
# Subsystems from group: Offensive Systems (16 of 16)
|
||||
# Subsystems from group: Offensive Systems (12 of 12)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# droneCapacityAdddroneCapacityPassive
|
||||
#
|
||||
# Used by:
|
||||
# Items from category: Subsystem (42 of 80)
|
||||
# Subsystems from group: Offensive Systems (12 of 12)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# Used by:
|
||||
# Implants named like: Zainou 'Gypsy' CPU Management EE (6 of 6)
|
||||
# Modules named like: Processor Overclocking Unit (8 of 8)
|
||||
# Subsystems named like: Core Electronic Efficiency Gate (2 of 2)
|
||||
# Implant: Genolution Core Augmentation CA-2
|
||||
# Skill: CPU Management
|
||||
type = "passive"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# eliteBonusBlackOpsCloakVelocity2
|
||||
#
|
||||
# Used by:
|
||||
# Ships from group: Black Ops (4 of 4)
|
||||
# Ships from group: Black Ops (5 of 5)
|
||||
type = "passive"
|
||||
|
||||
|
||||
|
||||
10
eos/effects/elitebonusblackopsscramblerrange4.py
Normal file
10
eos/effects/elitebonusblackopsscramblerrange4.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# eliteBonusBlackOpsScramblerRange4
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Marshal
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Warp Scrambler", "maxRange",
|
||||
src.getModifiedItemAttr("eliteBonusBlackOps4"), stackingPenalties=True, skill="Black Ops")
|
||||
9
eos/effects/elitebonusblackopswarpvelocity1.py
Normal file
9
eos/effects/elitebonusblackopswarpvelocity1.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# eliteBonusBlackOpsWarpVelocity1
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Marshal
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.ship.boostItemAttr("warpSpeedMultiplier", src.getModifiedItemAttr("eliteBonusBlackOps1"), stackingPenalties=True, skill="Black Ops")
|
||||
10
eos/effects/elitebonusblackopswebrange3.py
Normal file
10
eos/effects/elitebonusblackopswebrange3.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# eliteBonusBlackOpsWebRange3
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Marshal
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", "maxRange",
|
||||
src.getModifiedItemAttr("eliteBonusBlackOps3"), stackingPenalties=True, skill="Black Ops")
|
||||
@@ -7,4 +7,4 @@ type = "passive"
|
||||
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Bomb Deployment"),
|
||||
"emDamage", ship.getModifiedItemAttr("eliteBonusCoverOps1"), skill="Covert Ops")
|
||||
"emDamage", ship.getModifiedItemAttr("eliteBonusCovertOps1"), skill="Covert Ops")
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Hound
|
||||
# Ship: Virtuoso
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Bomb Deployment"),
|
||||
"explosiveDamage", ship.getModifiedItemAttr("eliteBonusCoverOps1"),
|
||||
"explosiveDamage", ship.getModifiedItemAttr("eliteBonusCovertOps1"),
|
||||
skill="Covert Ops")
|
||||
|
||||
@@ -7,5 +7,5 @@ type = "passive"
|
||||
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Bomb Deployment"),
|
||||
"kineticDamage", ship.getModifiedItemAttr("eliteBonusCoverOps1"),
|
||||
"kineticDamage", ship.getModifiedItemAttr("eliteBonusCovertOps1"),
|
||||
skill="Covert Ops")
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
#
|
||||
# Used by:
|
||||
# Ship: Nemesis
|
||||
# Ship: Virtuoso
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, ship, context):
|
||||
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Bomb Deployment"),
|
||||
"thermalDamage", ship.getModifiedItemAttr("eliteBonusCoverOps1"),
|
||||
"thermalDamage", ship.getModifiedItemAttr("eliteBonusCovertOps1"),
|
||||
skill="Covert Ops")
|
||||
|
||||
@@ -7,5 +7,5 @@ type = "passive"
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name in ("Energy Nosferatu", "Energy Neutralizer"),
|
||||
"falloffEffectiveness", src.getModifiedItemAttr("eliteBonusCoverOps1"),
|
||||
"falloffEffectiveness", src.getModifiedItemAttr("eliteBonusCovertOps1"),
|
||||
stackingPenalties=True, skill="Covert Ops")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user