Compare commits
1552 Commits
preview_cr
...
v1.29.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a79257271e | ||
|
|
94256876e4 | ||
|
|
d319b74d7a | ||
|
|
208148b670 | ||
|
|
461f5219e5 | ||
|
|
373ead8da6 | ||
|
|
3371086d54 | ||
|
|
45c3533501 | ||
|
|
4286f2ea5a | ||
|
|
344546a583 | ||
|
|
46f61ecfa3 | ||
|
|
d09f21fe15 | ||
|
|
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 | ||
|
|
9f5e14fe2d | ||
|
|
b39ec4f9b3 | ||
|
|
25bfb4ddb8 | ||
|
|
de9b167242 | ||
|
|
18d44979e4 | ||
|
|
1eddad859a | ||
|
|
e2de1565bf | ||
|
|
fc9408d062 | ||
|
|
cb98618e5e | ||
|
|
892ee13542 | ||
|
|
2595c59c73 | ||
|
|
93c26aa02f | ||
|
|
a6a153b703 | ||
|
|
38e6e7d5ed | ||
|
|
4d8c9e0522 | ||
|
|
e75e2b7605 | ||
|
|
0e81c985a3 | ||
|
|
21a071ea40 | ||
|
|
4f1e7697ed | ||
|
|
ccfd414cb3 | ||
|
|
3de63c5ca5 | ||
|
|
42e64a6223 | ||
|
|
53f589284b | ||
|
|
aecbf8f86e | ||
|
|
dd09b3d951 | ||
|
|
f022c2474c | ||
|
|
249956689a | ||
|
|
6b22bd189a | ||
|
|
524bb43113 | ||
|
|
83a7a854bb | ||
|
|
0507a55731 | ||
|
|
f1eb3f68d1 | ||
|
|
1604ea1f2c | ||
|
|
4a9662c0f7 | ||
|
|
47a683c44c | ||
|
|
d888982657 | ||
|
|
184c46dbce | ||
|
|
b2ae6913d7 | ||
|
|
703d6dbc85 | ||
|
|
2e6066e848 | ||
|
|
f751eff1cf | ||
|
|
d342e66db4 | ||
|
|
1222567a4f | ||
|
|
1f7858f853 | ||
|
|
283cb1e50c | ||
|
|
c2880c0175 | ||
|
|
3d0a4b84d4 | ||
|
|
622efb624d | ||
|
|
50965244c0 | ||
|
|
9e6aca2496 | ||
|
|
1cf844d415 | ||
|
|
f57e7cf1ec | ||
|
|
bedd6efff2 | ||
|
|
9bffc6afd6 | ||
|
|
77b5e8afdc | ||
|
|
f9b7376cc7 | ||
|
|
34723d7bb1 | ||
|
|
32f417ce5a | ||
|
|
5657438e3c | ||
|
|
f7349316b4 | ||
|
|
c0f74cd0a3 | ||
|
|
bb73065b43 | ||
|
|
ae99a179d9 | ||
|
|
b4930d15b7 | ||
|
|
86e6250a63 | ||
|
|
c9a04e886a | ||
|
|
b21c850598 | ||
|
|
58abdcfa22 | ||
|
|
d0a4fa1c9d | ||
|
|
e94b4a1c18 | ||
|
|
2a679efc14 | ||
|
|
4652b91e98 | ||
|
|
0079f76f67 | ||
|
|
711537dcf4 | ||
|
|
e971b7927e | ||
|
|
3afa829173 | ||
|
|
cd30d74393 | ||
|
|
25a945f9e6 | ||
|
|
504d582b59 | ||
|
|
3d8a80aeaa | ||
|
|
9ac609528b | ||
|
|
988861af1f | ||
|
|
66a8669c64 | ||
|
|
99b0322289 | ||
|
|
b0e7c02a6a | ||
|
|
f0fc5643e9 | ||
|
|
8c83ac120f | ||
|
|
53cab4b1ab | ||
|
|
6d176c0010 | ||
|
|
1aaa93c1fd | ||
|
|
9d1c77f5b7 | ||
|
|
3b351603a3 | ||
|
|
f563b2666d | ||
|
|
cede46d4a4 | ||
|
|
90d854fd24 | ||
|
|
9c406a0a44 | ||
|
|
81160e9e72 | ||
|
|
7bfd19dca4 | ||
|
|
8ff244d509 | ||
|
|
e2061a25c2 | ||
|
|
272201c0fc | ||
|
|
54930d7d50 | ||
|
|
5ddac97719 | ||
|
|
973432b997 | ||
|
|
1ee679903c | ||
|
|
89614f7948 | ||
|
|
dec5970bd6 | ||
|
|
a374fb4a12 | ||
|
|
5d066f1401 | ||
|
|
e8749d379a | ||
|
|
b02506d6cd | ||
|
|
cca61b8ac1 | ||
|
|
962c45b807 | ||
|
|
9646cee324 | ||
|
|
04242ef52c | ||
|
|
da9816d1bd | ||
|
|
283aba4f85 | ||
|
|
080590a292 | ||
|
|
a7ec10525e | ||
|
|
e28bf545e9 | ||
|
|
5aeb3a38c8 | ||
|
|
c00372900f | ||
|
|
7f50503aec | ||
|
|
87a600349c | ||
|
|
114246bf1e | ||
|
|
ebda1349cf | ||
|
|
45a8aaf387 | ||
|
|
514933e0e4 | ||
|
|
6f914386ec | ||
|
|
efaede0929 | ||
|
|
73821cbe49 | ||
|
|
e245891cb4 | ||
|
|
50e604f412 | ||
|
|
4e74555b5d | ||
|
|
894c86ebc3 | ||
|
|
47ea12f4ba | ||
|
|
ce01c66b3e | ||
|
|
1260900668 | ||
|
|
a86ff19c98 | ||
|
|
c07bcf6a29 | ||
|
|
82f6d26a88 | ||
|
|
d1e8f5cf5c | ||
|
|
82edaf05d3 | ||
|
|
fadc514592 | ||
|
|
fc7ca56f8b | ||
|
|
d629061506 | ||
|
|
4a964ab6be | ||
|
|
53957c24df | ||
|
|
addff1118c | ||
|
|
6a1d106fea | ||
|
|
07f88cc4d1 | ||
|
|
5f35553438 | ||
|
|
802e2afcc0 | ||
|
|
ee09b41e08 | ||
|
|
994bd72409 | ||
|
|
01eaba6697 | ||
|
|
d4d69522f5 | ||
|
|
dd88d64d67 | ||
|
|
0ecaa4d36c | ||
|
|
e9e8ef964c | ||
|
|
c2360528ee | ||
|
|
3221fba02c | ||
|
|
c1b74f481a | ||
|
|
e2c0dc7e92 | ||
|
|
df510c40f4 | ||
|
|
48db3c8ce4 | ||
|
|
9d029b46b1 | ||
|
|
d2af4f7d9c | ||
|
|
3dd539b4f0 | ||
|
|
1daafd15e6 | ||
|
|
8fd424814a | ||
|
|
4d8c3eadbc | ||
|
|
92722d491f | ||
|
|
c560d17bdd | ||
|
|
55dff65142 | ||
|
|
cdec6fad99 | ||
|
|
216dac068d | ||
|
|
f9ec79c8eb | ||
|
|
112ab91e34 | ||
|
|
59b0ac127f | ||
|
|
e03b3227d4 | ||
|
|
f08a66924c | ||
|
|
535b75225b | ||
|
|
b99c44667e | ||
|
|
c6d50b7d6e | ||
|
|
03f12bfca1 | ||
|
|
78a8c105f4 | ||
|
|
878d9d7148 | ||
|
|
cb77987129 | ||
|
|
37ec3d41d9 | ||
|
|
6ececbb81a | ||
|
|
a67c28a4c9 | ||
|
|
c3a0176c88 | ||
|
|
e7de57fc7a | ||
|
|
d928df9c69 | ||
|
|
b18bb200a9 | ||
|
|
225011f2c1 | ||
|
|
024edc500f | ||
|
|
42d59d21a6 | ||
|
|
4795571629 | ||
|
|
df587892a3 | ||
|
|
57a1f71fdd | ||
|
|
1ffcdc92f2 | ||
|
|
bd043c2358 | ||
|
|
fbd0a6ddda | ||
|
|
e7aceb6a8b | ||
|
|
fd745c5f62 | ||
|
|
41628ca17f | ||
|
|
21fbbf154d | ||
|
|
66c4aefc1e | ||
|
|
5d5c95fb2c | ||
|
|
13305d9ee1 | ||
|
|
4a9638767d | ||
|
|
55cd0d5000 | ||
|
|
1da15cfde3 | ||
|
|
9df0ee9a1c | ||
|
|
8baeafbdc2 | ||
|
|
aacddb251d | ||
|
|
1240e0f768 | ||
|
|
cdbd2979d2 | ||
|
|
da493d07c0 | ||
|
|
bccb1d2805 | ||
|
|
d84787b041 | ||
|
|
f1d6252d8b | ||
|
|
38a7a50d1c | ||
|
|
3ca181fce4 | ||
|
|
9eeb01b746 | ||
|
|
9ef9a0f1fb | ||
|
|
599b5318fc | ||
|
|
75df133071 | ||
|
|
403b39659c | ||
|
|
8d357ee282 | ||
|
|
96ad687944 | ||
|
|
79040adf1a | ||
|
|
cbcc81d42e | ||
|
|
732386b83a | ||
|
|
4065022866 | ||
|
|
6c1d949cef | ||
|
|
c4293bba6b | ||
|
|
0a1008f64f | ||
|
|
a5cb2a9f00 | ||
|
|
4a6c0db4fa | ||
|
|
f31ec9a154 | ||
|
|
b4ad4becd3 | ||
|
|
554807968a | ||
|
|
5cecb24654 | ||
|
|
5911538e29 | ||
|
|
0ccd812398 | ||
|
|
9c693cd7ed | ||
|
|
fbcd8396db | ||
|
|
b1be2eee06 | ||
|
|
bca26721ff | ||
|
|
301e874cd4 | ||
|
|
2ff66970ad | ||
|
|
58142664cc | ||
|
|
73f6a68b9d | ||
|
|
b88f4bc77f | ||
|
|
e3c2220a1c | ||
|
|
26238e731d | ||
|
|
717db2f906 | ||
|
|
1c59a27902 | ||
|
|
6ce52a1da9 | ||
|
|
f2a0e42810 | ||
|
|
63f2f85c25 | ||
|
|
80375d1f5b | ||
|
|
20ac2ad847 | ||
|
|
3b5fc7e13c | ||
|
|
73a12aedeb | ||
|
|
2ce6592048 | ||
|
|
a588aec978 | ||
|
|
8b124f3194 | ||
|
|
588ac62b6f | ||
|
|
63001d83b9 | ||
|
|
1112415f93 | ||
|
|
4633a1c136 | ||
|
|
8991e1dbad | ||
|
|
d5f6f7b37c | ||
|
|
4ffec21cd3 | ||
|
|
9d34c2a2e6 | ||
|
|
4f12caa05f | ||
|
|
649ba71c0f | ||
|
|
af5a9b31bc | ||
|
|
b72304203c | ||
|
|
f70d250995 | ||
|
|
a4d07a4611 | ||
|
|
91b1b1dfc2 | ||
|
|
53937d1723 | ||
|
|
46626e9a63 | ||
|
|
b5626c13b1 | ||
|
|
84de420002 | ||
|
|
99f939026f | ||
|
|
ad973dd51a | ||
|
|
9da485da55 | ||
|
|
da922601cd | ||
|
|
8322307ae0 | ||
|
|
58977810f9 | ||
|
|
05facc6961 | ||
|
|
f8db54136e | ||
|
|
ce972ceddd | ||
|
|
9ad61c1e23 | ||
|
|
1c4128b9a1 | ||
|
|
2c4a2f7dd9 | ||
|
|
9befaf7c91 | ||
|
|
ab34b31219 | ||
|
|
b9b56f5e73 | ||
|
|
d28312f13b | ||
|
|
9134464a39 | ||
|
|
ff5d40dcd3 | ||
|
|
9a284bc740 | ||
|
|
d67573f83a | ||
|
|
c97a388fc4 | ||
|
|
370b58d500 | ||
|
|
dbffdedc92 | ||
|
|
712b1811b3 | ||
|
|
f2fa598ed7 | ||
|
|
5283c50f84 | ||
|
|
ee7dbd5208 | ||
|
|
821298b6d0 | ||
|
|
dc6cde86c9 | ||
|
|
1826122381 | ||
|
|
fbf35edae2 | ||
|
|
70934e05e1 | ||
|
|
b235dddbe0 | ||
|
|
fc45cef834 | ||
|
|
a43de00153 | ||
|
|
949144ab25 | ||
|
|
68e75025be | ||
|
|
77e5bebf13 | ||
|
|
2a72d10bfc | ||
|
|
5aa5732606 | ||
|
|
3209459e6d | ||
|
|
0bc0cb7f82 | ||
|
|
4e9d2a5e18 | ||
|
|
915df1c731 | ||
|
|
7eb193cbbb | ||
|
|
b63c5fa1ff | ||
|
|
e4d0f2dc6f | ||
|
|
767cb46d40 | ||
|
|
c430a2d798 | ||
|
|
1c273210e9 | ||
|
|
db4e5e05a4 | ||
|
|
c6483c4b98 | ||
|
|
94c098cce3 | ||
|
|
6eddfd2694 | ||
|
|
cb15a3a1d6 | ||
|
|
cd516f80bb | ||
|
|
1d9b85c043 | ||
|
|
1ae5f64696 | ||
|
|
bf24e5f518 | ||
|
|
7115cd178c | ||
|
|
6da806c9c5 | ||
|
|
4895d76bea | ||
|
|
f527f9533e | ||
|
|
5adfcbf343 | ||
|
|
c0e0612e02 | ||
|
|
4ba4a753cb | ||
|
|
3cbd154c8a | ||
|
|
6ab936ef09 | ||
|
|
3383153b66 | ||
|
|
04b412dd5b | ||
|
|
ac20030612 | ||
|
|
083c5d1722 | ||
|
|
baec24ef14 | ||
|
|
df7f0b20f5 | ||
|
|
e5e3133869 | ||
|
|
ca6ef546e5 | ||
|
|
c24798ad2f | ||
|
|
3411eca1e7 | ||
|
|
43073069c7 | ||
|
|
db330ad035 | ||
|
|
b3c7273681 | ||
|
|
3892ac5996 | ||
|
|
249841c0db | ||
|
|
8900674b72 | ||
|
|
5ca882d3ea | ||
|
|
516ff6f8e6 | ||
|
|
dc9c481b80 | ||
|
|
5c55290944 | ||
|
|
86a145f01c | ||
|
|
78597a8554 | ||
|
|
0288ba6012 | ||
|
|
bada45ec69 | ||
|
|
ee407913c3 | ||
|
|
6e643d7579 | ||
|
|
b8c771f747 | ||
|
|
a07e1d8f3a | ||
|
|
565a78610e | ||
|
|
cdbf4cf5ec | ||
|
|
ec5c7e5d0e | ||
|
|
b583589849 | ||
|
|
c3144088ca | ||
|
|
7df3fe266e | ||
|
|
b351befa97 | ||
|
|
3925386109 | ||
|
|
cdf392e3e5 | ||
|
|
e51ca85e26 | ||
|
|
4ba11d832a | ||
|
|
66d78fed2c | ||
|
|
e8101f9410 | ||
|
|
56f1e9ed3a | ||
|
|
fff67906d6 | ||
|
|
343331c667 | ||
|
|
201d596c80 | ||
|
|
6f733394f7 | ||
|
|
b164b86eda | ||
|
|
eb97a1c11c | ||
|
|
13996d7770 | ||
|
|
6e04707457 | ||
|
|
25b17a221c | ||
|
|
de50bbb16f | ||
|
|
e835cb7f8c | ||
|
|
7fea0c9431 | ||
|
|
bcd045ae4e | ||
|
|
3f46db55b6 | ||
|
|
93e7b4f5cf | ||
|
|
a865028420 | ||
|
|
489637ec67 | ||
|
|
71ca7d153e | ||
|
|
0a37834fd8 | ||
|
|
0cc279b351 | ||
|
|
06baa10cdc | ||
|
|
c406102995 | ||
|
|
0dc3eda99f | ||
|
|
2dca9fc3f3 | ||
|
|
97cdd751b8 | ||
|
|
159472f82c | ||
|
|
be9eaa0859 | ||
|
|
35e330f574 | ||
|
|
e7a5cb4b1d | ||
|
|
c9c29da803 | ||
|
|
2527fe2e1e | ||
|
|
a4de0f2b5b | ||
|
|
401d0d58d5 | ||
|
|
441b3f1646 | ||
|
|
3b185e1bcb | ||
|
|
beed414429 | ||
|
|
99b2fdefcc | ||
|
|
9ec6a829c2 | ||
|
|
913f70b24d | ||
|
|
5a4d68684e | ||
|
|
096842de44 | ||
|
|
81e5b33bc9 | ||
|
|
5c91f29efb | ||
|
|
bfcb73f344 | ||
|
|
a2ca5eb8a4 | ||
|
|
f34e564ccd | ||
|
|
0cba428c81 | ||
|
|
423a433e16 | ||
|
|
bdee8f662c | ||
|
|
62bb550afd | ||
|
|
3562577521 | ||
|
|
8c7682c6d4 | ||
|
|
2b45a16872 | ||
|
|
73cc17ce72 | ||
|
|
07a2020303 | ||
|
|
0fc45ead6e | ||
|
|
6b37e2c973 | ||
|
|
cdabd83afe | ||
|
|
f610f525ba | ||
|
|
514f927a56 | ||
|
|
3c641606da | ||
|
|
af44d878d1 | ||
|
|
72ebafe925 | ||
|
|
134365c764 | ||
|
|
b6871c72ca | ||
|
|
aaece725aa | ||
|
|
ef6da6a96b | ||
|
|
df9daf9b4b | ||
|
|
228425fdb9 | ||
|
|
9775d1064e | ||
|
|
1a9591d411 | ||
|
|
64070a0798 | ||
|
|
bfa772609a | ||
|
|
d15acf89ba | ||
|
|
d25673b8fe | ||
|
|
dd9924a7a7 | ||
|
|
0f00b7237a | ||
|
|
579a13da44 | ||
|
|
7865219164 | ||
|
|
f2c84692a9 | ||
|
|
f61aeb8285 | ||
|
|
11d7f9d029 | ||
|
|
72633825cf | ||
|
|
9a137bb158 | ||
|
|
32944f4c9c | ||
|
|
23c6f2add5 | ||
|
|
e535f050c1 | ||
|
|
7a2feb9152 | ||
|
|
3b91ec8c06 | ||
|
|
636474610b | ||
|
|
6e524de320 | ||
|
|
3e916e42f2 | ||
|
|
de87c992d7 | ||
|
|
e5fb90f017 | ||
|
|
a3501b925d | ||
|
|
e47b0f3c44 | ||
|
|
518f7c9e03 | ||
|
|
91d57ded8a | ||
|
|
86fd1be8b2 | ||
|
|
e18deb5eeb | ||
|
|
a8fd7cf2e9 | ||
|
|
25182de365 | ||
|
|
c90efb8d0a | ||
|
|
7a521c655f | ||
|
|
8a9d2a032e | ||
|
|
b1b3ff2637 | ||
|
|
752f9e77f5 | ||
|
|
e52db0b2f5 | ||
|
|
ce9069af4a | ||
|
|
31d74730c5 | ||
|
|
84867c6e67 | ||
|
|
f7d7b3fe5e | ||
|
|
356c0c8be1 | ||
|
|
f957c42e26 | ||
|
|
ca311e5dec | ||
|
|
3ccd4ad2ca | ||
|
|
867fb30286 | ||
|
|
a8ab876053 | ||
|
|
dfc5627031 | ||
|
|
542542f48d | ||
|
|
5fda29e651 | ||
|
|
c25a07c95b | ||
|
|
aafc850dbd | ||
|
|
41ae8de99b | ||
|
|
808f070df4 | ||
|
|
e4cd66be5c | ||
|
|
a638e991af | ||
|
|
d67dbaa0ae | ||
|
|
be66ff1eec | ||
|
|
603a8acdfc | ||
|
|
86393d728f | ||
|
|
e564e051a3 | ||
|
|
2ade7dc632 | ||
|
|
a938845aa2 | ||
|
|
ba2205867e | ||
|
|
d7ec04f995 | ||
|
|
91baabd1b3 | ||
|
|
c3fdabd3a2 | ||
|
|
3d8c76209d | ||
|
|
c2038a6cf2 | ||
|
|
082ac233ad | ||
|
|
5d46fe7e4d | ||
|
|
32611e07c8 | ||
|
|
dd3316a1c2 | ||
|
|
1ebd54b282 | ||
|
|
e524197a4d | ||
|
|
f111c49cc6 | ||
|
|
c567ee2c08 | ||
|
|
1a0ac7bb35 | ||
|
|
34c69cf10f | ||
|
|
88125634d2 | ||
|
|
6049c9837c | ||
|
|
a76eef01de | ||
|
|
b3eb4f35cd | ||
|
|
6b6dacf94c | ||
|
|
f010f2fef2 | ||
|
|
a952f80ea4 | ||
|
|
6d34ae2960 | ||
|
|
d17ff000c7 | ||
|
|
6b3d3ecd93 | ||
|
|
32dc28f48d | ||
|
|
a210724312 | ||
|
|
1d69ed7584 | ||
|
|
43e864e47b | ||
|
|
fb538027f7 | ||
|
|
cbf7f7d320 | ||
|
|
200023234c | ||
|
|
fc99d6f0a6 | ||
|
|
e6b4ecdaf7 | ||
|
|
4111d670a7 | ||
|
|
397084a9ff | ||
|
|
968d633d46 | ||
|
|
96c3363edc | ||
|
|
a853ed9960 | ||
|
|
323a7060ec | ||
|
|
d0fa2510e5 | ||
|
|
8d57f641f7 | ||
|
|
055957567f | ||
|
|
5aff3f007e | ||
|
|
c34d86ba80 | ||
|
|
2038f36254 | ||
|
|
b1fc07a4cf | ||
|
|
a366420d65 | ||
|
|
8095b4852b | ||
|
|
cc3274f245 | ||
|
|
fbde9ce7bf | ||
|
|
130fc189ad | ||
|
|
a50e4fcc46 | ||
|
|
ae96ff244e | ||
|
|
1b0cdeedce | ||
|
|
992820ac42 | ||
|
|
c0ecc6a329 | ||
|
|
85131e6166 | ||
|
|
330983d9dd | ||
|
|
1bb7c4e825 | ||
|
|
450e1427a1 | ||
|
|
5614cec19d | ||
|
|
3f24a4b2c5 | ||
|
|
4e9e5735dc | ||
|
|
b1a6189c55 | ||
|
|
836504ee01 | ||
|
|
269565e959 | ||
|
|
e45027a66c | ||
|
|
2d3310d8e0 | ||
|
|
ade47bed8b | ||
|
|
ea12ec9cd1 | ||
|
|
3774e3bca0 | ||
|
|
77066f0389 | ||
|
|
5e0567ef4d | ||
|
|
b49de4b0fa | ||
|
|
372495a83a | ||
|
|
468a4644d6 | ||
|
|
3c31391ec9 | ||
|
|
29d0f102fd | ||
|
|
ebc7173c50 | ||
|
|
43f1ac78a6 | ||
|
|
9df54238d9 | ||
|
|
fcd934319d | ||
|
|
48ccc7ff06 | ||
|
|
edc48f0017 | ||
|
|
d489fdd700 | ||
|
|
d6b1e4465e | ||
|
|
5cbffcf3ac | ||
|
|
c91723516e | ||
|
|
a68f45d15a | ||
|
|
152a708ee8 | ||
|
|
a0ec13d2ed | ||
|
|
3313b7421f | ||
|
|
a76ee6b2fc | ||
|
|
0056b704d4 | ||
|
|
c1ead5fe27 | ||
|
|
85a89339a7 | ||
|
|
55f82c48bc | ||
|
|
f4761e099b | ||
|
|
be3696deba | ||
|
|
cd41e9e9be | ||
|
|
d6db30b7fc | ||
|
|
fd066c2150 | ||
|
|
f9ba95b3de | ||
|
|
7ee4d1d588 | ||
|
|
cef5842344 | ||
|
|
a7b6647135 | ||
|
|
bef17e53c6 | ||
|
|
d4b6099d6e | ||
|
|
ff60538e21 | ||
|
|
50c6133046 | ||
|
|
b7d7b80544 | ||
|
|
2b9342692d | ||
|
|
a24e247f1b | ||
|
|
3396056dae | ||
|
|
366d6c8971 | ||
|
|
14bf7ddf7a | ||
|
|
30cce09063 | ||
|
|
9a50ebfc47 | ||
|
|
0f05b60c20 | ||
|
|
4f8493d1bb | ||
|
|
58dd629956 | ||
|
|
936b746954 | ||
|
|
ef14bfac58 | ||
|
|
291f73b661 | ||
|
|
3d9dae0d52 | ||
|
|
017c37c4af | ||
|
|
ee0c852ddb | ||
|
|
d63627a37b | ||
|
|
b1c9e70f95 | ||
|
|
3ac2fd870f | ||
|
|
af7272cd10 | ||
|
|
d7c71f5d47 | ||
|
|
c858fc2859 | ||
|
|
f76f44e9f3 | ||
|
|
4fb07cc1d0 | ||
|
|
658a87cbc0 | ||
|
|
956fa7a8b7 | ||
|
|
0ebb992354 | ||
|
|
37f8253836 | ||
|
|
200ff5a1a4 | ||
|
|
0d44cbf74a | ||
|
|
bb216aa6ed | ||
|
|
eccf405ba8 | ||
|
|
9df87f61cd | ||
|
|
4186e19c65 | ||
|
|
57edc32a4b | ||
|
|
9cfa0748ac | ||
|
|
df859a2132 | ||
|
|
52257d60ac | ||
|
|
96ddb0bbff | ||
|
|
b529a28715 | ||
|
|
ea3a374ced | ||
|
|
2eacadf08f | ||
|
|
1a127bb1a6 | ||
|
|
edfa130939 | ||
|
|
7fbd89392a | ||
|
|
9f4b31979c | ||
|
|
9ecfc475e3 | ||
|
|
84dc93ac54 | ||
|
|
7532bcda08 | ||
|
|
08b5abc7ad | ||
|
|
38bf143704 | ||
|
|
a440ed3b37 | ||
|
|
39b7d9fdeb | ||
|
|
dfa728a486 | ||
|
|
7bd8ca5a55 | ||
|
|
627977ab51 | ||
|
|
e3b592977a | ||
|
|
622a734405 | ||
|
|
28404cd8bb | ||
|
|
be53dedb18 | ||
|
|
8ab6e26def | ||
|
|
b2a5a20650 | ||
|
|
57f930c83e | ||
|
|
b4dd65cf3e | ||
|
|
4a9b1df9b4 | ||
|
|
874bfb3305 | ||
|
|
ab9c925c47 | ||
|
|
d3b6bc1c93 | ||
|
|
cd7d25e4e1 | ||
|
|
1e5e9122ae | ||
|
|
506c7d31ca | ||
|
|
54cc5abf21 | ||
|
|
18e913d9ba | ||
|
|
180de97893 | ||
|
|
f198ff1773 | ||
|
|
55c13d1ad0 | ||
|
|
16505b30bf | ||
|
|
95b3f0a21c | ||
|
|
6adcfc52cd | ||
|
|
0a28fb60df | ||
|
|
2bab1464ee | ||
|
|
7875c2acaa | ||
|
|
49bf40484d | ||
|
|
07148f1e7f | ||
|
|
8a6ef788b3 | ||
|
|
d3e360b7c0 | ||
|
|
b1bba74c5a | ||
|
|
a954759012 | ||
|
|
90c1033437 | ||
|
|
191a065de1 | ||
|
|
cf91ae7627 | ||
|
|
0ba88d081a | ||
|
|
b6420b9a4b | ||
|
|
4f77dff6dd | ||
|
|
2b3e646213 | ||
|
|
e0e7478857 | ||
|
|
828d722be8 | ||
|
|
1ae55b34ee | ||
|
|
c9bc2341d1 | ||
|
|
eba98fec33 | ||
|
|
70af2b0df7 | ||
|
|
753b5c5339 | ||
|
|
9bb86b4ee4 | ||
|
|
2702193337 | ||
|
|
907196018b | ||
|
|
5eb2fef89c | ||
|
|
9403a1fce9 | ||
|
|
fd224d6781 | ||
|
|
f5776a0cb2 | ||
|
|
5b62419520 | ||
|
|
b9e5a47924 | ||
|
|
545c48266c | ||
|
|
61d1878494 | ||
|
|
4a95156e35 | ||
|
|
ab5f3488e7 | ||
|
|
510492e5e9 | ||
|
|
b375d3cb6c | ||
|
|
6ef57e735e | ||
|
|
f160aede3e | ||
|
|
ea8a4c01cb | ||
|
|
d963327ed4 | ||
|
|
bb96b0af1a | ||
|
|
34e3aa20ba | ||
|
|
5a846c36ab | ||
|
|
7bd6344359 | ||
|
|
b76e8df1bf | ||
|
|
5a0165282f | ||
|
|
597d9f2612 | ||
|
|
4d9c2898bf | ||
|
|
1854a21a50 | ||
|
|
0e4e7525e1 | ||
|
|
5259df2828 | ||
|
|
a5b5da6d27 | ||
|
|
b2cf4b8aa5 | ||
|
|
0d874f9ad1 | ||
|
|
019b8e93b4 | ||
|
|
b29fa2467a | ||
|
|
8b17cbfbc8 | ||
|
|
a445509d75 | ||
|
|
5a8eac21a3 | ||
|
|
45480a0216 | ||
|
|
97f72f6df5 | ||
|
|
466b2ac706 | ||
|
|
0d4f24ade9 | ||
|
|
2f2800c360 | ||
|
|
459d55c31a | ||
|
|
7e98d29de0 | ||
|
|
6bd51ff0d5 | ||
|
|
6500e6d467 | ||
|
|
abcce8879f | ||
|
|
e30040c9fd | ||
|
|
6bbfb8e837 | ||
|
|
2ec203a3a2 | ||
|
|
4df22d2063 | ||
|
|
bf16246825 | ||
|
|
0eed01811c | ||
|
|
96b3d5637a | ||
|
|
4a09cbcec9 | ||
|
|
964493d701 | ||
|
|
f1b9c788f3 | ||
|
|
a50f89db67 | ||
|
|
0d94ffe27a | ||
|
|
dc4c4c7353 | ||
|
|
8d4e0a259e | ||
|
|
91f87b02cc | ||
|
|
870e333605 | ||
|
|
7ea3103c25 | ||
|
|
3aa60ac669 | ||
|
|
81612cc32a | ||
|
|
d3caee328f | ||
|
|
d5af6127e5 | ||
|
|
5eb5fb3310 | ||
|
|
8605bab4d4 | ||
|
|
1540c9463a | ||
|
|
130105ca9f | ||
|
|
7eb3ad98fa | ||
|
|
cb225eabb3 | ||
|
|
72245d8ebe | ||
|
|
96505e4421 | ||
|
|
fbb1750528 | ||
|
|
dad63b6d77 | ||
|
|
14e69b1e59 | ||
|
|
883917d5d6 | ||
|
|
deeccc85a3 | ||
|
|
cfa57a70dc | ||
|
|
e6dfb1e90a | ||
|
|
e03d3278a0 | ||
|
|
eae4bb75e5 | ||
|
|
e6dead2e27 | ||
|
|
59b854b00d | ||
|
|
675533a732 | ||
|
|
7751a2e072 | ||
|
|
b4bbc82ba1 | ||
|
|
a0a0ec9b1f | ||
|
|
26285cfc95 | ||
|
|
6799e71f1a | ||
|
|
8806c941a8 | ||
|
|
78cbed516a | ||
|
|
2281fae615 | ||
|
|
1192a0658a | ||
|
|
7f2ac25455 | ||
|
|
62a696cc4b | ||
|
|
11716f7f94 | ||
|
|
180166156a | ||
|
|
3c8bab92b5 | ||
|
|
cf361593a4 | ||
|
|
8ad639a122 | ||
|
|
a7cd445cef | ||
|
|
380d74b333 | ||
|
|
eade4f0ebd | ||
|
|
08be50caf2 | ||
|
|
6a5c86b84f | ||
|
|
1fb5bbc36e | ||
|
|
d6edb57a10 | ||
|
|
d3fdf9854d | ||
|
|
3217980ada | ||
|
|
29b5a7433d | ||
|
|
5bca2d723e | ||
|
|
d2a52e26b2 | ||
|
|
8a4fe1627e | ||
|
|
a9fb55fedd | ||
|
|
04c30e70af | ||
|
|
c0210895e9 | ||
|
|
fe9917e620 | ||
|
|
a3dfa3b5ba | ||
|
|
34243b7b71 | ||
|
|
9fd81e8acd | ||
|
|
bbc4ef8146 | ||
|
|
7fe7056c12 | ||
|
|
ab32a3afb0 | ||
|
|
ea3e5e273f | ||
|
|
6849478226 | ||
|
|
b6c5183d40 | ||
|
|
e5d65b97ce | ||
|
|
6cda47be9f | ||
|
|
a0ef1a3d9b | ||
|
|
ba47420577 | ||
|
|
806f17545f | ||
|
|
f0f5b4c04c | ||
|
|
ad76104033 | ||
|
|
c6e481efcf | ||
|
|
2ad0c00c17 | ||
|
|
26ab7d5e6f | ||
|
|
832e7e6637 | ||
|
|
8c7972ed78 | ||
|
|
05bbc14965 | ||
|
|
e7feee6878 | ||
|
|
791ddcb9a1 | ||
|
|
12d5a21982 | ||
|
|
7493b92d83 | ||
|
|
e7c79e58b4 | ||
|
|
0dbdbf7cfe | ||
|
|
f39ca66dbf | ||
|
|
8d80494b8d | ||
|
|
058768baab | ||
|
|
cfee6fdcd0 | ||
|
|
34c95bea5d | ||
|
|
50911c7fc8 | ||
|
|
4e1f0f9cc6 | ||
|
|
2b1abfc9b2 | ||
|
|
595c139ca8 | ||
|
|
6637feb3a6 | ||
|
|
928246a8ca | ||
|
|
fd3e0bbebf | ||
|
|
2a0a572b76 | ||
|
|
a314cd7cfd | ||
|
|
cd28375019 | ||
|
|
7cf4134a73 | ||
|
|
44c76f0b98 | ||
|
|
69a122a271 | ||
|
|
0c0eb327f7 | ||
|
|
74ce79ba8f | ||
|
|
1dc15936ed | ||
|
|
126fa7be29 | ||
|
|
d61251e9b3 | ||
|
|
f9f53a13c0 | ||
|
|
b4360d44f1 | ||
|
|
574d575cad | ||
|
|
5e10339c20 | ||
|
|
feb83cf737 | ||
|
|
0ff4aec400 | ||
|
|
e2944f6be7 | ||
|
|
3e842f30f1 | ||
|
|
481619101b | ||
|
|
2ac66d87af | ||
|
|
e818ce62c8 | ||
|
|
49851d1131 | ||
|
|
a8061c9276 | ||
|
|
4036ac8cd2 | ||
|
|
57bbbfcc3b | ||
|
|
68f769aac2 | ||
|
|
ef9bd3edc8 | ||
|
|
45f88a92dc | ||
|
|
02c8b46b74 | ||
|
|
32068e8d8e | ||
|
|
ccd8ee87f3 | ||
|
|
c73b446482 | ||
|
|
699276ca58 | ||
|
|
3187bab90a | ||
|
|
c1dfd676e1 | ||
|
|
c7554ec400 | ||
|
|
f1771a61d0 | ||
|
|
d3cb968c19 | ||
|
|
9c685263bb | ||
|
|
d43db40469 | ||
|
|
a50471c0a6 | ||
|
|
8d215f7d7f | ||
|
|
eb9b034d65 | ||
|
|
c52fecead3 | ||
|
|
5b09cf7c4d | ||
|
|
9be9a21b22 | ||
|
|
3e4b748952 | ||
|
|
9fe91472cf | ||
|
|
a06810c7c8 | ||
|
|
160de64135 | ||
|
|
2b5535c5d1 | ||
|
|
1e9f911385 | ||
|
|
2a9a4fbdff | ||
|
|
7331c158b6 | ||
|
|
ddcbbb7fcf | ||
|
|
e7ac1597bb | ||
|
|
11e8ea4fe8 | ||
|
|
1853500729 | ||
|
|
a349626923 | ||
|
|
f466f9cc49 | ||
|
|
13b452223d | ||
|
|
c166fa6bf5 | ||
|
|
3a7e343f1c | ||
|
|
02557701f0 | ||
|
|
30755fbb73 | ||
|
|
c1b3491933 | ||
|
|
5467a58b04 | ||
|
|
75f07afcb7 | ||
|
|
c64838f7f5 | ||
|
|
a0359b8bd9 | ||
|
|
e2434619b5 | ||
|
|
becb3d4bb6 | ||
|
|
44fb4a558c | ||
|
|
9a574cb31b | ||
|
|
4fa4640991 | ||
|
|
35b5002eca | ||
|
|
b5574ca535 | ||
|
|
8fec03bcbf | ||
|
|
7de90cc2d8 | ||
|
|
c700d9b661 | ||
|
|
48f264851d | ||
|
|
467d244bea | ||
|
|
840c041f8c | ||
|
|
c30190f63e | ||
|
|
6e54d6788c | ||
|
|
68f45706ab | ||
|
|
43ee031121 | ||
|
|
533c86de16 | ||
|
|
ba3c9b87b5 | ||
|
|
8338b6adb3 | ||
|
|
54c950f951 | ||
|
|
d1c18d9642 | ||
|
|
19090e7353 | ||
|
|
1d52382460 | ||
|
|
a074199219 | ||
|
|
c1179ddb40 | ||
|
|
ef06a1ccb1 | ||
|
|
e31f3cb46e | ||
|
|
9f9cd29a7f | ||
|
|
ed24ef2615 | ||
|
|
c5b78c20e5 | ||
|
|
f98f6a120b | ||
|
|
6192343add | ||
|
|
6728aba0a5 | ||
|
|
64b75303af | ||
|
|
0eef1ee480 | ||
|
|
fef087ae46 | ||
|
|
0e15adecf2 | ||
|
|
be6addf4d0 | ||
|
|
052e9b68b5 | ||
|
|
fd91f56e55 | ||
|
|
a0a35d60ec | ||
|
|
639f3d27b4 | ||
|
|
e3040854d8 | ||
|
|
4597fd27da | ||
|
|
88bceae6b0 | ||
|
|
9ace9815b6 | ||
|
|
bfda7014db | ||
|
|
5107d383e0 | ||
|
|
32ba3fa516 | ||
|
|
69723d1bd0 | ||
|
|
5a5ab846c2 | ||
|
|
394381c736 | ||
|
|
fea1a28760 | ||
|
|
f895e82c69 | ||
|
|
710d15a66c | ||
|
|
d81a51bd8c | ||
|
|
3ac733a30c | ||
|
|
7a715fc471 | ||
|
|
b9b72ebf40 | ||
|
|
071dfaf656 | ||
|
|
88384a2fd8 | ||
|
|
a2c0049488 | ||
|
|
60288204fc | ||
|
|
7d0f65c1f3 | ||
|
|
a35b9b5d3f | ||
|
|
2a2842100a | ||
|
|
faed0ce159 | ||
|
|
23a6849fe3 | ||
|
|
91c6e91023 | ||
|
|
8f64c91677 | ||
|
|
842ee3d426 | ||
|
|
45d338ba3d | ||
|
|
f141fac3a2 | ||
|
|
7b2a89d66b | ||
|
|
4d158d99fd | ||
|
|
c3983a26c5 | ||
|
|
016854a292 | ||
|
|
5d7252cbec | ||
|
|
0e0bcf51fc | ||
|
|
f396077cd6 | ||
|
|
1c194b67f3 | ||
|
|
72e77d2264 | ||
|
|
10c79ac812 | ||
|
|
fe8c3a4957 | ||
|
|
3734be21d6 | ||
|
|
8ae6ad879e | ||
|
|
92b2a35888 | ||
|
|
fb2e6e5c17 | ||
|
|
2212311a44 | ||
|
|
ef3791f845 | ||
|
|
6e2878194c | ||
|
|
e7780485f1 | ||
|
|
7831999563 | ||
|
|
7020f4bda9 | ||
|
|
dcd21bd165 | ||
|
|
4a70028762 | ||
|
|
9255a9e638 | ||
|
|
02736ac92d | ||
|
|
2df01c7157 | ||
|
|
01a0745b9b | ||
|
|
c7573ad4c3 | ||
|
|
06f402bb9d | ||
|
|
b9f0812b38 | ||
|
|
cdca8fe236 | ||
|
|
c8175d1191 | ||
|
|
7a7a0f1eff | ||
|
|
5176fe0366 | ||
|
|
b4bd6e7acd | ||
|
|
bd4dbf45af | ||
|
|
d9fc3d436b | ||
|
|
67143cbc0e | ||
|
|
ed3b2eb1bf | ||
|
|
7a5e4291a5 | ||
|
|
d1c6810e1e | ||
|
|
faa9c0a2b9 | ||
|
|
0456973093 | ||
|
|
4a79a4e4d9 | ||
|
|
ac46d33a60 | ||
|
|
0f958bef81 | ||
|
|
b79009517e | ||
|
|
12ccc96f46 | ||
|
|
47828c38d2 | ||
|
|
afdae6a3d6 | ||
|
|
03d1d8f5a4 | ||
|
|
cc4e4c0f13 | ||
|
|
2f6f14fef2 | ||
|
|
fb590ddfdd | ||
|
|
a5e674cdc4 | ||
|
|
e28883dd47 | ||
|
|
b4694dcf03 | ||
|
|
4c05d9a687 | ||
|
|
53da2f9bb2 | ||
|
|
ea106b6064 | ||
|
|
32f671b4f2 | ||
|
|
25e298ff69 | ||
|
|
45006fe043 | ||
|
|
3e1c561752 | ||
|
|
be4b78ee1c | ||
|
|
5a2989cae4 | ||
|
|
15519fd783 | ||
|
|
a357a5b845 | ||
|
|
806b8f135b | ||
|
|
f2b636bd44 | ||
|
|
0d25eca6e5 | ||
|
|
e5dcac43dc | ||
|
|
8629710223 | ||
|
|
111e2cc0de | ||
|
|
8eb0b942c8 | ||
|
|
4c55827aa4 | ||
|
|
0a1be7d966 | ||
|
|
8f3370307a | ||
|
|
dd1545c7e1 | ||
|
|
8ea9bee810 | ||
|
|
6141356754 | ||
|
|
e70ea67fec | ||
|
|
62be4c5bce | ||
|
|
394a9540b0 | ||
|
|
62d22f0e74 | ||
|
|
1cd7b9a250 | ||
|
|
7044534765 | ||
|
|
9c3b50d622 | ||
|
|
fd62c254a4 | ||
|
|
90e54c6334 | ||
|
|
f423c67979 | ||
|
|
4607dd788c | ||
|
|
f9c595473f | ||
|
|
de6c843e1c | ||
|
|
b45924aa52 | ||
|
|
d04ea5b061 | ||
|
|
7406210c4a | ||
|
|
c24986fba3 | ||
|
|
30c1c00b9b | ||
|
|
655d658a52 | ||
|
|
a089c4cbc2 | ||
|
|
62fd545d24 | ||
|
|
4041ecddc4 | ||
|
|
10f51b41b7 | ||
|
|
7cf0a35a7a | ||
|
|
523f7793b5 | ||
|
|
9891aecf19 | ||
|
|
fd700f73e5 | ||
|
|
d71b05095d | ||
|
|
d061a13b58 | ||
|
|
5176cc3b06 | ||
|
|
1e364913cd | ||
|
|
1adc7c77ac | ||
|
|
51fbcce803 | ||
|
|
80dab63119 | ||
|
|
8c769f152b | ||
|
|
3673391f5a | ||
|
|
f96a2e72f7 | ||
|
|
19929ef3ba | ||
|
|
e3a3d287bf | ||
|
|
b2b92b00f3 | ||
|
|
6bd2c19b21 | ||
|
|
eb8e5c5135 | ||
|
|
5a07be40f1 | ||
|
|
13a15a38c5 | ||
|
|
caa10614d9 | ||
|
|
0943b4b097 | ||
|
|
8823baaef4 | ||
|
|
5a5e77414a | ||
|
|
f524591327 | ||
|
|
55ae7c39a4 | ||
|
|
d4e5f8d165 | ||
|
|
b9dad60b61 | ||
|
|
57b9b916ed | ||
|
|
854476db76 | ||
|
|
941c57b4a8 | ||
|
|
fb1c5a760f | ||
|
|
e5367127ea | ||
|
|
ffebd3f311 | ||
|
|
d8fcbd4032 | ||
|
|
583f416373 | ||
|
|
f605b37a1e | ||
|
|
a1d64acff4 | ||
|
|
1fe42f6a79 | ||
|
|
3ce5f69225 | ||
|
|
985107c601 | ||
|
|
d416124081 | ||
|
|
3a62a6c40d | ||
|
|
8f6f55b001 | ||
|
|
6d1ae39bc6 | ||
|
|
850197faa1 | ||
|
|
1aa206bc82 | ||
|
|
5a9cdb67f9 | ||
|
|
c9810cd019 | ||
|
|
8bf75e38ad | ||
|
|
fe9139ae93 | ||
|
|
87a354a314 | ||
|
|
270ac99a1e | ||
|
|
dc5d6a4ef8 | ||
|
|
4cdb36de09 | ||
|
|
7fce1d00d7 | ||
|
|
26c27153f0 | ||
|
|
b5420e9c6a | ||
|
|
cfd82a6ad4 | ||
|
|
7a352b49a0 | ||
|
|
8a4f3b7642 | ||
|
|
a09d4139d5 | ||
|
|
a257ac87f7 | ||
|
|
1669a5434c | ||
|
|
2fc83aa61c | ||
|
|
ed6f00a893 | ||
|
|
b15f9766c1 | ||
|
|
0ad4f07591 | ||
|
|
4704c5a1b0 | ||
|
|
034a9bc3c3 | ||
|
|
e7dc9db75a | ||
|
|
4a2d1b7997 | ||
|
|
a5e2a32fb8 | ||
|
|
43f69bb184 | ||
|
|
71482c2359 | ||
|
|
84a27a60a5 | ||
|
|
87f865ce1f | ||
|
|
12c78b41af | ||
|
|
c3db808b7c | ||
|
|
af9a9c5698 | ||
|
|
a7e6d3e969 | ||
|
|
708425c67a | ||
|
|
021de1af80 | ||
|
|
b66e98f697 | ||
|
|
28ad32aad5 | ||
|
|
94dc3117bc | ||
|
|
803ada4b27 | ||
|
|
e7118f637c | ||
|
|
e11e368c4b | ||
|
|
27a9051822 | ||
|
|
54caece5b3 | ||
|
|
b1fade5d3b | ||
|
|
8ed485df0e | ||
|
|
9c33947a45 | ||
|
|
33dc06055c | ||
|
|
8ff4a99cf3 | ||
|
|
d38abec819 | ||
|
|
0ba48aa230 | ||
|
|
acf47ad7a6 | ||
|
|
c948c62cac | ||
|
|
eee4dbf66c | ||
|
|
653b995774 | ||
|
|
a78151c5aa | ||
|
|
3177713447 | ||
|
|
0769df1e55 | ||
|
|
0cfa7cb28f | ||
|
|
1e621ee133 | ||
|
|
a203799bd2 | ||
|
|
8fc9724204 | ||
|
|
0d41cb96ab | ||
|
|
39b2f87194 | ||
|
|
1161037092 | ||
|
|
a3d9d5cca8 | ||
|
|
4b67411ca6 | ||
|
|
126b807dc7 | ||
|
|
ca81d2d602 | ||
|
|
015c195c9f | ||
|
|
5fd170d480 | ||
|
|
4b167ba9de | ||
|
|
38ac41bccb | ||
|
|
3315d27d45 | ||
|
|
c3dcdb0686 | ||
|
|
ca91f6bd92 | ||
|
|
65483309ab | ||
|
|
71d33f3429 | ||
|
|
9b1c543eb7 | ||
|
|
24bb0ff39a | ||
|
|
3ae312db37 | ||
|
|
94f73241ea | ||
|
|
d4632b9059 | ||
|
|
dd15d52130 | ||
|
|
145f252ca6 | ||
|
|
731b54a1f7 | ||
|
|
f8d7b68289 | ||
|
|
80e47d5157 | ||
|
|
c1653c5f2e | ||
|
|
36ad31ab25 | ||
|
|
6f1872fb94 | ||
|
|
ff56e70b81 | ||
|
|
201263237f | ||
|
|
1ddd37f381 | ||
|
|
f9d2a78c5e | ||
|
|
443c917c6b | ||
|
|
7c787cd13b | ||
|
|
dc8aff6b6c | ||
|
|
397040549f | ||
|
|
0b858d6e94 | ||
|
|
6c8efcda12 | ||
|
|
3fa0aa9242 | ||
|
|
18775286c0 | ||
|
|
57433efe80 | ||
|
|
c42748a5dd | ||
|
|
b5cf835959 | ||
|
|
48b45b5f51 | ||
|
|
7d658c3f3d | ||
|
|
91980c9f2c | ||
|
|
db1c80c7e3 | ||
|
|
e53bd70c2c | ||
|
|
fe64e2e24c | ||
|
|
a020ca9a71 | ||
|
|
7a9fde822c | ||
|
|
152af02336 | ||
|
|
be7d3a921a | ||
|
|
78acb205d3 | ||
|
|
627dac692c | ||
|
|
68a6a828d8 | ||
|
|
e8604788df | ||
|
|
d36bf41ecf | ||
|
|
821d9ea330 | ||
|
|
65eb0fac3d | ||
|
|
e9a0c5456e | ||
|
|
e2d33beb34 | ||
|
|
b44c8461d4 | ||
|
|
38cc13ff2c | ||
|
|
53a46dcec6 | ||
|
|
c01e506eb1 | ||
|
|
ad61795e80 | ||
|
|
bd802ab926 | ||
|
|
a25a1c0415 | ||
|
|
969952cccc | ||
|
|
d85f8c0744 | ||
|
|
cf60bbc904 | ||
|
|
9c67e7dd93 | ||
|
|
df81a146d2 | ||
|
|
9bfb697f1e | ||
|
|
2e227cdbd5 | ||
|
|
fb7c227a10 | ||
|
|
e3742c0420 | ||
|
|
373ccbcee5 | ||
|
|
785060f12b | ||
|
|
4e509bbaee | ||
|
|
02d4ac81dd | ||
|
|
7e305aab67 | ||
|
|
55eed0d029 | ||
|
|
c7d5f2533a | ||
|
|
a6cfbcb331 | ||
|
|
45074952fd | ||
|
|
a73d9abc60 | ||
|
|
9fc31d6a55 | ||
|
|
9cb99a1170 | ||
|
|
f3f1d022ef | ||
|
|
253ebdc4e1 | ||
|
|
5d45f1d3f3 | ||
|
|
e253af9763 | ||
|
|
a355a82f8a | ||
|
|
ceb7eb15c3 | ||
|
|
115b154f0b | ||
|
|
2d1344b785 | ||
|
|
bdf793072c | ||
|
|
2f879d39f3 | ||
|
|
f0775af439 | ||
|
|
96048b5133 | ||
|
|
36ab224853 | ||
|
|
52d19b8de4 | ||
|
|
7be5ec844f | ||
|
|
3d26a31ee2 | ||
|
|
343d605a84 | ||
|
|
ef1228eb32 | ||
|
|
ad738f7e7c | ||
|
|
4a66fa0138 | ||
|
|
331338e7b9 | ||
|
|
8e28925336 | ||
|
|
df0e829dbe | ||
|
|
0c278b668c | ||
|
|
6e7ba714a8 | ||
|
|
d8e2e3ace1 | ||
|
|
69c3dd188e | ||
|
|
57da36f1cf | ||
|
|
753ba00ac0 | ||
|
|
290f7d116f | ||
|
|
81fa88a36d | ||
|
|
0dd98330aa | ||
|
|
ae55a2c1d2 | ||
|
|
43ae593568 | ||
|
|
81963a6a7d | ||
|
|
fbf67c134b | ||
|
|
a0cfe05eb5 | ||
|
|
ba6e8d7ad1 | ||
|
|
cbd2ed603f | ||
|
|
a2f1623b00 | ||
|
|
87ebcf0818 | ||
|
|
f329c9956e | ||
|
|
2ac62ece06 | ||
|
|
f9db5eb201 | ||
|
|
0a10f2d72a | ||
|
|
4325ccab8a | ||
|
|
04c6fad531 | ||
|
|
ca92285ff3 | ||
|
|
96eee3a173 | ||
|
|
a74c3c9b3d | ||
|
|
b4373cb0c5 | ||
|
|
9029c04ce6 | ||
|
|
c7c0c49218 | ||
|
|
191dd1c71b | ||
|
|
3b64373393 | ||
|
|
0f6c67e852 | ||
|
|
209297769f | ||
|
|
2d4e3a6ddf | ||
|
|
350f4c9f89 | ||
|
|
9c9a6b69fe | ||
|
|
2b9d85a4bc | ||
|
|
f053e45671 | ||
|
|
4d701f561e | ||
|
|
3cb6d03487 | ||
|
|
7dbe6dbe2d | ||
|
|
81f122467a | ||
|
|
20759d205c | ||
|
|
b37aea40a7 | ||
|
|
f95e864119 | ||
|
|
7a9de8cd99 | ||
|
|
dde8b1f802 | ||
|
|
ca34d7cced | ||
|
|
938e2a871d | ||
|
|
89b756d760 | ||
|
|
3b1edd3283 | ||
|
|
5369b17ebf | ||
|
|
2fadaa890b | ||
|
|
31bdb75c51 | ||
|
|
0124f63d9a | ||
|
|
95dba166eb | ||
|
|
83adadd71f | ||
|
|
4baf65c0c7 | ||
|
|
72cdd3e104 | ||
|
|
febc2eee09 | ||
|
|
b302a0a6e5 | ||
|
|
1f6a14ee36 | ||
|
|
99a15af26e | ||
|
|
dff7a4d6ac | ||
|
|
3c8e6a61f2 | ||
|
|
fb997ab16d | ||
|
|
8fe5f43875 | ||
|
|
c8cfee3511 | ||
|
|
bf0b89f3b5 | ||
|
|
1d295c04e3 | ||
|
|
11ebde87c9 | ||
|
|
88c4de9820 | ||
|
|
09e0a0576c | ||
|
|
fc84c5dc94 | ||
|
|
687ebbc41b | ||
|
|
0abe953a70 | ||
|
|
2a8f3e4855 | ||
|
|
8cd36f3cbf | ||
|
|
5577e1976b | ||
|
|
4b27becb5f | ||
|
|
3c055b78d3 | ||
|
|
eb5ce91cb2 | ||
|
|
ef36dc5ba3 | ||
|
|
d9c710c5a1 | ||
|
|
c436e0e669 | ||
|
|
e80917e3d1 | ||
|
|
0d0ec42daf | ||
|
|
0e4cca6138 | ||
|
|
b701acb275 | ||
|
|
4eb61051c6 | ||
|
|
56aba37758 | ||
|
|
f432b08149 | ||
|
|
3e0b2fd09c | ||
|
|
c7b8d94e4f | ||
|
|
31a9b03436 | ||
|
|
f33f558006 | ||
|
|
bb4fe63a7c | ||
|
|
ccb9e085b2 | ||
|
|
702d249bad | ||
|
|
cc2835a341 | ||
|
|
d73c53cb10 | ||
|
|
73409a3324 | ||
|
|
24f770aa7b | ||
|
|
649b99d7bd | ||
|
|
a8b50032c4 | ||
|
|
d1d276ae68 | ||
|
|
6eafbb0a25 | ||
|
|
aedd7ce2de | ||
|
|
b0511ed856 | ||
|
|
d60b288e0e | ||
|
|
f7d5287087 | ||
|
|
6ed81e9bae | ||
|
|
1415de9573 | ||
|
|
73de795082 | ||
|
|
bb9760f79c | ||
|
|
53b8ca3940 | ||
|
|
8a9107c798 | ||
|
|
52f06bbd43 | ||
|
|
dc55dbdf36 | ||
|
|
d0ec17feba | ||
|
|
5b5fdd97d6 |
186
.appveyor.yml
Normal file
186
.appveyor.yml
Normal file
@@ -0,0 +1,186 @@
|
||||
environment:
|
||||
|
||||
global:
|
||||
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
|
||||
# /E:ON and /V:ON options are not enabled in the batch script intepreter
|
||||
# See: http://stackoverflow.com/a/13751649/163740
|
||||
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
|
||||
|
||||
matrix:
|
||||
|
||||
# Python 2.7.10 is the latest version and is not pre-installed.
|
||||
|
||||
- PYTHON: "C:\\Python27.10"
|
||||
PYTHON_VERSION: "2.7.10"
|
||||
PYTHON_ARCH: "32"
|
||||
|
||||
#- PYTHON: "C:\\Python27.10-x64"
|
||||
# PYTHON_VERSION: "2.7.10"
|
||||
# PYTHON_ARCH: "64"
|
||||
|
||||
# Pre-installed Python versions, which Appveyor may upgrade to
|
||||
# a later point release.
|
||||
# See: http://www.appveyor.com/docs/installed-software#python
|
||||
|
||||
#- PYTHON: "C:\\Python27"
|
||||
# PYTHON_VERSION: "2.7.x" # currently 2.7.9
|
||||
# PYTHON_ARCH: "32"
|
||||
|
||||
#- PYTHON: "C:\\Python27-x64"
|
||||
# PYTHON_VERSION: "2.7.x" # currently 2.7.9
|
||||
# PYTHON_ARCH: "64"
|
||||
|
||||
#- PYTHON: "C:\\Python33"
|
||||
# PYTHON_VERSION: "3.3.x" # currently 3.3.5
|
||||
# PYTHON_ARCH: "32"
|
||||
|
||||
#- PYTHON: "C:\\Python33-x64"
|
||||
# PYTHON_VERSION: "3.3.x" # currently 3.3.5
|
||||
# PYTHON_ARCH: "64"
|
||||
|
||||
#- PYTHON: "C:\\Python34"
|
||||
# PYTHON_VERSION: "3.4.x" # currently 3.4.3
|
||||
# PYTHON_ARCH: "32"
|
||||
|
||||
#- PYTHON: "C:\\Python34-x64"
|
||||
# PYTHON_VERSION: "3.4.x" # currently 3.4.3
|
||||
# PYTHON_ARCH: "64"
|
||||
|
||||
# Python versions not pre-installed
|
||||
|
||||
# Python 2.6.6 is the latest Python 2.6 with a Windows installer
|
||||
# See: https://github.com/ogrisel/python-appveyor-demo/issues/10
|
||||
|
||||
#- PYTHON: "C:\\Python266"
|
||||
# PYTHON_VERSION: "2.6.6"
|
||||
# PYTHON_ARCH: "32"
|
||||
|
||||
#- PYTHON: "C:\\Python266-x64"
|
||||
# PYTHON_VERSION: "2.6.6"
|
||||
# PYTHON_ARCH: "64"
|
||||
|
||||
#- PYTHON: "C:\\Python35"
|
||||
# PYTHON_VERSION: "3.5.0"
|
||||
# PYTHON_ARCH: "32"
|
||||
|
||||
#- PYTHON: "C:\\Python35-x64"
|
||||
# PYTHON_VERSION: "3.5.0"
|
||||
# PYTHON_ARCH: "64"
|
||||
|
||||
# Major and minor releases (i.e x.0.0 and x.y.0) prior to 3.3.0 use
|
||||
# a different naming scheme.
|
||||
|
||||
#- PYTHON: "C:\\Python270"
|
||||
# PYTHON_VERSION: "2.7.0"
|
||||
# PYTHON_ARCH: "32"
|
||||
|
||||
#- PYTHON: "C:\\Python270-x64"
|
||||
# PYTHON_VERSION: "2.7.0"
|
||||
# PYTHON_ARCH: "64"
|
||||
|
||||
install:
|
||||
# If there is a newer build queued for the same PR, cancel this one.
|
||||
# The AppVeyor 'rollout builds' option is supposed to serve the same
|
||||
# purpose but it is problematic because it tends to cancel builds pushed
|
||||
# directly to master instead of just PR builds (or the converse).
|
||||
# credits: JuliaLang developers.
|
||||
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
|
||||
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
|
||||
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
|
||||
throw "There are newer queued builds for this pull request, failing early." }
|
||||
|
||||
# Install wxPython
|
||||
- 'ECHO Downloading wxPython.'
|
||||
- "appveyor DownloadFile https://goo.gl/yvO8PB -FileName C:\\wxpython.exe"
|
||||
#- "appveyor DownloadFile https://goo.gl/Uj0jV3 -FileName C:\\wxpython64.exe"
|
||||
|
||||
- 'ECHO Install wxPython'
|
||||
- "C:\\wxpython.exe /SP- /VERYSILENT /NORESTART"
|
||||
#- "C:\\wxpython64.exe /SP- /VERYSILENT /NORESTART"
|
||||
|
||||
- ECHO "Filesystem root:"
|
||||
- ps: "ls \"C:/\""
|
||||
|
||||
- ECHO "Filesystem pyfa root:"
|
||||
- ps: "ls \"C:\\projects\\pyfa\\\""
|
||||
|
||||
- ECHO "Installed SDKs:"
|
||||
- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
|
||||
|
||||
# Install Python (from the official .msi of http://python.org) and pip when
|
||||
# not already installed.
|
||||
# - ps: if (-not(Test-Path($env:PYTHON))) { & appveyor\install.ps1 }
|
||||
|
||||
# Prepend newly installed Python to the PATH of this build (this cannot be
|
||||
# done from inside the powershell script as it would require to restart
|
||||
# the parent CMD process).
|
||||
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
|
||||
|
||||
# Check that we have the expected version and architecture for Python
|
||||
- "python --version"
|
||||
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
|
||||
|
||||
# Upgrade to the latest version of pip to avoid it displaying warnings
|
||||
# about it being out of date.
|
||||
- "pip install --disable-pip-version-check --user --upgrade pip"
|
||||
|
||||
# Install the build dependencies of the project. If some dependencies contain
|
||||
# compiled extensions and are not provided as pre-built wheel packages,
|
||||
# pip will build them from source using the MSVC compiler matching the
|
||||
# target Python version and architecture
|
||||
# C:\\projects\\eve-gnosis\\
|
||||
- ECHO "Install pip requirements:"
|
||||
- "pip install -r requirements.txt"
|
||||
- "pip install -r requirements_test.txt"
|
||||
- "pip install -r requirements_build_windows.txt"
|
||||
|
||||
build_script:
|
||||
# Build the compiled extension
|
||||
# - "python setup.py build"
|
||||
- ECHO "Build pyfa:"
|
||||
#- copy C:\projects\pyfa\dist_assets\win\pyfa.spec C:\projects\pyfa\pyfa.spec
|
||||
- "python C:\\projects\\pyfa\\setup.py build"
|
||||
|
||||
#- ECHO "Build pyfa (Debug):"
|
||||
#- copy C:\projects\pyfa\dist_assets\win\pyfa_debug.spec C:\projects\pyfa\pyfa_debug.spec
|
||||
#- "pyinstaller.exe --clean --noconfirm --windowed --upx-dir=C:\\projects\\pyfa\\scripts\\upx.exe C:\\projects\\pyfa\\pyfa_debug.spec"
|
||||
|
||||
build: on
|
||||
|
||||
after_build:
|
||||
- ps: "ls \"./\""
|
||||
#- ps: "ls \"C:\\projects\\pyfa\\build\\pyfa\\\""
|
||||
- ps: "ls \"C:\\projects\\pyfa\\build\\\""
|
||||
- ps: "ls \"C:\\projects\\pyfa\\build\\exe.win32-2.7\\\""
|
||||
# Zip
|
||||
# APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER
|
||||
#- 7z a build.zip -r C:\projects\pyfa\build\pyfa\*.*
|
||||
- 7z a pyfa.zip -r C:\projects\pyfa\build\exe.win32-2.7\*.*
|
||||
#- 7z a pyfa_debug.zip -r C:\projects\pyfa\dist\pyfa_debug\*.*
|
||||
|
||||
on_success:
|
||||
# Do nothing right now
|
||||
|
||||
test_script:
|
||||
#- tox
|
||||
#- "py.test --cov=./"
|
||||
# Run the project tests
|
||||
# - "%CMD_IN_ENV% python C:/projects/eve-gnosis/setup.py nosetests"
|
||||
|
||||
after_test:
|
||||
# If tests are successful, create binary packages for the project.
|
||||
# - "%CMD_IN_ENV% python setup.py bdist_wheel"
|
||||
# - "%CMD_IN_ENV% python setup.py bdist_wininst"
|
||||
# - "%CMD_IN_ENV% python setup.py bdist_msi"
|
||||
# - ps: "ls dist"
|
||||
|
||||
artifacts:
|
||||
# Archive the generated packages in the ci.appveyor.com build report.
|
||||
- path: pyfa.zip
|
||||
name: 'pyfa.zip'
|
||||
#- path: pyfa_debug.zip
|
||||
# name: Pyfa_debug
|
||||
|
||||
#on_success:
|
||||
# - TODO: upload the content of dist/*.whl to a public wheelhouse
|
||||
#
|
||||
26
.codecov.yml
Normal file
26
.codecov.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
codecov:
|
||||
notify:
|
||||
require_ci_to_pass: yes
|
||||
|
||||
coverage:
|
||||
precision: 2
|
||||
round: down
|
||||
range: "70...100"
|
||||
|
||||
status:
|
||||
project: yes
|
||||
patch: yes
|
||||
changes: no
|
||||
|
||||
parsers:
|
||||
gcov:
|
||||
branch_detection:
|
||||
conditional: yes
|
||||
loop: yes
|
||||
method: no
|
||||
macro: no
|
||||
|
||||
comment:
|
||||
layout: "header, diff"
|
||||
behavior: default
|
||||
require_changes: no
|
||||
40
.gitattributes
vendored
Normal file
40
.gitattributes
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# Explicitly declare text files you want to always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
# *.c text
|
||||
# *.h text
|
||||
|
||||
# Declare files that will always have CRLF line endings on checkout.
|
||||
# Source files
|
||||
# ============
|
||||
*.pxd text eol=crlf
|
||||
*.py text eol=crlf
|
||||
*.py3 text eol=crlf
|
||||
*.pyw text eol=crlf
|
||||
*.pyx text eol=crlf
|
||||
pyfa.py text eol=lf
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
# Binary files
|
||||
# ============
|
||||
*.db binary
|
||||
*.p binary
|
||||
*.pkl binary
|
||||
*.pyc binary
|
||||
*.pyd binary
|
||||
*.pyo binary
|
||||
|
||||
# Note: .db, .p, and .pkl files are associated
|
||||
# with the python modules ``pickle``, ``dbm.*``,
|
||||
# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb``
|
||||
# (among others).
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
# Image files
|
||||
# ============
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.icns binary
|
||||
*.ico binary
|
||||
112
.gitignore
vendored
112
.gitignore
vendored
@@ -4,20 +4,116 @@
|
||||
#Kwrite/Gedit/Other crapapps making backups
|
||||
*~
|
||||
|
||||
#Eclipse
|
||||
.project
|
||||
.pydevproject
|
||||
.settings
|
||||
|
||||
#Patch files
|
||||
*.patch
|
||||
|
||||
#Personal
|
||||
/saveddata/
|
||||
|
||||
#PyCharm
|
||||
.idea/
|
||||
|
||||
#Pyfa file
|
||||
pyfaFits.html
|
||||
|
||||
#Temporary files
|
||||
*.py__jb_tmp__
|
||||
|
||||
# Based on https://github.com/github/gitignore
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
env/
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
Pyfa.egg-info/
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*,cover
|
||||
.hypothesis/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# IPython Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
|
||||
# dotenv
|
||||
.env
|
||||
|
||||
# virtualenv
|
||||
.venv/
|
||||
venv/
|
||||
ENV/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# Eclipse project settings
|
||||
.project
|
||||
.pydevproject
|
||||
.settings
|
||||
|
||||
# Pycharm project settings
|
||||
.idea
|
||||
eos.iml
|
||||
|
||||
39
.travis.yml
Normal file
39
.travis.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
language: python
|
||||
cache: pip
|
||||
python:
|
||||
- '2.7'
|
||||
env:
|
||||
- TOXENV=pep8
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
before_install:
|
||||
- sudo apt-get update && sudo apt-get --reinstall install -qq language-pack-en language-pack-ru language-pack-he language-pack-zh-hans
|
||||
- pip install tox
|
||||
# We're not actually installing Tox, but have to run it before we install wxPython via Conda. This is fugly but vOv
|
||||
- tox
|
||||
# get Conda
|
||||
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
|
||||
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
|
||||
else
|
||||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
|
||||
fi
|
||||
- bash miniconda.sh -b -p $HOME/miniconda
|
||||
- export PATH="$HOME/miniconda/bin:$PATH"
|
||||
- hash -r
|
||||
- conda config --set always_yes yes --set changeps1 no
|
||||
- conda update -q conda
|
||||
# Useful for debugging any issues with conda
|
||||
- conda info -a
|
||||
install:
|
||||
# install wxPython 3.0.0.0
|
||||
- conda install -c https://conda.anaconda.org/travis wxpython
|
||||
before_script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install -r requirements_test.txt
|
||||
script:
|
||||
- py.test --cov=./
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
before_deploy:
|
||||
- pip install -r requirements_build_linux.txt
|
||||
32
ISSUE_TEMPLATE.md
Normal file
32
ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# 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
|
||||
|
||||
|
||||
### Expected behavior:
|
||||
|
||||
|
||||
### Actual behavior:
|
||||
|
||||
|
||||
### Detailed steps to reproduce:
|
||||
|
||||
|
||||
### Fits involved in EFT format (Edit > To Clipboard > EFT):
|
||||
|
||||
|
||||
### Release or development git branch? Please note the release version or commit hash:
|
||||
|
||||
|
||||
### Operating system and version (eg: Windows 10, OS X 10.9, OS X 10.11, Ubuntu 16.10):
|
||||
|
||||
|
||||
### Other relevant information:
|
||||
|
||||
52
README.md
52
README.md
@@ -1,5 +1,7 @@
|
||||
# pyfa
|
||||
|
||||
[](https://pyfainvite.azurewebsites.net/) [](https://travis-ci.org/pyfa-org/Pyfa)
|
||||
|
||||

|
||||
|
||||
## What is it?
|
||||
@@ -7,41 +9,59 @@
|
||||
pyfa, short for **py**thon **f**itting **a**ssistant, allows you to create, experiment with, and save ship fittings without being in game. Open source and written in Python, it is available on any platform where Python 2.x and wxWidgets are available, including Windows, Mac OS X, and Linux.
|
||||
|
||||
## Latest Version and Changelogs
|
||||
The latest version along with release notes can always be found on the projects [Releases](https://github.com/DarkFenX/Pyfa/releases) page. pyfa will notify you if you are running an outdated version.
|
||||
The latest version along with release notes can always be found on the project's [Releases](https://github.com/DarkFenX/Pyfa/releases) page. pyfa will notify you if you are running an outdated version.
|
||||
|
||||
## Installing
|
||||
Windows and OS X users are supplied self-contained builds of pyfa that can be run without additional software. An `.exe` installer is also available for the Windows builds. There is no self-contained package for Linux users, which are expected to run pyfa through their distributions Python interpreter. However, there are a number of third-party packages available that handle the dependencies and updates for pyfa (for example, [pyfa for Arch Linux](https://aur.archlinux.org/packages/pyfa/)). Please check your distributions repositories.
|
||||
## Installation
|
||||
Windows and OS X users are supplied self-contained builds of pyfa on the [latest releases](https://github.com/pyfa-org/Pyfa/releases/latest) page. An `.exe` installer is also available for Windows builds. Linux users can run pyfa using their distribution's Python interpreter. There is no official self-contained package for Linux, however, there are a number of third-party packages available through distribution-specific repositories.
|
||||
|
||||
## Requirements
|
||||
#### OS X
|
||||
There are two different distributives for OS X: `-mac` and `-mac-deprecated`.
|
||||
|
||||
* `-mac`: based on wxPython 3.0.2.0 and has updated libraries. This is the recommended build.
|
||||
* `-mac-deprecated`: utilizes older binaries running on wxPython 2.8; because of this, some features are not available (currently CREST support and Attribute Overrides). Additionally, as development happens primarily on wxPython 3.0, a few GUI bugs may pop up as `-mac-deprecated` is not actively tested. However, due to some general issues with wxPython 3.0, especially on some newer OS X versions, `-mac-deprecated` is still offered for those that need it.
|
||||
|
||||
There is also a [Homebrew](http://brew.sh) option for installing pyfa on OS X. Please note this is maintained by a third-party and is not tested by pyfa developers. Simply fire up in terminal:
|
||||
```
|
||||
$ brew install Caskroom/cask/pyfa
|
||||
```
|
||||
|
||||
### Linux Distro-specific Packages
|
||||
The following is a list of pyfa packages available for certain distributions. Please note that these packages are maintained by third-parties and are not evaluated by the pyfa developers.
|
||||
|
||||
* Debian/Ubuntu/derivitives: https://github.com/AdamMajer/Pyfa/releases
|
||||
* Arch: https://aur.archlinux.org/packages/pyfa/
|
||||
* openSUSE: https://build.opensuse.org/package/show/home:rmk2/pyfa
|
||||
* FreeBSD: http://www.freshports.org/games/pyfa/ (see [#484](https://github.com/pyfa-org/Pyfa/issues/484) for instructions)
|
||||
|
||||
### 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.6
|
||||
* Python 2.7
|
||||
* `wxPython` 2.8/3.0
|
||||
* `sqlalchemy` >= 0.6
|
||||
* `sqlalchemy` >= 1.0.5
|
||||
* `dateutil`
|
||||
* `matplotlib` (for some Linux distributions, you may need to install separate wxPython bindings, such as `python-matplotlib-wx`)
|
||||
* `matplotlib` (for some Linux distributions you may need to install separate wxPython bindings such as `python-matplotlib-wx`)
|
||||
* `requests`
|
||||
* `logbook` >= 1.0.0
|
||||
|
||||
## Bug Reporting
|
||||
The preferred method of reporting bugs is through the projects GitHub Issues interface. Alternatively, posting a report in the pyfa thread 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).
|
||||
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).
|
||||
|
||||
## Liscense
|
||||
## License
|
||||
pyfa is licensed under the GNU GPL v3.0, see LICENSE
|
||||
|
||||
## Resources
|
||||
* 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)
|
||||
* 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 University guide using pyfa](http://wiki.eveuniversity.org/Guide_to_using_PYFA)
|
||||
* [EVE Online website](http://www.eveonline.com/)
|
||||
|
||||
## Contacts:
|
||||
* Kadesh Priestess
|
||||
* GitHub: @DarkFenX
|
||||
* [TweetFleet Slack](https://www.fuzzwork.co.uk/tweetfleet-slack-invites/): @kadesh
|
||||
* Sable Blitzmann
|
||||
* GitHub: @blitzmann
|
||||
* [TweetFleet Slack](https://www.fuzzwork.co.uk/tweetfleet-slack-invites/): @blitzmann
|
||||
* [Gitter chat](https://gitter.im/pyfa-org/Pyfa): @ blitzmann
|
||||
* Email: sable.blitzmann@gmail.com
|
||||
|
||||
## CCP Copyright Notice
|
||||
EVE Online, the EVE logo, EVE and all associated logos and designs are the intellectual property of CCP hf. All artwork, screenshots, characters, vehicles, storylines, world facts or other recognizable features of the intellectual property relating to these trademarks are likewise the intellectual property of CCP hf. EVE Online and the EVE logo are the registered trademarks of CCP hf. All rights are reserved worldwide. All other trademarks are the property of their respective owners. CCP hf. has granted permission to Osmium to use EVE Online and all associated logos and designs for promotional and information purposes on its website but does not endorse, and is not in any way affiliated with, Osmium. CCP is in no way responsible for the content on or functioning of this website, nor can it be liable for any damage arising from the use of this website.
|
||||
EVE Online, the EVE logo, EVE and all associated logos and designs are the intellectual property of CCP hf. All artwork, screenshots, characters, vehicles, storylines, world facts or other recognizable features of the intellectual property relating to these trademarks are likewise the intellectual property of CCP hf. EVE Online and the EVE logo are the registered trademarks of CCP hf. All rights are reserved worldwide. All other trademarks are the property of their respective owners. CCP hf. has granted permission to pyfa to use EVE Online and all associated logos and designs for promotional and information purposes on its website but does not endorse, and is not in any way affiliated with, pyfa. CCP is in no way responsible for the content on or functioning of this program, nor can it be liable for any damage arising from the use of this program.
|
||||
|
||||
13
_development/Pyfa_CodeStyle.xml
Normal file
13
_development/Pyfa_CodeStyle.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<code_scheme name="Pyfa">
|
||||
<option name="LINE_SEPARATOR" value="
" />
|
||||
<option name="RIGHT_MARGIN" value="165" />
|
||||
<Python>
|
||||
<option name="NEW_LINE_AFTER_COLON" value="true" />
|
||||
<option name="DICT_ALIGNMENT" value="2" />
|
||||
<option name="DICT_NEW_LINE_AFTER_LEFT_BRACE" value="true" />
|
||||
<option name="DICT_NEW_LINE_BEFORE_RIGHT_BRACE" value="true" />
|
||||
<option name="USE_CONTINUATION_INDENT_FOR_ARGUMENTS" value="true" />
|
||||
<option name="OPTIMIZE_IMPORTS_SORT_NAMES_IN_FROM_IMPORTS" value="true" />
|
||||
<option name="OPTIMIZE_IMPORTS_JOIN_FROM_IMPORTS_WITH_SAME_SOURCE" value="true" />
|
||||
</Python>
|
||||
</code_scheme>
|
||||
54
_development/Pyfa_Inspections.xml
Normal file
54
_development/Pyfa_Inspections.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Pyfa" />
|
||||
<inspection_tool class="IgnoreUnusedEntry" enabled="false" level="UNUSED ENTRY" enabled_by_default="false" />
|
||||
<inspection_tool class="InconsistentLineSeparators" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
<inspection_tool class="ProblematicWhitespace" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="PyBehaveInspection" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="PyClassicStyleClassInspection" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ourVersions">
|
||||
<value>
|
||||
<list size="1">
|
||||
<item index="0" class="java.lang.String" itemvalue="2.7" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyMissingTypeHintsInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoredPackages">
|
||||
<value>
|
||||
<list size="1">
|
||||
<item index="0" class="java.lang.String" itemvalue="wxPython" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyPep8Inspection" enabled="true" level="TYPO" enabled_by_default="true">
|
||||
<option name="ignoredErrors">
|
||||
<list>
|
||||
<option value="E203" />
|
||||
<option value="E127" />
|
||||
<option value="E128" />
|
||||
<option value="E126" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="TYPO" enabled_by_default="true">
|
||||
<option name="ignoredErrors">
|
||||
<list>
|
||||
<option value="N802" />
|
||||
<option value="N806" />
|
||||
<option value="N803" />
|
||||
<option value="N814" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyShadowingBuiltinsInspection" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="PyShadowingNamesInspection" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
0
_development/__init__.py
Normal file
0
_development/__init__.py
Normal file
145
_development/helpers.py
Normal file
145
_development/helpers.py
Normal file
@@ -0,0 +1,145 @@
|
||||
# noinspection PyPackageRequirements
|
||||
import pytest
|
||||
|
||||
import os
|
||||
import sys
|
||||
import threading
|
||||
|
||||
from sqlalchemy import MetaData, create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
# Add root folder to python paths
|
||||
sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..')))
|
||||
sys._called_from_test = True
|
||||
|
||||
# noinspection PyUnresolvedReferences,PyUnusedLocal
|
||||
@pytest.fixture
|
||||
def DBInMemory_test():
|
||||
def rollback():
|
||||
with sd_lock:
|
||||
saveddata_session.rollback()
|
||||
|
||||
|
||||
print("Creating database in memory")
|
||||
from os.path import realpath, join, dirname, abspath
|
||||
|
||||
debug = False
|
||||
gamedataCache = True
|
||||
saveddataCache = True
|
||||
gamedata_version = ""
|
||||
gamedata_connectionstring = 'sqlite:///' + realpath(join(dirname(abspath(unicode(__file__))), "..", "eve.db"))
|
||||
saveddata_connectionstring = 'sqlite:///:memory:'
|
||||
|
||||
class ReadOnlyException(Exception):
|
||||
pass
|
||||
|
||||
if callable(gamedata_connectionstring):
|
||||
gamedata_engine = create_engine("sqlite://", creator=gamedata_connectionstring, echo=debug)
|
||||
else:
|
||||
gamedata_engine = create_engine(gamedata_connectionstring, echo=debug)
|
||||
|
||||
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:
|
||||
gamedata_version = gamedata_session.execute(
|
||||
"SELECT `field_value` FROM `metadata` WHERE `field_name` LIKE 'client_build'"
|
||||
).fetchone()[0]
|
||||
except Exception as e:
|
||||
print("Missing gamedata version.")
|
||||
gamedata_version = None
|
||||
|
||||
if saveddata_connectionstring is not None:
|
||||
if callable(saveddata_connectionstring):
|
||||
saveddata_engine = create_engine(creator=saveddata_connectionstring, echo=debug)
|
||||
else:
|
||||
saveddata_engine = create_engine(saveddata_connectionstring, echo=debug)
|
||||
|
||||
saveddata_meta = MetaData()
|
||||
saveddata_meta.bind = saveddata_engine
|
||||
saveddata_session = sessionmaker(bind=saveddata_engine, autoflush=False, expire_on_commit=False)()
|
||||
else:
|
||||
saveddata_meta = None
|
||||
|
||||
# Lock controlling any changes introduced to session
|
||||
sd_lock = threading.Lock()
|
||||
|
||||
# Import all the definitions for all our database stuff
|
||||
# noinspection PyPep8
|
||||
#from eos.db.gamedata import alphaClones, attribute, category, effect, group, icon, item, marketGroup, metaData, metaGroup, queries, traits, unit
|
||||
# noinspection PyPep8
|
||||
#from eos.db.saveddata import booster, cargo, character, crest, damagePattern, databaseRepair, drone, fighter, fit, implant, implantSet, loadDefaultDatabaseValues, miscData, module, override, price, queries, skill, targetResists, user
|
||||
|
||||
# If using in memory saveddata, you'll want to reflect it so the data structure is good.
|
||||
if saveddata_connectionstring == "sqlite:///:memory:":
|
||||
saveddata_meta.create_all()
|
||||
|
||||
# Output debug info to help us troubleshoot Travis
|
||||
print(saveddata_engine)
|
||||
print(gamedata_engine)
|
||||
|
||||
helper = {
|
||||
#'config': eos.config,
|
||||
'gamedata_session' : gamedata_session,
|
||||
'saveddata_session' : saveddata_session,
|
||||
}
|
||||
return helper
|
||||
|
||||
# noinspection PyUnresolvedReferences,PyUnusedLocal
|
||||
@pytest.fixture
|
||||
def DBInMemory():
|
||||
print("Creating database in memory")
|
||||
|
||||
import eos.config
|
||||
|
||||
import eos
|
||||
import eos.db
|
||||
|
||||
# Output debug info to help us troubleshoot Travis
|
||||
print(eos.db.saveddata_engine)
|
||||
print(eos.db.gamedata_engine)
|
||||
|
||||
helper = {
|
||||
'config': eos.config,
|
||||
'db' : eos.db,
|
||||
'gamedata_session' : eos.db.gamedata_session,
|
||||
'saveddata_session' : eos.db.saveddata_session,
|
||||
}
|
||||
return helper
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def Gamedata():
|
||||
print("Building Gamedata")
|
||||
from eos.gamedata import Item
|
||||
|
||||
helper = {
|
||||
'Item': Item,
|
||||
}
|
||||
return helper
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def Saveddata():
|
||||
print("Building Saveddata")
|
||||
from eos.saveddata.ship import Ship
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.saveddata.character import Character
|
||||
from eos.saveddata.module import Module, State
|
||||
from eos.saveddata.citadel import Citadel
|
||||
from eos.saveddata.booster import Booster
|
||||
|
||||
helper = {
|
||||
'Structure': Citadel,
|
||||
'Ship' : Ship,
|
||||
'Fit' : Fit,
|
||||
'Character': Character,
|
||||
'Module' : Module,
|
||||
'State' : State,
|
||||
'Booster' : Booster,
|
||||
}
|
||||
return helper
|
||||
66
_development/helpers_fits.py
Normal file
66
_development/helpers_fits.py
Normal file
@@ -0,0 +1,66 @@
|
||||
import pytest
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
from _development.helpers import DBInMemory as DB, Gamedata, Saveddata
|
||||
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@pytest.fixture
|
||||
def RifterFit(DB, Gamedata, Saveddata):
|
||||
print("Creating Rifter")
|
||||
item = DB['gamedata_session'].query(Gamedata['Item']).filter(Gamedata['Item'].name == "Rifter").first()
|
||||
ship = Saveddata['Ship'](item)
|
||||
# setup fit
|
||||
fit = Saveddata['Fit'](ship, "My Rifter Fit")
|
||||
|
||||
return fit
|
||||
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@pytest.fixture
|
||||
def KeepstarFit(DB, Gamedata, Saveddata):
|
||||
print("Creating Keepstar")
|
||||
item = DB['gamedata_session'].query(Gamedata['Item']).filter(Gamedata['Item'].name == "Keepstar").first()
|
||||
ship = Saveddata['Structure'](item)
|
||||
# setup fit
|
||||
fit = Saveddata['Fit'](ship, "Keepstar Fit")
|
||||
|
||||
return fit
|
||||
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@pytest.fixture
|
||||
def CurseFit(DB, Gamedata, Saveddata):
|
||||
print("Creating Curse - With Neuts")
|
||||
item = DB['gamedata_session'].query(Gamedata['Item']).filter(Gamedata['Item'].name == "Curse").first()
|
||||
ship = Saveddata['Ship'](item)
|
||||
# setup fit
|
||||
fit = Saveddata['Fit'](ship, "Curse - With Neuts")
|
||||
|
||||
mod = Saveddata['Module'](DB['db'].getItem("Medium Energy Neutralizer II"))
|
||||
mod.state = Saveddata['State'].ONLINE
|
||||
|
||||
# Add 5 neuts
|
||||
for _ in xrange(5):
|
||||
fit.modules.append(mod)
|
||||
|
||||
return fit
|
||||
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@pytest.fixture
|
||||
def HeronFit(DB, Gamedata, Saveddata):
|
||||
print("Creating Heron - RemoteSebo")
|
||||
item = DB['gamedata_session'].query(Gamedata['Item']).filter(Gamedata['Item'].name == "Heron").first()
|
||||
ship = Saveddata['Ship'](item)
|
||||
# setup fit
|
||||
fit = Saveddata['Fit'](ship, "Heron - RemoteSebo")
|
||||
|
||||
mod = Saveddata['Module'](DB['db'].getItem("Remote Sensor Booster II"))
|
||||
mod.state = Saveddata['State'].ONLINE
|
||||
|
||||
# Add 5 neuts
|
||||
for _ in xrange(4):
|
||||
fit.modules.append(mod)
|
||||
|
||||
return fit
|
||||
12
_development/helpers_items.py
Normal file
12
_development/helpers_items.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import pytest
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
from _development.helpers import DBInMemory as DB, Gamedata, Saveddata
|
||||
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@pytest.fixture
|
||||
def StrongBluePillBooster (DB, Gamedata, Saveddata):
|
||||
print("Creating Strong Blue Pill Booster")
|
||||
item = DB['gamedata_session'].query(Gamedata['Item']).filter(Gamedata['Item'].name == "Strong Blue Pill Booster").first()
|
||||
return Saveddata['Booster'](item)
|
||||
101
_development/helpers_locale.py
Normal file
101
_development/helpers_locale.py
Normal file
@@ -0,0 +1,101 @@
|
||||
import os
|
||||
|
||||
# https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx
|
||||
windows_codecs = {
|
||||
'cp1252', # Standard Windows
|
||||
'cp1251', # Russian
|
||||
'cp037',
|
||||
'cp424',
|
||||
'cp437',
|
||||
'cp500',
|
||||
'cp720',
|
||||
'cp737',
|
||||
'cp775',
|
||||
'cp850',
|
||||
'cp852',
|
||||
'cp855',
|
||||
'cp856',
|
||||
'cp857',
|
||||
'cp858',
|
||||
'cp860',
|
||||
'cp861',
|
||||
'cp862',
|
||||
'cp863',
|
||||
'cp864',
|
||||
'cp865',
|
||||
'cp866',
|
||||
'cp869',
|
||||
'cp874',
|
||||
'cp875',
|
||||
'cp932',
|
||||
'cp949',
|
||||
'cp950',
|
||||
'cp1006',
|
||||
'cp1026',
|
||||
'cp1140',
|
||||
'cp1250',
|
||||
'cp1253',
|
||||
'cp1254',
|
||||
'cp1255',
|
||||
'cp1256',
|
||||
'cp1257',
|
||||
'cp1258',
|
||||
}
|
||||
|
||||
linux_codecs = {
|
||||
'utf_8', # Generic Linux/Mac
|
||||
}
|
||||
|
||||
mac_codecs = [
|
||||
'utf_8', # Generic Linux/Mac
|
||||
'mac_cyrillic',
|
||||
'mac_greek',
|
||||
'mac_iceland',
|
||||
'mac_latin2',
|
||||
'mac_roman',
|
||||
'mac_turkish',
|
||||
]
|
||||
|
||||
universal_codecs = [
|
||||
'utf_16', 'utf_32', 'utf_32_be', 'utf_32_le', 'utf_16_be', 'utf_16_le', 'utf_7', 'utf_8_sig',
|
||||
]
|
||||
|
||||
other_codecs = [
|
||||
'scii', 'big5', 'big5hkscs', 'euc_jp', 'euc_jis_2004', 'euc_jisx0213', 'euc_kr', 'gb2312', 'gbk', 'gb18030', 'hz', 'iso2022_jp', 'iso2022_jp_1',
|
||||
'iso2022_jp_2', 'iso2022_jp_2004', 'iso2022_jp_3', 'iso2022_jp_ext', 'iso2022_kr', 'latin_1', 'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5',
|
||||
'iso8859_6', 'iso8859_7', 'iso8859_8', 'iso8859_9', 'iso8859_10', 'iso8859_11', 'iso8859_13', 'iso8859_14', 'iso8859_15', 'iso8859_16', 'johab', 'koi8_r',
|
||||
'koi8_u', 'ptcp154', 'shift_jis', 'shift_jis_2004', 'shift_jisx0213'
|
||||
]
|
||||
|
||||
system_names = {
|
||||
'Windows': windows_codecs,
|
||||
'Linux': linux_codecs,
|
||||
'Darwin': mac_codecs,
|
||||
}
|
||||
|
||||
|
||||
def GetPath(root, file=None, codec=None):
|
||||
# Replace this with the function we actually use for this
|
||||
path = os.path.realpath(os.path.abspath(root))
|
||||
|
||||
if file:
|
||||
path = os.path.join(path, file)
|
||||
|
||||
if codec:
|
||||
path = path.decode(codec)
|
||||
|
||||
return path
|
||||
|
||||
def GetUnicodePath(root, file=None, codec=None):
|
||||
# Replace this with the function we actually use for this
|
||||
path = os.path.realpath(os.path.abspath(root))
|
||||
|
||||
if file:
|
||||
path = os.path.join(path, file)
|
||||
|
||||
if codec:
|
||||
path = unicode(path, codec)
|
||||
else:
|
||||
path = unicode(path)
|
||||
|
||||
return path
|
||||
92
config.py
92
config.py
@@ -1,68 +1,61 @@
|
||||
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
|
||||
from logbook import Logger
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
# Load variable overrides specific to distribution type
|
||||
try:
|
||||
import configforced
|
||||
except ImportError:
|
||||
pyfalog.warning("Failed to import: configforced")
|
||||
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.15.1"
|
||||
tag = "git"
|
||||
expansionName = "Vanguard"
|
||||
version = "1.29.4"
|
||||
tag = "Stable"
|
||||
expansionName = "YC119.5"
|
||||
expansionVersion = "1.0"
|
||||
evemonMinVersion = "4081"
|
||||
|
||||
clientID = 'af87365240d644f7950af563b8418bad'
|
||||
|
||||
pyfaPath = None
|
||||
savePath = None
|
||||
saveDB = None
|
||||
gameDB = None
|
||||
logPath = 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 isFrozen():
|
||||
if hasattr(sys, 'frozen'):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def __createDirs(path):
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
|
||||
|
||||
def getPyfaRoot():
|
||||
base = getattr(sys.modules['__main__'], "__file__", sys.executable) if isFrozen() else sys.argv[0]
|
||||
root = os.path.dirname(os.path.realpath(os.path.abspath(base)))
|
||||
root = unicode(root, sys.getfilesystemencoding())
|
||||
return root
|
||||
|
||||
def __createDirs(path):
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
|
||||
def defPaths():
|
||||
def getDefaultSave():
|
||||
return unicode(os.path.expanduser(os.path.join("~", ".pyfa")), sys.getfilesystemencoding())
|
||||
|
||||
|
||||
def defPaths(customSavePath):
|
||||
global debug
|
||||
global pyfaPath
|
||||
global savePath
|
||||
@@ -70,10 +63,7 @@ def defPaths():
|
||||
global gameDB
|
||||
global saveInRoot
|
||||
|
||||
if debug:
|
||||
logLevel = logging.DEBUG
|
||||
else:
|
||||
logLevel = logging.WARN
|
||||
pyfalog.debug("Configuring Pyfa")
|
||||
|
||||
# The main pyfa directory which contains run.py
|
||||
# Python 2.X uses ANSI by default, so we need to convert the character encoding
|
||||
@@ -89,32 +79,16 @@ def defPaths():
|
||||
else:
|
||||
savePath = getattr(configforced, "savePath", None)
|
||||
if savePath is None:
|
||||
savePath = unicode(os.path.expanduser(os.path.join("~", ".pyfa")),
|
||||
sys.getfilesystemencoding())
|
||||
if customSavePath is None: # customSavePath is not overriden
|
||||
savePath = getDefaultSave()
|
||||
else:
|
||||
savePath = customSavePath
|
||||
|
||||
__createDirs(savePath)
|
||||
|
||||
if isFrozen():
|
||||
os.environ["REQUESTS_CA_BUNDLE"] = os.path.join(pyfaPath, "cacert.pem")
|
||||
|
||||
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
|
||||
|
||||
# This interferes with cx_Freeze's own handling of exceptions. Find a way to fix this.
|
||||
#stderr_logger = logging.getLogger('STDERR')
|
||||
#sl = StreamToLogger(stderr_logger, logging.ERROR)
|
||||
#sys.stderr = sl
|
||||
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')
|
||||
|
||||
# The database where we store all the fits etc
|
||||
saveDB = os.path.join(savePath, "saveddata.db")
|
||||
@@ -122,13 +96,19 @@ def defPaths():
|
||||
# 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(pyfaPath, "eve.db")
|
||||
gameDB = getattr(configforced, "gameDB", gameDB)
|
||||
if not gameDB:
|
||||
gameDB = os.path.join(pyfaPath, "eve.db")
|
||||
|
||||
## DON'T MODIFY ANYTHING BELOW ##
|
||||
# DON'T MODIFY ANYTHING BELOW
|
||||
import eos.config
|
||||
|
||||
#Caching modifiers, disable all gamedata caching, its unneeded.
|
||||
# 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"
|
||||
|
||||
# initialize the settings
|
||||
from service.settings import EOSSettings
|
||||
eos.config.settings = EOSSettings.getInstance().EOSSettings # this is kind of confusing, but whatever
|
||||
|
||||
5666
dist_assets/cacert.pem
Normal file
5666
dist_assets/cacert.pem
Normal file
File diff suppressed because it is too large
Load Diff
83
dist_assets/win/pyfa.spec
Normal file
83
dist_assets/win/pyfa.spec
Normal file
@@ -0,0 +1,83 @@
|
||||
# -*- 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
|
||||
|
||||
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', '.' ),
|
||||
]
|
||||
|
||||
import_these = []
|
||||
|
||||
# Walk eos.effects and add all effects so we can import them properly
|
||||
for root, folders, files in os.walk("eos/effects"):
|
||||
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=['C:\\projects\\pyfa\\'],
|
||||
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,
|
||||
debug=False,
|
||||
console=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
name='pyfa',
|
||||
icon='dist_assets/win/pyfa.ico',
|
||||
onefile=False,
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
onefile=False,
|
||||
name='pyfa',
|
||||
icon='dist_assets/win/pyfa.ico',
|
||||
)
|
||||
83
dist_assets/win/pyfa_debug.spec
Normal file
83
dist_assets/win/pyfa_debug.spec
Normal file
@@ -0,0 +1,83 @@
|
||||
# -*- 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
|
||||
|
||||
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', '.' ),
|
||||
]
|
||||
|
||||
import_these = []
|
||||
|
||||
# Walk eos.effects and add all effects so we can import them properly
|
||||
for root, folders, files in os.walk("eos/effects"):
|
||||
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=['C:\\projects\\pyfa\\'],
|
||||
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,
|
||||
debug=True,
|
||||
console=True,
|
||||
strip=False,
|
||||
upx=True,
|
||||
name='pyfa_debug',
|
||||
icon='dist_assets/win/pyfa.ico',
|
||||
onefile=False,
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
onefile=False,
|
||||
name='pyfa_debug',
|
||||
icon='dist_assets/win/pyfa.ico',
|
||||
)
|
||||
@@ -1,7 +1,2 @@
|
||||
version = "0.2.3"
|
||||
tag = "git"
|
||||
|
||||
def test():
|
||||
import tests.runTests
|
||||
import unittest
|
||||
unittest.main(defaultTest="discover", testLoader=tests.runTests.loader)
|
||||
version = "0.2.3"
|
||||
tag = "git"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import heapq
|
||||
from math import sqrt, exp
|
||||
import time
|
||||
|
||||
from math import sqrt, exp
|
||||
|
||||
DAY = 24 * 60 * 60 * 1000
|
||||
|
||||
def lcm(a,b):
|
||||
n = a*b
|
||||
|
||||
def lcm(a, b):
|
||||
n = a * b
|
||||
while b:
|
||||
a, b = b, a % b
|
||||
return n / a
|
||||
@@ -40,45 +40,38 @@ class CapSimulator(object):
|
||||
# relevant decimal digits of capacitor for LCM period optimization
|
||||
self.stability_precision = 1
|
||||
|
||||
|
||||
def scale_activation(self, duration, capNeed):
|
||||
for res in self.scale_resolutions:
|
||||
mod = duration % res
|
||||
if mod:
|
||||
if mod > res/2.0:
|
||||
mod = res-mod
|
||||
if mod > res / 2.0:
|
||||
mod = res - mod
|
||||
else:
|
||||
mod = -mod
|
||||
|
||||
if abs(mod) <= duration/100.0:
|
||||
if abs(mod) <= duration / 100.0:
|
||||
# only adjust if the adjustment is less than 1%
|
||||
duration += mod
|
||||
capNeed += float(mod)/duration * capNeed
|
||||
capNeed += float(mod) / duration * capNeed
|
||||
break
|
||||
|
||||
return duration, capNeed
|
||||
|
||||
def init(self, modules):
|
||||
"""prepare modules. a list of (duration, capNeed, clipSize) tuples is
|
||||
"""prepare modules. a list of (duration, capNeed, clipSize, disableStagger) tuples is
|
||||
expected, with clipSize 0 if the module has infinite ammo.
|
||||
"""
|
||||
mods = {}
|
||||
for module in modules:
|
||||
if module in mods:
|
||||
mods[module] += 1
|
||||
else:
|
||||
mods[module] = 1
|
||||
|
||||
self.modules = mods
|
||||
|
||||
self.modules = modules
|
||||
|
||||
def reset(self):
|
||||
"""Reset the simulator state"""
|
||||
self.state = []
|
||||
mods = {}
|
||||
period = 1
|
||||
disable_period = False
|
||||
|
||||
for (duration, capNeed, clipSize), amount in self.modules.iteritems():
|
||||
# Loop over modules, clearing clipSize if applicable, and group modules based on attributes
|
||||
for (duration, capNeed, clipSize, disableStagger) in self.modules:
|
||||
if self.scale:
|
||||
duration, capNeed = self.scale_activation(duration, capNeed)
|
||||
|
||||
@@ -87,14 +80,22 @@ class CapSimulator(object):
|
||||
if not self.reload and capNeed > 0:
|
||||
clipSize = 0
|
||||
|
||||
if self.stagger:
|
||||
# Group modules based on their properties
|
||||
if (duration, capNeed, clipSize, disableStagger) in mods:
|
||||
mods[(duration, capNeed, clipSize, disableStagger)] += 1
|
||||
else:
|
||||
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():
|
||||
if self.stagger and not disableStagger:
|
||||
if clipSize == 0:
|
||||
duration = int(duration/amount)
|
||||
duration = int(duration / amount)
|
||||
else:
|
||||
stagger_amount = (duration*clipSize+10000)/(amount*clipSize)
|
||||
stagger_amount = (duration * clipSize + 10000) / (amount * clipSize)
|
||||
for i in range(1, amount):
|
||||
heapq.heappush(self.state,
|
||||
[i*stagger_amount, duration,
|
||||
[i * stagger_amount, duration,
|
||||
capNeed, 0, clipSize])
|
||||
else:
|
||||
capNeed *= amount
|
||||
@@ -107,13 +108,11 @@ class CapSimulator(object):
|
||||
|
||||
heapq.heappush(self.state, [0, duration, capNeed, 0, clipSize])
|
||||
|
||||
|
||||
if disable_period:
|
||||
self.period = self.t_max
|
||||
else:
|
||||
self.period = period
|
||||
|
||||
|
||||
def run(self):
|
||||
"""Run the simulation"""
|
||||
|
||||
@@ -133,13 +132,13 @@ class CapSimulator(object):
|
||||
capCapacity = self.capacitorCapacity
|
||||
tau = self.capacitorRecharge / 5.0
|
||||
|
||||
cap_wrap = capCapacity # cap value at last period
|
||||
cap_lowest = capCapacity # lowest cap value encountered
|
||||
cap_lowest_pre = capCapacity # lowest cap value before activations
|
||||
cap = capCapacity # current cap value
|
||||
t_wrap = self.period # point in time of next period
|
||||
cap_wrap = capCapacity # cap value at last period
|
||||
cap_lowest = capCapacity # lowest cap value encountered
|
||||
cap_lowest_pre = capCapacity # lowest cap value before activations
|
||||
cap = capCapacity # current cap value
|
||||
t_wrap = self.period # point in time of next period
|
||||
|
||||
t_now = t_last = 0
|
||||
t_last = 0
|
||||
t_max = self.t_max
|
||||
|
||||
while 1:
|
||||
@@ -148,7 +147,7 @@ class CapSimulator(object):
|
||||
if t_now >= t_max:
|
||||
break
|
||||
|
||||
cap = ((1.0+(sqrt(cap/capCapacity)-1.0)*exp((t_last-t_now)/tau))**2)*capCapacity
|
||||
cap = ((1.0 + (sqrt(cap / capCapacity) - 1.0) * exp((t_last - t_now) / tau)) ** 2) * capCapacity
|
||||
|
||||
if t_now != t_last:
|
||||
if cap < cap_lowest_pre:
|
||||
@@ -167,20 +166,20 @@ class CapSimulator(object):
|
||||
|
||||
iterations += 1
|
||||
|
||||
t_last = t_now
|
||||
|
||||
if cap < cap_lowest:
|
||||
if cap < 0.0:
|
||||
break
|
||||
cap_lowest = cap
|
||||
|
||||
t_last = t_now
|
||||
|
||||
# queue the next activation of this module
|
||||
t_now += duration
|
||||
shot += 1
|
||||
if clipSize:
|
||||
if shot % clipSize == 0:
|
||||
shot = 0
|
||||
t_now += 10000 # include reload time
|
||||
t_now += 10000 # include reload time
|
||||
activation[0] = t_now
|
||||
activation[3] = shot
|
||||
|
||||
@@ -193,19 +192,17 @@ class CapSimulator(object):
|
||||
|
||||
# calculate EVE's stability value
|
||||
try:
|
||||
avgDrain = reduce(float.__add__, map(lambda x: x[2]/x[1], self.state), 0.0)
|
||||
self.cap_stable_eve = 0.25 * (1.0 + sqrt(-(2.0 * avgDrain * tau - capCapacity)/capCapacity)) ** 2
|
||||
avgDrain = reduce(float.__add__, map(lambda x: x[2] / x[1], 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
|
||||
|
||||
|
||||
if cap > 0.0:
|
||||
# capacitor low/high water marks
|
||||
self.cap_stable_low = cap_lowest
|
||||
self.cap_stable_high = cap_lowest_pre
|
||||
else:
|
||||
self.cap_stable_low =\
|
||||
self.cap_stable_high = 0.0
|
||||
self.cap_stable_low = \
|
||||
self.cap_stable_high = 0.0
|
||||
|
||||
|
||||
self.runtime = time.time()-start
|
||||
self.runtime = time.time() - start
|
||||
|
||||
@@ -1,11 +1,31 @@
|
||||
from os.path import realpath, join, dirname, abspath
|
||||
import sys
|
||||
from os.path import realpath, join, dirname, abspath
|
||||
|
||||
from logbook import Logger
|
||||
import os
|
||||
|
||||
istravis = os.environ.get('TRAVIS') == 'true'
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
debug = False
|
||||
gamedataCache = True
|
||||
saveddataCache = True
|
||||
gamedata_version = ""
|
||||
gamedata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "eve.db")), sys.getfilesystemencoding())
|
||||
saveddata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "saveddata", "saveddata.db")), sys.getfilesystemencoding())
|
||||
pyfalog.debug("Gamedata connection string: {0}", gamedata_connectionstring)
|
||||
|
||||
#Autodetect path, only change if the autodetection bugs out.
|
||||
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())
|
||||
|
||||
pyfalog.debug("Saveddata connection string: {0}", saveddata_connectionstring)
|
||||
|
||||
settings = {
|
||||
"useStaticAdaptiveArmorHardener": False,
|
||||
"strictSkillLevels": True,
|
||||
}
|
||||
|
||||
# Autodetect path, only change if the autodetection bugs out.
|
||||
path = dirname(unicode(__file__, sys.getfilesystemencoding()))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,26 +15,31 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
|
||||
import threading
|
||||
|
||||
from sqlalchemy import MetaData, create_engine
|
||||
from sqlalchemy.orm import sessionmaker, scoped_session
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy import pool
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
from eos import config
|
||||
import migration
|
||||
from eos import config
|
||||
from logbook import Logger
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
pyfalog.info("Initializing database")
|
||||
pyfalog.info("Gamedata connection: {0}", config.gamedata_connectionstring)
|
||||
pyfalog.info("Saveddata connection: {0}", config.saveddata_connectionstring)
|
||||
|
||||
class ReadOnlyException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
gamedata_connectionstring = config.gamedata_connectionstring
|
||||
if callable(gamedata_connectionstring):
|
||||
gamedata_engine = create_engine("sqlite://", creator=gamedata_connectionstring, echo = config.debug)
|
||||
gamedata_engine = create_engine("sqlite://", creator=gamedata_connectionstring, echo=config.debug)
|
||||
else:
|
||||
gamedata_engine = create_engine(gamedata_connectionstring, echo = config.debug)
|
||||
gamedata_engine = create_engine(gamedata_connectionstring, echo=config.debug)
|
||||
|
||||
gamedata_meta = MetaData()
|
||||
gamedata_meta.bind = gamedata_engine
|
||||
@@ -45,8 +50,10 @@ gamedata_session = sessionmaker(bind=gamedata_engine, autoflush=False, expire_on
|
||||
try:
|
||||
config.gamedata_version = gamedata_session.execute(
|
||||
"SELECT `field_value` FROM `metadata` WHERE `field_name` LIKE 'client_build'"
|
||||
).fetchone()[0]
|
||||
except:
|
||||
).fetchone()[0]
|
||||
except Exception as e:
|
||||
pyfalog.warning("Missing gamedata version.")
|
||||
pyfalog.critical(e)
|
||||
config.gamedata_version = None
|
||||
|
||||
saveddata_connectionstring = config.saveddata_connectionstring
|
||||
@@ -59,29 +66,32 @@ if saveddata_connectionstring is not None:
|
||||
saveddata_meta = MetaData()
|
||||
saveddata_meta.bind = saveddata_engine
|
||||
saveddata_session = sessionmaker(bind=saveddata_engine, autoflush=False, expire_on_commit=False)()
|
||||
else:
|
||||
saveddata_meta = None
|
||||
|
||||
# Lock controlling any changes introduced to session
|
||||
sd_lock = threading.Lock()
|
||||
sd_lock = threading.RLock()
|
||||
|
||||
#Import all the definitions for all our database stuff
|
||||
from eos.db.gamedata import *
|
||||
from eos.db.saveddata import *
|
||||
# Import all the definitions for all our database stuff
|
||||
# noinspection PyPep8
|
||||
from eos.db.gamedata import alphaClones, attribute, category, effect, group, icon, item, marketGroup, metaData, metaGroup, queries, traits, unit
|
||||
# noinspection PyPep8
|
||||
from eos.db.saveddata import booster, cargo, character, crest, damagePattern, databaseRepair, drone, fighter, fit, implant, implantSet, loadDefaultDatabaseValues, \
|
||||
miscData, module, override, price, queries, skill, targetResists, user
|
||||
|
||||
#Import queries
|
||||
from eos.db.gamedata.queries import getItem, searchItems, getVariations, getItemsByCategory, directAttributeRequest, \
|
||||
getMarketGroup, getGroup, getCategory, getAttributeInfo, getMetaData, getMetaGroup
|
||||
from eos.db.saveddata.queries import getUser, getCharacter, getFit, getFitsWithShip, countFitsWithShip, searchFits, \
|
||||
getCharacterList, getPrice, getDamagePatternList, getDamagePattern, \
|
||||
getFitList, getFleetList, getFleet, save, remove, commit, add, \
|
||||
getCharactersForUser, getMiscData, getSquadsIDsWithFitID, getWing, \
|
||||
getSquad, getBoosterFits, getProjectedFits, getTargetResistsList, getTargetResists,\
|
||||
clearPrices, countAllFits, getCrestCharacters, getCrestCharacter
|
||||
# Import queries
|
||||
# noinspection PyPep8
|
||||
from eos.db.gamedata.queries import *
|
||||
# noinspection PyPep8
|
||||
from eos.db.saveddata.queries import *
|
||||
|
||||
#If using in memory saveddata, you'll want to reflect it so the data structure is good.
|
||||
# If using in memory saveddata, you'll want to reflect it so the data structure is good.
|
||||
if config.saveddata_connectionstring == "sqlite:///:memory:":
|
||||
saveddata_meta.create_all()
|
||||
pyfalog.info("Running database out of memory.")
|
||||
|
||||
|
||||
def rollback():
|
||||
with sd_lock:
|
||||
pyfalog.warning("Session rollback triggered.")
|
||||
saveddata_session.rollback()
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
__all__ = ["attribute", "category", "effect", "group", "metaData",
|
||||
"icon", "item", "marketGroup", "metaGroup", "unit"]
|
||||
"icon", "item", "marketGroup", "metaGroup", "unit", "alphaClones"]
|
||||
|
||||
50
eos/db/gamedata/alphaClones.py
Normal file
50
eos/db/gamedata/alphaClones.py
Normal file
@@ -0,0 +1,50 @@
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# 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 Column, String, Integer, Table, ForeignKey
|
||||
from sqlalchemy.orm import relation, mapper, synonym
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.gamedata import AlphaClone, AlphaCloneSkill
|
||||
|
||||
alphaclones_table = Table(
|
||||
"alphaClones",
|
||||
gamedata_meta,
|
||||
Column("alphaCloneID", Integer, primary_key=True),
|
||||
Column("alphaCloneName", String),
|
||||
)
|
||||
|
||||
alphacloneskskills_table = Table(
|
||||
"alphaCloneSkills",
|
||||
gamedata_meta,
|
||||
Column("alphaCloneID", Integer, ForeignKey("alphaClones.alphaCloneID"), primary_key=True),
|
||||
Column("typeID", Integer, primary_key=True),
|
||||
Column("level", Integer),
|
||||
)
|
||||
|
||||
mapper(AlphaClone, alphaclones_table,
|
||||
properties={
|
||||
"ID" : synonym("alphaCloneID"),
|
||||
"skills": relation(
|
||||
AlphaCloneSkill,
|
||||
cascade="all,delete-orphan",
|
||||
backref="clone")
|
||||
})
|
||||
|
||||
mapper(AlphaCloneSkill, alphacloneskskills_table)
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,20 +15,22 @@
|
||||
#
|
||||
# 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, Unicode, ForeignKey, String, Boolean
|
||||
from sqlalchemy.orm import relation, mapper, synonym, deferred
|
||||
from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from eos.types import Attribute, Icon, AttributeInfo, Unit
|
||||
from sqlalchemy.orm import relation, mapper, synonym, deferred
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.gamedata import Attribute, AttributeInfo, Unit, Icon
|
||||
|
||||
typeattributes_table = Table("dgmtypeattribs", gamedata_meta,
|
||||
Column("value", Float),
|
||||
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True, index=True),
|
||||
Column("attributeID", ForeignKey("dgmattribs.attributeID"), primary_key=True))
|
||||
Column("value", Float),
|
||||
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True, index=True),
|
||||
Column("attributeID", ForeignKey("dgmattribs.attributeID"), primary_key=True))
|
||||
|
||||
attributes_table = Table("dgmattribs", gamedata_meta,
|
||||
Column("attributeID", Integer, primary_key = True),
|
||||
Column("attributeID", Integer, primary_key=True),
|
||||
Column("attributeName", String),
|
||||
Column("defaultValue", Float),
|
||||
Column("maxAttributeID", Integer, ForeignKey("dgmattribs.attributeID")),
|
||||
@@ -40,14 +42,16 @@ attributes_table = Table("dgmattribs", gamedata_meta,
|
||||
Column("unitID", Integer, ForeignKey("dgmunits.unitID")))
|
||||
|
||||
mapper(Attribute, typeattributes_table,
|
||||
properties = {"info": relation(AttributeInfo, lazy=False)})
|
||||
properties={"info": relation(AttributeInfo, lazy=False)})
|
||||
|
||||
mapper(AttributeInfo, attributes_table,
|
||||
properties = {"icon" : relation(Icon),
|
||||
"unit": relation(Unit),
|
||||
"ID": synonym("attributeID"),
|
||||
"name": synonym("attributeName"),
|
||||
"description" : deferred(attributes_table.c.description)})
|
||||
properties={
|
||||
"icon" : relation(Icon),
|
||||
"unit" : relation(Unit),
|
||||
"ID" : synonym("attributeID"),
|
||||
"name" : synonym("attributeName"),
|
||||
"description": deferred(attributes_table.c.description)
|
||||
})
|
||||
|
||||
Attribute.ID = association_proxy("info", "attributeID")
|
||||
Attribute.name = association_proxy("info", "attributeName")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,23 +15,25 @@
|
||||
#
|
||||
# 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 Column, String, Integer, ForeignKey, Boolean, Table
|
||||
from sqlalchemy.orm import relation, mapper, synonym, deferred
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.types import Category, Icon
|
||||
from eos.gamedata import Category, Icon
|
||||
|
||||
categories_table = Table("invcategories", gamedata_meta,
|
||||
Column("categoryID", Integer, primary_key = True),
|
||||
Column("categoryID", Integer, primary_key=True),
|
||||
Column("categoryName", String),
|
||||
Column("description", String),
|
||||
Column("published", Boolean),
|
||||
Column("iconID", Integer, ForeignKey("icons.iconID")))
|
||||
|
||||
mapper(Category, categories_table,
|
||||
properties = {"icon" : relation(Icon),
|
||||
"ID" : synonym("categoryID"),
|
||||
"name" : synonym("categoryName"),
|
||||
"description" : deferred(categories_table.c.description)})
|
||||
properties={
|
||||
"icon" : relation(Icon),
|
||||
"ID" : synonym("categoryID"),
|
||||
"name" : synonym("categoryName"),
|
||||
"description": deferred(categories_table.c.description)
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,36 +15,32 @@
|
||||
#
|
||||
# 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 Column, String, Integer, Boolean, Table, ForeignKey
|
||||
from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.orm import mapper, synonym, relation, deferred
|
||||
from eos.types import Effect, EffectInfo
|
||||
from sqlalchemy.orm import mapper, synonym, deferred
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.gamedata import Effect, ItemEffect
|
||||
|
||||
typeeffects_table = Table("dgmtypeeffects", gamedata_meta,
|
||||
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True, index=True),
|
||||
Column("effectID", Integer, ForeignKey("dgmeffects.effectID"), primary_key=True))
|
||||
|
||||
effects_table = Table("dgmeffects", gamedata_meta,
|
||||
Column("effectID", Integer, primary_key = True),
|
||||
Column("effectID", Integer, primary_key=True),
|
||||
Column("effectName", String),
|
||||
Column("description", String),
|
||||
Column("published", Boolean),
|
||||
Column("isAssistance", Boolean),
|
||||
Column("isOffensive", Boolean))
|
||||
Column("isOffensive", Boolean),
|
||||
Column("resistanceID", Integer))
|
||||
|
||||
mapper(Effect, effects_table,
|
||||
properties={
|
||||
"ID" : synonym("effectID"),
|
||||
"name" : synonym("effectName"),
|
||||
"description": deferred(effects_table.c.description)
|
||||
})
|
||||
|
||||
mapper(EffectInfo, effects_table,
|
||||
properties = {"ID" : synonym("effectID"),
|
||||
"name" : synonym("effectName"),
|
||||
"description" : deferred(effects_table.c.description)})
|
||||
|
||||
mapper(Effect, typeeffects_table,
|
||||
properties = {"ID": synonym("effectID"),
|
||||
"info": relation(EffectInfo, lazy=False)})
|
||||
|
||||
Effect.name = association_proxy("info", "name")
|
||||
Effect.description = association_proxy("info", "description")
|
||||
Effect.published = association_proxy("info", "published")
|
||||
mapper(ItemEffect, typeeffects_table)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,16 +15,16 @@
|
||||
#
|
||||
# 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 Column, String, Integer, Boolean, ForeignKey, Table
|
||||
from sqlalchemy.orm import relation, mapper, synonym, deferred
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.types import Group, Icon, Category
|
||||
from eos.gamedata import Category, Group, Icon
|
||||
|
||||
groups_table = Table("invgroups", gamedata_meta,
|
||||
Column("groupID", Integer, primary_key = True),
|
||||
Column("groupID", Integer, primary_key=True),
|
||||
Column("groupName", String),
|
||||
Column("description", String),
|
||||
Column("published", Boolean),
|
||||
@@ -32,8 +32,10 @@ groups_table = Table("invgroups", gamedata_meta,
|
||||
Column("iconID", Integer, ForeignKey("icons.iconID")))
|
||||
|
||||
mapper(Group, groups_table,
|
||||
properties = {"category" : relation(Category, backref = "groups"),
|
||||
"icon" : relation(Icon),
|
||||
"ID" : synonym("groupID"),
|
||||
"name" : synonym("groupName"),
|
||||
"description" : deferred(groups_table.c.description)})
|
||||
properties={
|
||||
"category" : relation(Category, backref="groups"),
|
||||
"icon" : relation(Icon),
|
||||
"ID" : synonym("groupID"),
|
||||
"name" : synonym("groupName"),
|
||||
"description": deferred(groups_table.c.description)
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,19 +15,21 @@
|
||||
#
|
||||
# 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 Column, String, Integer, Table
|
||||
from sqlalchemy.orm import mapper, synonym, deferred
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.types import Icon
|
||||
from eos.gamedata import Icon
|
||||
|
||||
icons_table = Table("icons", gamedata_meta,
|
||||
Column("iconID", Integer, primary_key = True),
|
||||
Column("iconID", Integer, primary_key=True),
|
||||
Column("description", String),
|
||||
Column("iconFile", String))
|
||||
|
||||
mapper(Icon, icons_table,
|
||||
properties = {"ID" : synonym("iconID"),
|
||||
"description" : deferred(icons_table.c.description)})
|
||||
properties={
|
||||
"ID" : synonym("iconID"),
|
||||
"description": deferred(icons_table.c.description)
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,18 +15,19 @@
|
||||
#
|
||||
# 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 Column, String, Integer, Boolean, ForeignKey, Table, Float
|
||||
from sqlalchemy.orm import relation, mapper, synonym, deferred
|
||||
from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.orm import relation, mapper, synonym, deferred
|
||||
from sqlalchemy.orm.collections import attribute_mapped_collection
|
||||
from eos.db.gamedata.effect import typeeffects_table
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.types import Icon, Attribute, Item, Effect, MetaType, Group, Traits
|
||||
from eos.gamedata import Attribute, Effect, Group, Icon, Item, MetaType, Traits
|
||||
|
||||
items_table = Table("invtypes", gamedata_meta,
|
||||
Column("typeID", Integer, primary_key = True),
|
||||
Column("typeID", Integer, primary_key=True),
|
||||
Column("typeName", String, index=True),
|
||||
Column("description", String),
|
||||
Column("raceID", Integer),
|
||||
@@ -39,23 +40,24 @@ items_table = Table("invtypes", gamedata_meta,
|
||||
Column("iconID", Integer, ForeignKey("icons.iconID")),
|
||||
Column("groupID", Integer, ForeignKey("invgroups.groupID"), index=True))
|
||||
|
||||
from .metaGroup import metatypes_table
|
||||
from .traits import traits_table
|
||||
from .metaGroup import metatypes_table # noqa
|
||||
from .traits import traits_table # noqa
|
||||
|
||||
mapper(Item, items_table,
|
||||
properties = {"group" : relation(Group, backref = "items"),
|
||||
"icon" : relation(Icon),
|
||||
"_Item__attributes" : relation(Attribute, collection_class = attribute_mapped_collection('name')),
|
||||
"effects" : relation(Effect, collection_class = attribute_mapped_collection('name')),
|
||||
"metaGroup" : relation(MetaType,
|
||||
primaryjoin = metatypes_table.c.typeID == items_table.c.typeID,
|
||||
uselist = False),
|
||||
"ID" : synonym("typeID"),
|
||||
"name" : synonym("typeName"),
|
||||
"description" : deferred(items_table.c.description),
|
||||
"traits" : relation(Traits,
|
||||
primaryjoin = traits_table.c.typeID == items_table.c.typeID,
|
||||
uselist = False)
|
||||
})
|
||||
properties={
|
||||
"group" : relation(Group, backref="items"),
|
||||
"icon" : relation(Icon),
|
||||
"_Item__attributes": relation(Attribute, 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,
|
||||
uselist=False),
|
||||
"ID" : synonym("typeID"),
|
||||
"name" : synonym("typeName"),
|
||||
"description" : deferred(items_table.c.description),
|
||||
"traits" : relation(Traits,
|
||||
primaryjoin=traits_table.c.typeID == items_table.c.typeID,
|
||||
uselist=False)
|
||||
})
|
||||
|
||||
Item.category = association_proxy("group", "category")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,26 +15,30 @@
|
||||
#
|
||||
# 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 Column, String, Integer, Boolean, ForeignKey, Table
|
||||
from sqlalchemy.orm import relation, mapper, synonym, deferred
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.types import Item, MarketGroup, Icon
|
||||
from eos.gamedata import Icon, Item, MarketGroup
|
||||
|
||||
marketgroups_table = Table("invmarketgroups", gamedata_meta,
|
||||
Column("marketGroupID", Integer, primary_key = True),
|
||||
Column("marketGroupID", Integer, primary_key=True),
|
||||
Column("marketGroupName", String),
|
||||
Column("description", String),
|
||||
Column("hasTypes", Boolean),
|
||||
Column("parentGroupID", Integer, ForeignKey("invmarketgroups.marketGroupID", initially="DEFERRED", deferrable=True)),
|
||||
Column("parentGroupID", Integer,
|
||||
ForeignKey("invmarketgroups.marketGroupID", initially="DEFERRED", deferrable=True)),
|
||||
Column("iconID", Integer, ForeignKey("icons.iconID")))
|
||||
|
||||
mapper(MarketGroup, marketgroups_table,
|
||||
properties = {"items" : relation(Item, backref = "marketGroup"),
|
||||
"parent" : relation(MarketGroup, backref = "children", remote_side = [marketgroups_table.c.marketGroupID]),
|
||||
"icon" : relation(Icon),
|
||||
"ID" : synonym("marketGroupID"),
|
||||
"name" : synonym("marketGroupName"),
|
||||
"description" : deferred(marketgroups_table.c.description)})
|
||||
properties={
|
||||
"items" : relation(Item, backref="marketGroup"),
|
||||
"parent" : relation(MarketGroup, backref="children",
|
||||
remote_side=[marketgroups_table.c.marketGroupID]),
|
||||
"icon" : relation(Icon),
|
||||
"ID" : synonym("marketGroupID"),
|
||||
"name" : synonym("marketGroupName"),
|
||||
"description": deferred(marketgroups_table.c.description)
|
||||
})
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
#===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# 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 Column, Table, String
|
||||
from sqlalchemy.orm import mapper
|
||||
from eos.types import MetaData
|
||||
from eos.db import gamedata_meta
|
||||
|
||||
metadata_table = Table("metadata", gamedata_meta,
|
||||
Column("field_name", String, primary_key=True),
|
||||
Column("field_value", String))
|
||||
|
||||
mapper(MetaData, metadata_table)
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# 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 Column, Table, String
|
||||
from sqlalchemy.orm import mapper
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.gamedata import MetaData
|
||||
|
||||
metadata_table = Table("metadata", gamedata_meta,
|
||||
Column("field_name", String, primary_key=True),
|
||||
Column("field_value", String))
|
||||
|
||||
mapper(MetaData, metadata_table)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,33 +15,37 @@
|
||||
#
|
||||
# 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, ForeignKey, String
|
||||
from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.orm import relation, mapper, synonym
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.db.gamedata.item import items_table
|
||||
from eos.types import MetaGroup, Item, MetaType
|
||||
from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from eos.gamedata import Item, MetaGroup, MetaType
|
||||
|
||||
metagroups_table = Table("invmetagroups", gamedata_meta,
|
||||
Column("metaGroupID", Integer, primary_key = True),
|
||||
Column("metaGroupID", Integer, primary_key=True),
|
||||
Column("metaGroupName", String))
|
||||
|
||||
metatypes_table = Table("invmetatypes", gamedata_meta,
|
||||
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key = True),
|
||||
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True),
|
||||
Column("parentTypeID", Integer, ForeignKey("invtypes.typeID")),
|
||||
Column("metaGroupID", Integer, ForeignKey("invmetagroups.metaGroupID")))
|
||||
|
||||
mapper(MetaGroup, metagroups_table,
|
||||
properties = {"ID" : synonym("metaGroupID"),
|
||||
"name" : synonym("metaGroupName")})
|
||||
properties={
|
||||
"ID" : synonym("metaGroupID"),
|
||||
"name": synonym("metaGroupName")
|
||||
})
|
||||
|
||||
mapper(MetaType, metatypes_table,
|
||||
properties = {"ID" : synonym("metaGroupID"),
|
||||
"parent" : relation(Item, primaryjoin = metatypes_table.c.parentTypeID == items_table.c.typeID),
|
||||
"items" : relation(Item, primaryjoin = metatypes_table.c.typeID == items_table.c.typeID),
|
||||
"info": relation(MetaGroup, lazy=False)})
|
||||
properties={
|
||||
"ID" : synonym("metaGroupID"),
|
||||
"parent": relation(Item, primaryjoin=metatypes_table.c.parentTypeID == items_table.c.typeID),
|
||||
"items" : relation(Item, primaryjoin=metatypes_table.c.typeID == items_table.c.typeID),
|
||||
"info" : relation(MetaGroup, lazy=False)
|
||||
})
|
||||
|
||||
MetaType.name = association_proxy("info", "name")
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,21 +15,23 @@
|
||||
#
|
||||
# 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.orm import join, exc, aliased
|
||||
from sqlalchemy.sql import and_, or_, select
|
||||
|
||||
import eos.config
|
||||
from eos.db import gamedata_session
|
||||
from eos.db.gamedata.metaGroup import metatypes_table, items_table
|
||||
from sqlalchemy.sql import and_, or_, select, func
|
||||
from sqlalchemy.orm import join, exc
|
||||
from eos.types import Item, Category, Group, MarketGroup, AttributeInfo, MetaData, MetaGroup
|
||||
from eos.db.gamedata.group import groups_table
|
||||
from eos.db.util import processEager, processWhere
|
||||
import eos.config
|
||||
from eos.gamedata import AlphaClone, Attribute, Category, Group, Item, MarketGroup, MetaGroup, AttributeInfo, MetaData
|
||||
|
||||
cache = {}
|
||||
configVal = getattr(eos.config, "gamedataCache", None)
|
||||
if configVal is True:
|
||||
def cachedQuery(amount, *keywords):
|
||||
def deco(function):
|
||||
cache = {}
|
||||
def checkAndReturn(*args, **kwargs):
|
||||
useCache = kwargs.pop("useCache", True)
|
||||
cacheKey = []
|
||||
@@ -45,6 +47,7 @@ if configVal is True:
|
||||
return handler
|
||||
|
||||
return checkAndReturn
|
||||
|
||||
return deco
|
||||
|
||||
elif callable(configVal):
|
||||
@@ -56,8 +59,10 @@ else:
|
||||
return function(*args, **kwargs)
|
||||
|
||||
return checkAndReturn
|
||||
|
||||
return deco
|
||||
|
||||
|
||||
def sqlizeString(line):
|
||||
# Escape backslashes first, as they will be as escape symbol in queries
|
||||
# Then escape percent and underscore signs
|
||||
@@ -65,7 +70,10 @@ def sqlizeString(line):
|
||||
line = line.replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_").replace("*", "%")
|
||||
return line
|
||||
|
||||
|
||||
itemNameMap = {}
|
||||
|
||||
|
||||
@cachedQuery(1, "lookfor")
|
||||
def getItem(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
@@ -88,7 +96,57 @@ def getItem(lookfor, eager=None):
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return item
|
||||
|
||||
|
||||
@cachedQuery(1, "lookfor")
|
||||
def getItems(lookfor, eager=None):
|
||||
"""
|
||||
Gets a list of items. Does a bit of cache hackery to get working properly -- cache
|
||||
is usually based on function calls with the parameters, needed to extract data directly.
|
||||
Works well enough. Not currently used, but it's here for possible future inclusion
|
||||
"""
|
||||
|
||||
toGet = []
|
||||
results = []
|
||||
|
||||
for id in lookfor:
|
||||
if (id, None) in cache:
|
||||
results.append(cache.get((id, None)))
|
||||
else:
|
||||
toGet.append(id)
|
||||
|
||||
if len(toGet) > 0:
|
||||
# Get items that aren't currently cached, and store them in the cache
|
||||
items = gamedata_session.query(Item).filter(Item.ID.in_(toGet)).all()
|
||||
for item in items:
|
||||
cache[(item.ID, None)] = item
|
||||
results += items
|
||||
|
||||
# sort the results based on the original indexing
|
||||
results.sort(key=lambda x: lookfor.index(x.ID))
|
||||
return results
|
||||
|
||||
|
||||
@cachedQuery(1, "lookfor")
|
||||
def getAlphaClone(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
if eager is None:
|
||||
item = gamedata_session.query(AlphaClone).get(lookfor)
|
||||
else:
|
||||
item = gamedata_session.query(AlphaClone).options(*processEager(eager)).filter(AlphaClone.ID == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
return item
|
||||
|
||||
|
||||
def getAlphaCloneList(eager=None):
|
||||
eager = processEager(eager)
|
||||
clones = gamedata_session.query(AlphaClone).options(*eager).all()
|
||||
return clones
|
||||
|
||||
|
||||
groupNameMap = {}
|
||||
|
||||
|
||||
@cachedQuery(1, "lookfor")
|
||||
def getGroup(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
@@ -111,63 +169,78 @@ def getGroup(lookfor, eager=None):
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return group
|
||||
|
||||
|
||||
categoryNameMap = {}
|
||||
|
||||
|
||||
@cachedQuery(1, "lookfor")
|
||||
def getCategory(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
if eager is None:
|
||||
category = gamedata_session.query(Category).get(lookfor)
|
||||
else:
|
||||
category = gamedata_session.query(Category).options(*processEager(eager)).filter(Category.ID == lookfor).first()
|
||||
category = gamedata_session.query(Category).options(*processEager(eager)).filter(
|
||||
Category.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
if lookfor in categoryNameMap:
|
||||
id = categoryNameMap[lookfor]
|
||||
if eager is None:
|
||||
category = gamedata_session.query(Category).get(id)
|
||||
else:
|
||||
category = gamedata_session.query(Category).options(*processEager(eager)).filter(Category.ID == id).first()
|
||||
category = gamedata_session.query(Category).options(*processEager(eager)).filter(
|
||||
Category.ID == id).first()
|
||||
else:
|
||||
# Category names are unique, so we can use first() instead of one()
|
||||
category = gamedata_session.query(Category).options(*processEager(eager)).filter(Category.name == lookfor).first()
|
||||
category = gamedata_session.query(Category).options(*processEager(eager)).filter(
|
||||
Category.name == lookfor).first()
|
||||
categoryNameMap[lookfor] = category.ID
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return category
|
||||
|
||||
|
||||
metaGroupNameMap = {}
|
||||
|
||||
|
||||
@cachedQuery(1, "lookfor")
|
||||
def getMetaGroup(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
if eager is None:
|
||||
metaGroup = gamedata_session.query(MetaGroup).get(lookfor)
|
||||
else:
|
||||
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(MetaGroup.ID == lookfor).first()
|
||||
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(
|
||||
MetaGroup.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
if lookfor in metaGroupNameMap:
|
||||
id = metaGroupNameMap[lookfor]
|
||||
if eager is None:
|
||||
metaGroup = gamedata_session.query(MetaGroup).get(id)
|
||||
else:
|
||||
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(MetaGroup.ID == id).first()
|
||||
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(
|
||||
MetaGroup.ID == id).first()
|
||||
else:
|
||||
# MetaGroup names are unique, so we can use first() instead of one()
|
||||
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(MetaGroup.name == lookfor).first()
|
||||
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(
|
||||
MetaGroup.name == lookfor).first()
|
||||
metaGroupNameMap[lookfor] = metaGroup.ID
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return metaGroup
|
||||
|
||||
|
||||
@cachedQuery(1, "lookfor")
|
||||
def getMarketGroup(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
if eager is None:
|
||||
marketGroup = gamedata_session.query(MarketGroup).get(lookfor)
|
||||
else:
|
||||
marketGroup = gamedata_session.query(MarketGroup).options(*processEager(eager)).filter(MarketGroup.ID == lookfor).first()
|
||||
marketGroup = gamedata_session.query(MarketGroup).options(*processEager(eager)).filter(
|
||||
MarketGroup.ID == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
return marketGroup
|
||||
|
||||
|
||||
@cachedQuery(2, "where", "filter")
|
||||
def getItemsByCategory(filter, where=None, eager=None):
|
||||
if isinstance(filter, int):
|
||||
@@ -178,7 +251,9 @@ def getItemsByCategory(filter, where=None, eager=None):
|
||||
raise TypeError("Need integer or string as argument")
|
||||
|
||||
filter = processWhere(filter, where)
|
||||
return gamedata_session.query(Item).options(*processEager(eager)).join(Item.group, Group.category).filter(filter).all()
|
||||
return gamedata_session.query(Item).options(*processEager(eager)).join(Item.group, Group.category).filter(
|
||||
filter).all()
|
||||
|
||||
|
||||
@cachedQuery(3, "where", "nameLike", "join")
|
||||
def searchItems(nameLike, where=None, join=None, eager=None):
|
||||
@@ -194,12 +269,32 @@ 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))
|
||||
items = items.filter(processWhere(Item.name.like(token_safe, escape="\\"), where))
|
||||
if where is not None:
|
||||
items = items.filter(and_(Item.name.like(token_safe, escape="\\"), where))
|
||||
else:
|
||||
items = items.filter(Item.name.like(token_safe, escape="\\"))
|
||||
items = items.limit(100).all()
|
||||
return items
|
||||
|
||||
|
||||
@cachedQuery(3, "where", "nameLike", "join")
|
||||
def searchSkills(nameLike, where=None, eager=None):
|
||||
if not isinstance(nameLike, basestring):
|
||||
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))
|
||||
if where is not None:
|
||||
items = items.filter(and_(Item.name.like(token_safe, escape="\\"), Category.ID == 16, where))
|
||||
else:
|
||||
items = items.filter(and_(Item.name.like(token_safe, escape="\\"), Category.ID == 16))
|
||||
items = items.limit(100).all()
|
||||
return items
|
||||
|
||||
|
||||
@cachedQuery(2, "where", "itemids")
|
||||
def getVariations(itemids, where=None, eager=None):
|
||||
def getVariations(itemids, groupIDs=None, where=None, eager=None):
|
||||
for itemid in itemids:
|
||||
if not isinstance(itemid, int):
|
||||
raise TypeError("All passed item IDs must be integers")
|
||||
@@ -210,8 +305,20 @@ def getVariations(itemids, where=None, eager=None):
|
||||
itemfilter = or_(*(metatypes_table.c.parentTypeID == itemid for itemid in itemids))
|
||||
filter = processWhere(itemfilter, where)
|
||||
joinon = items_table.c.typeID == metatypes_table.c.typeID
|
||||
vars = gamedata_session.query(Item).options(*processEager(eager)).join((metatypes_table, joinon)).filter(filter).all()
|
||||
return vars
|
||||
vars = gamedata_session.query(Item).options(*processEager(eager)).join((metatypes_table, joinon)).filter(
|
||||
filter).all()
|
||||
|
||||
if vars:
|
||||
return vars
|
||||
elif groupIDs:
|
||||
itemfilter = or_(*(groups_table.c.groupID == groupID for groupID in groupIDs))
|
||||
filter = processWhere(itemfilter, where)
|
||||
joinon = items_table.c.groupID == groups_table.c.groupID
|
||||
vars = gamedata_session.query(Item).options(*processEager(eager)).join((groups_table, joinon)).filter(
|
||||
filter).all()
|
||||
|
||||
return vars
|
||||
|
||||
|
||||
@cachedQuery(1, "attr")
|
||||
def getAttributeInfo(attr, eager=None):
|
||||
@@ -227,6 +334,7 @@ def getAttributeInfo(attr, eager=None):
|
||||
result = None
|
||||
return result
|
||||
|
||||
|
||||
@cachedQuery(1, "field")
|
||||
def getMetaData(field):
|
||||
if isinstance(field, basestring):
|
||||
@@ -235,6 +343,7 @@ def getMetaData(field):
|
||||
raise TypeError("Need string as argument")
|
||||
return data
|
||||
|
||||
|
||||
@cachedQuery(2, "itemIDs", "attributeID")
|
||||
def directAttributeRequest(itemIDs, attrIDs):
|
||||
for itemID in itemIDs:
|
||||
@@ -244,9 +353,31 @@ def directAttributeRequest(itemIDs, attrIDs):
|
||||
if not isinstance(itemID, int):
|
||||
raise TypeError("All itemIDs must be integer")
|
||||
|
||||
q = select((eos.types.Item.typeID, eos.types.Attribute.attributeID, eos.types.Attribute.value),
|
||||
and_(eos.types.Attribute.attributeID.in_(attrIDs), eos.types.Item.typeID.in_(itemIDs)),
|
||||
from_obj=[join(eos.types.Attribute, eos.types.Item)])
|
||||
q = select((Item.typeID, Attribute.attributeID, Attribute.value),
|
||||
and_(Attribute.attributeID.in_(attrIDs), Item.typeID.in_(itemIDs)),
|
||||
from_obj=[join(Attribute, Item)])
|
||||
|
||||
result = gamedata_session.execute(q).fetchall()
|
||||
return result
|
||||
|
||||
|
||||
def getRequiredFor(itemID, attrMapping):
|
||||
Attribute1 = aliased(Attribute)
|
||||
Attribute2 = aliased(Attribute)
|
||||
|
||||
skillToLevelClauses = []
|
||||
|
||||
for attrSkill, attrLevel in attrMapping.iteritems():
|
||||
skillToLevelClauses.append(and_(Attribute1.attributeID == attrSkill, Attribute2.attributeID == attrLevel))
|
||||
|
||||
queryOr = or_(*skillToLevelClauses)
|
||||
|
||||
q = select((Attribute2.typeID, Attribute2.value),
|
||||
and_(Attribute1.value == itemID, queryOr),
|
||||
from_obj=[
|
||||
join(Attribute1, Attribute2, Attribute1.typeID == Attribute2.typeID)
|
||||
])
|
||||
|
||||
result = gamedata_session.execute(q).fetchall()
|
||||
|
||||
return result
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
from sqlalchemy import Column, Table, Integer, String, ForeignKey
|
||||
from sqlalchemy.orm import mapper
|
||||
from eos.types import Traits
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.gamedata import Traits
|
||||
|
||||
traits_table = Table("invtraits", gamedata_meta,
|
||||
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True),
|
||||
Column("traitText", String))
|
||||
|
||||
mapper(Traits, traits_table);
|
||||
mapper(Traits, traits_table)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,19 +15,21 @@
|
||||
#
|
||||
# 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 Column, Table, Integer, String
|
||||
from sqlalchemy.orm import mapper, synonym
|
||||
|
||||
from eos.db import gamedata_meta
|
||||
from eos.types import Unit
|
||||
from eos.gamedata import Unit
|
||||
|
||||
groups_table = Table("dgmunits", gamedata_meta,
|
||||
Column("unitID", Integer, primary_key = True),
|
||||
Column("unitID", Integer, primary_key=True),
|
||||
Column("unitName", String),
|
||||
Column("displayName", String))
|
||||
|
||||
mapper(Unit, groups_table,
|
||||
properties = {"ID" : synonym("unitID"),
|
||||
"name" : synonym("unitName")})
|
||||
properties={
|
||||
"ID" : synonym("unitID"),
|
||||
"name": synonym("unitName")
|
||||
})
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
import config
|
||||
from logbook import Logger
|
||||
import shutil
|
||||
import time
|
||||
import re
|
||||
import os
|
||||
|
||||
import config
|
||||
import migrations
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
def getVersion(db):
|
||||
cursor = db.execute('PRAGMA user_version')
|
||||
return cursor.fetchone()[0]
|
||||
|
||||
|
||||
def getAppVersion():
|
||||
return migrations.appVersion
|
||||
|
||||
|
||||
def update(saveddata_engine):
|
||||
dbVersion = getVersion(saveddata_engine)
|
||||
appVersion = getAppVersion()
|
||||
@@ -21,7 +26,7 @@ def update(saveddata_engine):
|
||||
|
||||
if dbVersion < appVersion:
|
||||
# Automatically backup database
|
||||
toFile = "%s/saveddata_migration_%d-%d_%s.db"%(
|
||||
toFile = "%s/saveddata_migration_%d-%d_%s.db" % (
|
||||
config.savePath,
|
||||
dbVersion,
|
||||
appVersion,
|
||||
@@ -30,10 +35,9 @@ def update(saveddata_engine):
|
||||
shutil.copyfile(config.saveDB, toFile)
|
||||
|
||||
for version in xrange(dbVersion, appVersion):
|
||||
|
||||
func = migrations.updates[version+1]
|
||||
func = migrations.updates[version + 1]
|
||||
if func:
|
||||
print "applying update",version+1
|
||||
pyfalog.info("Applying database update: {0}", version + 1)
|
||||
func(saveddata_engine)
|
||||
|
||||
# when all is said and done, set version to current
|
||||
|
||||
@@ -11,7 +11,6 @@ upgrade files 1-5)
|
||||
import pkgutil
|
||||
import re
|
||||
|
||||
|
||||
updates = {}
|
||||
appVersion = 0
|
||||
|
||||
|
||||
@@ -14,50 +14,50 @@ Migration 1
|
||||
import sqlalchemy
|
||||
|
||||
CONVERSIONS = {
|
||||
6135: [ # Scoped Cargo Scanner
|
||||
6135 : [ # Scoped Cargo Scanner
|
||||
6133, # Interior Type-E Cargo Identifier
|
||||
],
|
||||
6527: [ # Compact Ship Scanner
|
||||
6527 : [ # Compact Ship Scanner
|
||||
6525, # Ta3 Perfunctory Vessel Probe
|
||||
6529, # Speculative Ship Identifier I
|
||||
6531, # Practical Type-E Ship Probe
|
||||
],
|
||||
6569: [ # Scoped Survey Scanner
|
||||
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
|
||||
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
|
||||
8135 : [ # Restrained Capacitor Flux Coil
|
||||
8131, # Local Power Plant Manager: Capacitor Flux I
|
||||
],
|
||||
8133: [ # Compact Capacitor Flux Coil
|
||||
8133 : [ # Compact Capacitor Flux Coil
|
||||
8137, # Mark I Generator Refitting: Capacitor Flux
|
||||
],
|
||||
3469: [ # Basic Co-Processor
|
||||
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)
|
||||
# anyway as some fits may include it)
|
||||
],
|
||||
8748: [ # Upgraded Co-Processor
|
||||
8748 : [ # Upgraded Co-Processor
|
||||
8747, # Nanomechanical CPU Enhancer I
|
||||
8750, # Quantum Co-Processor I
|
||||
8749, # Photonic CPU Enhancer I
|
||||
],
|
||||
1351: [ # Basic Reactor Control Unit
|
||||
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
|
||||
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
|
||||
@@ -69,19 +69,20 @@ CONVERSIONS = {
|
||||
31936: [ # Navy Micro Auxiliary Power Core
|
||||
16543, # Micro 'Vigor' Core Augmentation
|
||||
],
|
||||
8089: [ # Compact Light Missile Launcher
|
||||
8093, # Prototype 'Arbalest' Light Missile Launcher
|
||||
8089 : [ # Compact Light Missile Launcher
|
||||
8093, # Prototype 'Arbalest' Light Missile Launcher
|
||||
],
|
||||
8091: [ # Ample 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
|
||||
442 : [ # Cargo Scanner I
|
||||
6129, # Surface Cargo Scanner I
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Update fits schema to include target resists attribute
|
||||
try:
|
||||
@@ -92,6 +93,7 @@ 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))
|
||||
|
||||
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))
|
||||
|
||||
@@ -6,6 +6,7 @@ Migration 10
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Update projectedFits schema to include active attribute
|
||||
try:
|
||||
|
||||
116
eos/db/migrations/upgrade11.py
Normal file
116
eos/db/migrations/upgrade11.py
Normal file
@@ -0,0 +1,116 @@
|
||||
"""
|
||||
Migration 11
|
||||
|
||||
- Converts modules based on December Release 2015 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 = {
|
||||
16467: ( # Medium Gremlin Compact Energy Neutralizer
|
||||
16471, # Medium Unstable Power Fluctuator I
|
||||
),
|
||||
22947: ( # 'Beatnik' Small Remote Armor Repairer
|
||||
23414, # 'Brotherhood' Small Remote Armor Repairer
|
||||
),
|
||||
8295 : ( # Type-D Restrained Shield Flux Coil
|
||||
8293, # Beta Reactor Control: Shield Flux I
|
||||
),
|
||||
16499: ( # Heavy Knave Scoped Energy Nosferatu
|
||||
16501, # E500 Prototype Energy Vampire
|
||||
),
|
||||
16477: ( # Heavy Infectious Scoped Energy Neutralizer
|
||||
16473, # Heavy Rudimentary Energy Destabilizer I
|
||||
),
|
||||
16475: ( # Heavy Gremlin Compact Energy Neutralizer
|
||||
16479, # Heavy Unstable Power Fluctuator I
|
||||
),
|
||||
16447: ( # Medium Solace Scoped Remote Armor Repairer
|
||||
16445, # Medium 'Arup' Remote Armor Repairer
|
||||
),
|
||||
508 : ( # 'Basic' Shield Flux Coil
|
||||
8325, # Alpha Reactor Shield Flux
|
||||
8329, # Marked Generator Refitting: Shield Flux
|
||||
8323, # Partial Power Plant Manager: Shield Flux
|
||||
8327, # Type-E Power Core Modification: Shield Flux
|
||||
),
|
||||
1419 : ( # 'Basic' Shield Power Relay
|
||||
8341, # Alpha Reactor Shield Power Relay
|
||||
8345, # Marked Generator Refitting: Shield Power Relay
|
||||
8339, # Partial Power Plant Manager: Shield Power Relay
|
||||
8343, # Type-E Power Core Modification: Shield Power Relay
|
||||
),
|
||||
16439: ( # Small Solace Scoped Remote Armor Repairer
|
||||
16437, # Small 'Arup' Remote Armor Repairer
|
||||
),
|
||||
16505: ( # Medium Ghoul Compact Energy Nosferatu
|
||||
16511, # Medium Diminishing Power System Drain I
|
||||
),
|
||||
8297 : ( # Mark I Compact Shield Flux Coil
|
||||
8291, # Local Power Plant Manager: Reaction Shield Flux I
|
||||
),
|
||||
16455: ( # Large Solace Scoped Remote Armor Repairer
|
||||
16453, # Large 'Arup' Remote Armor Repairer
|
||||
),
|
||||
6485 : ( # M51 Benefactor Compact Shield Recharger
|
||||
6491, # Passive Barrier Compensator I
|
||||
6489, # 'Benefactor' Ward Reconstructor
|
||||
6487, # Supplemental Screen Generator I
|
||||
),
|
||||
5137 : ( # Small Knave Scoped Energy Nosferatu
|
||||
5135, # E5 Prototype Energy Vampire
|
||||
),
|
||||
8579 : ( # Medium Murky Compact Remote Shield Booster
|
||||
8581, # Medium 'Atonement' Remote Shield Booster
|
||||
),
|
||||
8531 : ( # Small Murky Compact Remote Shield Booster
|
||||
8533, # Small 'Atonement' Remote Shield Booster
|
||||
),
|
||||
16497: ( # Heavy Ghoul Compact Energy Nosferatu
|
||||
16503, # Heavy Diminishing Power System Drain I
|
||||
),
|
||||
4477 : ( # Small Gremlin Compact Energy Neutralizer
|
||||
4475, # Small Unstable Power Fluctuator I
|
||||
),
|
||||
8337 : ( # Mark I Compact Shield Power Relay
|
||||
8331, # Local Power Plant Manager: Reaction Shield Power Relay I
|
||||
),
|
||||
23416: ( # 'Peace' Large Remote Armor Repairer
|
||||
22951, # 'Pacifier' Large Remote Armor Repairer
|
||||
),
|
||||
5141 : ( # Small Ghoul Compact Energy Nosferatu
|
||||
5139, # Small Diminishing Power System Drain I
|
||||
),
|
||||
4471 : ( # Small Infectious Scoped Energy Neutralizer
|
||||
4473, # Small Rudimentary Energy Destabilizer I
|
||||
),
|
||||
16469: ( # Medium Infectious Scoped Energy Neutralizer
|
||||
16465, # Medium Rudimentary Energy Destabilizer I
|
||||
),
|
||||
8335 : ( # Type-D Restrained Shield Power Relay
|
||||
8333, # Beta Reactor Control: Shield Power Relay I
|
||||
),
|
||||
405 : ( # 'Micro' Remote Shield Booster
|
||||
8631, # Micro Asymmetric Remote Shield Booster
|
||||
8627, # Micro Murky Remote Shield Booster
|
||||
8629, # Micro 'Atonement' Remote Shield Booster
|
||||
8633, # Micro S95a Remote Shield Booster
|
||||
),
|
||||
8635 : ( # Large Murky Compact Remote Shield Booster
|
||||
8637, # Large 'Atonement' Remote Shield Booster
|
||||
),
|
||||
16507: ( # Medium Knave Scoped Energy Nosferatu
|
||||
16509, # E50 Prototype Energy Vampire
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
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))
|
||||
340
eos/db/migrations/upgrade12.py
Normal file
340
eos/db/migrations/upgrade12.py
Normal file
@@ -0,0 +1,340 @@
|
||||
"""
|
||||
Migration 12
|
||||
|
||||
- Converts modules based on March 2016 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 = {
|
||||
16457: ( # Crosslink Compact Ballistic Control System
|
||||
16459, # Muon Coil Bolt Array I
|
||||
16461, # Multiphasic Bolt Array I
|
||||
16463, # 'Pandemonium' Ballistic Enhancement
|
||||
),
|
||||
5281 : ( # Coadjunct Scoped Remote Sensor Booster
|
||||
7218, # Piercing ECCM Emitter I
|
||||
),
|
||||
5365 : ( # Cetus Scoped Burst Jammer
|
||||
5359, # 1Z-3 Subversive ECM Eruption
|
||||
),
|
||||
1973 : ( # Sensor Booster I
|
||||
1947, # ECCM - Radar I
|
||||
2002, # ECCM - Ladar I
|
||||
2003, # ECCM - Magnetometric I
|
||||
2004, # ECCM - Gravimetric I
|
||||
2005, # ECCM - Omni I
|
||||
),
|
||||
1951 : ( # 'Basic' Tracking Enhancer
|
||||
6322, # Beta-Nought Tracking Mode
|
||||
6323, # Azimuth Descalloping Tracking Enhancer
|
||||
6324, # F-AQ Delay-Line Scan Tracking Subroutines
|
||||
6321, # Beam Parallax Tracking Program
|
||||
),
|
||||
521 : ( # 'Basic' Damage Control
|
||||
5829, # GLFF Containment Field
|
||||
5831, # Interior Force Field Array
|
||||
5835, # F84 Local Damage System
|
||||
5833, # Systematic Damage Control
|
||||
),
|
||||
22925: ( # 'Bootleg' Remote Sensor Booster
|
||||
22939, # 'Boss' Remote Sensor Booster
|
||||
22941, # 'Entrepreneur' Remote Sensor Booster
|
||||
),
|
||||
5443 : ( # Faint Epsilon Scoped Warp Scrambler
|
||||
5441, # Fleeting Progressive Warp Scrambler I
|
||||
),
|
||||
1963 : ( # Remote Sensor Booster I
|
||||
1959, # ECCM Projector I
|
||||
),
|
||||
6325 : ( # Fourier Compact Tracking Enhancer
|
||||
6326, # Sigma-Nought Tracking Mode I
|
||||
6327, # Auto-Gain Control Tracking Enhancer I
|
||||
6328, # F-aQ Phase Code Tracking Subroutines
|
||||
),
|
||||
21486: ( # 'Kindred' Gyrostabilizer
|
||||
21488, # Monophonic Stabilization Actuator I
|
||||
),
|
||||
19927: ( # Hypnos Scoped Magnetometric ECM
|
||||
9518, # Initiated Ion Field ECM I
|
||||
),
|
||||
10188: ( # 'Basic' Magnetic Field Stabilizer
|
||||
11111, # Insulated Stabilizer Array
|
||||
11109, # Linear Flux Stabilizer
|
||||
11115, # Gauss Field Balancer
|
||||
11113, # Magnetic Vortex Stabilizer
|
||||
),
|
||||
22919: ( # 'Monopoly' Magnetic Field Stabilizer
|
||||
22917, # 'Capitalist' Magnetic Field Stabilizer I
|
||||
),
|
||||
5839 : ( # IFFA Compact Damage Control
|
||||
5841, # Emergency Damage Control I
|
||||
5843, # F85 Peripheral Damage System I
|
||||
5837, # Pseudoelectron Containment Field I
|
||||
),
|
||||
522 : ( # 'Micro' Cap Battery
|
||||
4747, # Micro Ld-Acid Capacitor Battery I
|
||||
4751, # Micro Ohm Capacitor Reserve I
|
||||
4745, # Micro F-4a Ld-Sulfate Capacitor Charge Unit
|
||||
4749, # Micro Peroxide Capacitor Power Cell
|
||||
3480, # Micro Capacitor Battery II
|
||||
),
|
||||
518 : ( # 'Basic' Gyrostabilizer
|
||||
5915, # Lateral Gyrostabilizer
|
||||
5919, # F-M2 Weapon Inertial Suspensor
|
||||
5913, # Hydraulic Stabilization Actuator
|
||||
5917, # Stabilized Weapon Mounts
|
||||
),
|
||||
19931: ( # Compulsive Scoped Multispectral ECM
|
||||
19933, # 'Hypnos' Multispectral ECM I
|
||||
),
|
||||
5403 : ( # Faint Scoped Warp Disruptor
|
||||
5401, # Fleeting Warp Disruptor I
|
||||
),
|
||||
23902: ( # 'Trebuchet' Heat Sink I
|
||||
23900, # 'Mangonel' Heat Sink I
|
||||
),
|
||||
1893 : ( # 'Basic' Heat Sink
|
||||
5845, # Heat Exhaust System
|
||||
5856, # C3S Convection Thermal Radiator
|
||||
5855, # 'Boreas' Coolant System
|
||||
5854, # Stamped Heat Sink
|
||||
),
|
||||
6160 : ( # F-90 Compact Sensor Booster
|
||||
20214, # Extra Radar ECCM Scanning Array I
|
||||
20220, # Extra Ladar ECCM Scanning Array I
|
||||
20226, # Extra Gravimetric ECCM Scanning Array I
|
||||
20232, # Extra Magnetometric ECCM Scanning Array I
|
||||
7948, # Gravimetric Positional ECCM Sensor System I
|
||||
7964, # Radar Positional ECCM Sensor System I
|
||||
7965, # Omni Positional ECCM Sensor System I
|
||||
7966, # Ladar Positional ECCM Sensor System I
|
||||
7970, # Magnetometric Positional ECCM Sensor System I
|
||||
20218, # Conjunctive Radar ECCM Scanning Array I
|
||||
20224, # Conjunctive Ladar ECCM Scanning Array I
|
||||
20230, # Conjunctive Gravimetric ECCM Scanning Array I
|
||||
20236, # Conjunctive Magnetometric ECCM Scanning Array I
|
||||
6157, # Supplemental Scanning CPU I
|
||||
),
|
||||
23418: ( # 'Radical' Damage Control
|
||||
22893, # 'Gonzo' Damage Control I
|
||||
),
|
||||
19952: ( # Umbra Scoped Radar ECM
|
||||
9520, # 'Penumbra' White Noise ECM
|
||||
),
|
||||
1952 : ( # Sensor Booster II
|
||||
2258, # ECCM - Omni II
|
||||
2259, # ECCM - Gravimetric II
|
||||
2260, # ECCM - Ladar II
|
||||
2261, # ECCM - Magnetometric II
|
||||
2262, # ECCM - Radar II
|
||||
),
|
||||
5282 : ( # Linked Enduring Sensor Booster
|
||||
7219, # Scattering ECCM Projector I
|
||||
),
|
||||
1986 : ( # Signal Amplifier I
|
||||
2579, # Gravimetric Backup Array I
|
||||
2583, # Ladar Backup Array I
|
||||
2587, # Magnetometric Backup Array I
|
||||
2591, # Multi Sensor Backup Array I
|
||||
4013, # RADAR Backup Array I
|
||||
),
|
||||
4871 : ( # Large Compact Pb-Acid Cap Battery
|
||||
4875, # Large Ohm Capacitor Reserve I
|
||||
4869, # Large F-4a Ld-Sulfate Capacitor Charge Unit
|
||||
4873, # Large Peroxide Capacitor Power Cell
|
||||
),
|
||||
1964 : ( # Remote Sensor Booster II
|
||||
1960, # ECCM Projector II
|
||||
),
|
||||
5933 : ( # Counterbalanced Compact Gyrostabilizer
|
||||
5931, # Cross-Lateral Gyrostabilizer I
|
||||
5935, # F-M3 Munition Inertial Suspensor
|
||||
5929, # Pneumatic Stabilization Actuator I
|
||||
),
|
||||
4025 : ( # X5 Enduring Stasis Webifier
|
||||
4029, # 'Langour' Drive Disruptor I
|
||||
),
|
||||
4027 : ( # Fleeting Compact Stasis Webifier
|
||||
4031, # Patterned Stasis Web I
|
||||
),
|
||||
22937: ( # 'Enterprise' Remote Tracking Computer
|
||||
22935, # 'Tycoon' Remote Tracking Computer
|
||||
),
|
||||
22929: ( # 'Marketeer' Tracking Computer
|
||||
22927, # 'Economist' Tracking Computer I
|
||||
),
|
||||
1987 : ( # Signal Amplifier II
|
||||
2580, # Gravimetric Backup Array II
|
||||
2584, # Ladar Backup Array II
|
||||
2588, # Magnetometric Backup Array II
|
||||
2592, # Multi Sensor Backup Array II
|
||||
4014, # RADAR Backup Array II
|
||||
),
|
||||
19939: ( # Enfeebling Scoped Ladar ECM
|
||||
9522, # Faint Phase Inversion ECM I
|
||||
),
|
||||
5340 : ( # P-S Compact Remote Tracking Computer
|
||||
5341, # 'Prayer' Remote Tracking Computer
|
||||
),
|
||||
19814: ( # Phased Scoped Target Painter
|
||||
19808, # Partial Weapon Navigation
|
||||
),
|
||||
1949 : ( # 'Basic' Signal Amplifier
|
||||
1946, # Basic RADAR Backup Array
|
||||
1982, # Basic Ladar Backup Array
|
||||
1983, # Basic Gravimetric Backup Array
|
||||
1984, # Basic Magnetometric Backup Array
|
||||
1985, # Basic Multi Sensor Backup Array
|
||||
6193, # Emergency Magnetometric Scanners
|
||||
6194, # Emergency Multi-Frequency Scanners
|
||||
6202, # Emergency RADAR Scanners
|
||||
6216, # Emergency Ladar Scanners
|
||||
6217, # Emergency Gravimetric Scanners
|
||||
6225, # Sealed RADAR Backup Cluster
|
||||
6238, # Sealed Magnetometric Backup Cluster
|
||||
6239, # Sealed Multi-Frequency Backup Cluster
|
||||
6241, # Sealed Ladar Backup Cluster
|
||||
6242, # Sealed Gravimetric Backup Cluster
|
||||
6257, # Surplus RADAR Reserve Array
|
||||
6258, # F-42 Reiterative RADAR Backup Sensors
|
||||
6283, # Surplus Magnetometric Reserve Array
|
||||
6284, # F-42 Reiterative Magnetometric Backup Sensors
|
||||
6285, # Surplus Multi-Frequency Reserve Array
|
||||
6286, # F-42 Reiterative Multi-Frequency Backup Sensors
|
||||
6289, # Surplus Ladar Reserve Array
|
||||
6290, # F-42 Reiterative Ladar Backup Sensors
|
||||
6291, # Surplus Gravimetric Reserve Array
|
||||
6292, # F-42 Reiterative Gravimetric Backup Sensors
|
||||
6309, # Amplitude Signal Enhancer
|
||||
6310, # 'Acolyth' Signal Booster
|
||||
6311, # Type-E Discriminative Signal Augmentation
|
||||
6312, # F-90 Positional Signal Amplifier
|
||||
),
|
||||
21527: ( # 'Firewall' Signal Amplifier
|
||||
21521, # Gravimetric Firewall
|
||||
21523, # Ladar Firewall
|
||||
21525, # Magnetometric Firewall
|
||||
21527, # Multi Sensor Firewall
|
||||
21529, # RADAR Firewall
|
||||
),
|
||||
23416: ( # 'Peace' Large Remote Armor Repairer
|
||||
None, # 'Pacifier' Large Remote Armor Repairer
|
||||
),
|
||||
6176 : ( # F-12 Enduring Tracking Computer
|
||||
6174, # Monopulse Tracking Mechanism I
|
||||
),
|
||||
6159 : ( # Alumel-Wired Enduring Sensor Booster
|
||||
7917, # Alumel Radar ECCM Sensor Array I
|
||||
7918, # Alumel Ladar ECCM Sensor Array I
|
||||
7922, # Alumel Gravimetric ECCM Sensor Array I
|
||||
7926, # Alumel Omni ECCM Sensor Array I
|
||||
7937, # Alumel Magnetometric ECCM Sensor Array I
|
||||
7867, # Supplemental Ladar ECCM Scanning Array I
|
||||
7869, # Supplemental Gravimetric ECCM Scanning Array I
|
||||
7870, # Supplemental Omni ECCM Scanning Array I
|
||||
7887, # Supplemental Radar ECCM Scanning Array I
|
||||
7889, # Supplemental Magnetometric ECCM Scanning Array I
|
||||
20216, # Incremental Radar ECCM Scanning Array I
|
||||
20222, # Incremental Ladar ECCM Scanning Array I
|
||||
20228, # Incremental Gravimetric ECCM Scanning Array I
|
||||
20234, # Incremental Magnetometric ECCM Scanning Array I
|
||||
7892, # Prototype ECCM Radar Sensor Cluster
|
||||
7893, # Prototype ECCM Ladar Sensor Cluster
|
||||
7895, # Prototype ECCM Gravimetric Sensor Cluster
|
||||
7896, # Prototype ECCM Omni Sensor Cluster
|
||||
7914, # Prototype ECCM Magnetometric Sensor Cluster
|
||||
6158, # Prototype Sensor Booster
|
||||
),
|
||||
5849 : ( # Extruded Compact Heat Sink
|
||||
5846, # Thermal Exhaust System I
|
||||
5858, # C4S Coiled Circuit Thermal Radiator
|
||||
5857, # 'Skadi' Coolant System I
|
||||
),
|
||||
22895: ( # 'Shady' Sensor Booster
|
||||
22897, # 'Forger' ECCM - Magnetometric I
|
||||
),
|
||||
11105: ( # Vortex Compact Magnetic Field Stabilizer
|
||||
11103, # Insulated Stabilizer Array I
|
||||
11101, # Linear Flux Stabilizer I
|
||||
11107, # Gauss Field Balancer I
|
||||
),
|
||||
22945: ( # 'Executive' Remote Sensor Dampener
|
||||
22943, # 'Broker' Remote Sensor Dampener I
|
||||
),
|
||||
6173 : ( # Optical Compact Tracking Computer
|
||||
6175, # 'Orion' Tracking CPU I
|
||||
),
|
||||
5279 : ( # F-23 Compact Remote Sensor Booster
|
||||
7217, # Spot Pulsing ECCM I
|
||||
7220, # Phased Muon ECCM Caster I
|
||||
5280, # Connected Remote Sensor Booster
|
||||
),
|
||||
4787 : ( # Small Compact Pb-Acid Cap Battery
|
||||
4791, # Small Ohm Capacitor Reserve I
|
||||
4785, # Small F-4a Ld-Sulfate Capacitor Charge Unit
|
||||
4789, # Small Peroxide Capacitor Power Cell
|
||||
),
|
||||
19946: ( # BZ-5 Scoped Gravimetric ECM
|
||||
9519, # FZ-3 Subversive Spatial Destabilizer ECM
|
||||
),
|
||||
6073 : ( # Medium Compact Pb-Acid Cap Battery
|
||||
6097, # Medium Ohm Capacitor Reserve I
|
||||
6111, # Medium F-4a Ld-Sulfate Capacitor Charge Unit
|
||||
6083, # Medium Peroxide Capacitor Power Cell
|
||||
),
|
||||
21484: ( # 'Full Duplex' Ballistic Control System
|
||||
21482, # Ballistic 'Purge' Targeting System I
|
||||
),
|
||||
6296 : ( # F-89 Compact Signal Amplifier
|
||||
6218, # Protected Gravimetric Backup Cluster I
|
||||
6222, # Protected Ladar Backup Cluster I
|
||||
6226, # Protected Magnetometric Backup Cluster I
|
||||
6230, # Protected Multi-Frequency Backup Cluster I
|
||||
6234, # Protected RADAR Backup Cluster I
|
||||
6195, # Reserve Gravimetric Scanners
|
||||
6199, # Reserve Ladar Scanners
|
||||
6203, # Reserve Magnetometric Scanners
|
||||
6207, # Reserve Multi-Frequency Scanners
|
||||
6212, # Reserve RADAR Scanners
|
||||
20238, # Secure Gravimetric Backup Cluster I
|
||||
20244, # Secure Ladar Backup Cluster I
|
||||
20250, # Secure Magnetometric Backup Cluster I
|
||||
20260, # Secure Radar Backup Cluster I
|
||||
6244, # F-43 Repetitive Gravimetric Backup Sensors
|
||||
6252, # F-43 Repetitive Ladar Backup Sensors
|
||||
6260, # F-43 Repetitive Magnetometric Backup Sensors
|
||||
6268, # F-43 Repetitive Multi-Frequency Backup Sensors
|
||||
6276, # F-43 Repetitive RADAR Backup Sensors
|
||||
20240, # Shielded Gravimetric Backup Cluster I
|
||||
20246, # Shielded Ladar Backup Cluster I
|
||||
20252, # Shielded Magnetometric Backup Cluster I
|
||||
20262, # Shielded Radar Backup Cluster I
|
||||
6243, # Surrogate Gravimetric Reserve Array I
|
||||
6251, # Surrogate Ladar Reserve Array I
|
||||
6259, # Surrogate Magnetometric Reserve Array I
|
||||
6267, # Surrogate Multi-Frequency Reserve Array I
|
||||
6275, # Surrogate RADAR Reserve Array I
|
||||
20242, # Warded Gravimetric Backup Cluster I
|
||||
20248, # Warded Ladar Backup Cluster I
|
||||
20254, # Warded Magnetometric Backup Cluster I
|
||||
20264, # Warded Radar Backup Cluster I
|
||||
6294, # 'Mendicant' Signal Booster I
|
||||
6293, # Wavelength Signal Enhancer I
|
||||
6295, # Type-D Attenuation Signal Augmentation
|
||||
),
|
||||
5302 : ( # Phased Muon Scoped Sensor Dampener
|
||||
5300, # Indirect Scanning Dampening Unit 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))
|
||||
16
eos/db/migrations/upgrade13.py
Normal file
16
eos/db/migrations/upgrade13.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
Migration 13
|
||||
|
||||
- Alters fits table to introduce implant location attribute
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Update fits schema to include implant location attribute
|
||||
try:
|
||||
saveddata_engine.execute("SELECT implantLocation FROM fits LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN implantLocation INTEGER;")
|
||||
saveddata_engine.execute("UPDATE fits SET implantLocation = 0")
|
||||
21
eos/db/migrations/upgrade14.py
Normal file
21
eos/db/migrations/upgrade14.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Migration 14
|
||||
|
||||
- This should take care of issue #586.
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
if saveddata_engine.execute(
|
||||
"SELECT name FROM sqlite_master WHERE type='table' AND name='fighters'").scalar() == 'fighters':
|
||||
# Fighters table exists
|
||||
try:
|
||||
saveddata_engine.execute("SELECT active FROM fighters LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
# if we don't have the active column, we are on an old pre-release version. Drop the tables and move on
|
||||
# (they will be recreated)
|
||||
|
||||
saveddata_engine.execute("DROP TABLE fighters")
|
||||
saveddata_engine.execute("DROP TABLE fightersAbilities")
|
||||
19
eos/db/migrations/upgrade15.py
Normal file
19
eos/db/migrations/upgrade15.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
Migration 15
|
||||
|
||||
- Delete projected modules on citadels
|
||||
"""
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
sql = """
|
||||
DELETE FROM modules WHERE ID IN
|
||||
(
|
||||
SELECT m.ID FROM modules AS m
|
||||
JOIN fits AS f ON m.fitID = f.ID
|
||||
WHERE f.shipID IN ("35832", "35833", "35834", "40340")
|
||||
AND m.projected = 1
|
||||
)
|
||||
"""
|
||||
|
||||
saveddata_engine.execute(sql)
|
||||
15
eos/db/migrations/upgrade16.py
Normal file
15
eos/db/migrations/upgrade16.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""
|
||||
Migration 16
|
||||
|
||||
- Alters fits table to introduce notes attribute
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Update fits schema to include notes attribute
|
||||
try:
|
||||
saveddata_engine.execute("SELECT notes FROM fits LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN notes VARCHAR;")
|
||||
42
eos/db/migrations/upgrade17.py
Normal file
42
eos/db/migrations/upgrade17.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""
|
||||
Migration 17
|
||||
|
||||
- Moves all fleet boosters to the new schema
|
||||
"""
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
from eos.db import saveddata_session
|
||||
from eos.db.saveddata.fit import commandFits_table
|
||||
|
||||
sql = """
|
||||
SELECT sm.memberID as boostedFit, s.leaderID AS squadBoost, w.leaderID AS wingBoost, g.leaderID AS gangBoost
|
||||
FROM squadmembers sm
|
||||
JOIN squads s ON s.ID = sm.squadID
|
||||
JOIN wings w on w.ID = s.wingID
|
||||
JOIN gangs g on g.ID = w.gangID
|
||||
"""
|
||||
try:
|
||||
results = saveddata_session.execute(sql)
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
68
eos/db/migrations/upgrade18.py
Normal file
68
eos/db/migrations/upgrade18.py
Normal file
@@ -0,0 +1,68 @@
|
||||
"""
|
||||
Migration 8
|
||||
|
||||
- Converts modules from old Warfare Links to Command Modules
|
||||
"""
|
||||
|
||||
CONVERSIONS = {
|
||||
42526: ( # Armor Command Burst I
|
||||
20069, # Armored Warfare Link - Damage Control I
|
||||
20409, # Armored Warfare Link - Passive Defense I
|
||||
22227, # Armored Warfare Link - Rapid Repair I
|
||||
),
|
||||
43552: ( # Armor Command Burst II
|
||||
4264, # Armored Warfare Link - Damage Control II
|
||||
4266, # Armored Warfare Link - Passive Defense II
|
||||
4266, # Armored Warfare Link - Rapid Repair II
|
||||
),
|
||||
42527: ( # Information Command Burst I
|
||||
11052, # Information Warfare Link - Sensor Integrity I
|
||||
20405, # Information Warfare Link - Recon Operation I
|
||||
20406, # Information Warfare Link - Electronic Superiority I
|
||||
),
|
||||
43554: ( # Information Command Burst II
|
||||
4268, # Information Warfare Link - Electronic Superiority II
|
||||
4270, # Information Warfare Link - Recon Operation II
|
||||
4272, # Information Warfare Link - Sensor Integrity II
|
||||
),
|
||||
42529: ( # Shield Command Burst I
|
||||
20124, # Siege Warfare Link - Active Shielding I
|
||||
20514, # Siege Warfare Link - Shield Harmonizing I
|
||||
22228, # Siege Warfare Link - Shield Efficiency I
|
||||
),
|
||||
43555: ( # Shield Command Burst II
|
||||
4280, # Siege Warfare Link - Active Shielding II
|
||||
4282, # Siege Warfare Link - Shield Efficiency II
|
||||
4284 # Siege Warfare Link - Shield Harmonizing II
|
||||
),
|
||||
42530: ( # Skirmish Command Burst I
|
||||
11017, # Skirmish Warfare Link - Interdiction Maneuvers I
|
||||
20070, # Skirmish Warfare Link - Evasive Maneuvers I
|
||||
20408, # Skirmish Warfare Link - Rapid Deployment I
|
||||
),
|
||||
43556: ( # Skirmish Command Burst II
|
||||
4286, # Skirmish Warfare Link - Evasive Maneuvers II
|
||||
4288, # Skirmish Warfare Link - Interdiction Maneuvers II
|
||||
4290 # Skirmish Warfare Link - Rapid Deployment II
|
||||
),
|
||||
42528: ( # Mining Foreman Burst I
|
||||
22553, # Mining Foreman Link - Harvester Capacitor Efficiency I
|
||||
22555, # Mining Foreman Link - Mining Laser Field Enhancement I
|
||||
22557, # Mining Foreman Link - Laser Optimization I
|
||||
),
|
||||
43551: ( # Mining Foreman Burst II
|
||||
4274, # Mining Foreman Link - Harvester Capacitor Efficiency II
|
||||
4276, # Mining Foreman Link - Laser Optimization II
|
||||
4278 # Mining Foreman Link - Mining Laser Field Enhancement II
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
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))
|
||||
18
eos/db/migrations/upgrade19.py
Normal file
18
eos/db/migrations/upgrade19.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
Migration 19
|
||||
|
||||
- Deletes broken references to fits from the commandFits table (see GH issue #844)
|
||||
"""
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
from eos.db import saveddata_session
|
||||
|
||||
sql = """
|
||||
DELETE FROM commandFits
|
||||
WHERE boosterID NOT IN (select ID from fits)
|
||||
OR boostedID NOT IN (select ID from fits)
|
||||
"""
|
||||
|
||||
saveddata_session.execute(sql)
|
||||
saveddata_session.commit()
|
||||
@@ -6,6 +6,7 @@ Migration 2
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Update characters schema to include default chars
|
||||
try:
|
||||
|
||||
15
eos/db/migrations/upgrade20.py
Normal file
15
eos/db/migrations/upgrade20.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""
|
||||
Migration 20
|
||||
|
||||
- Adds support for alpha clones to the characters table
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Update characters schema to include alphaCloneID
|
||||
try:
|
||||
saveddata_engine.execute("SELECT alphaCloneID FROM characters LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE characters ADD COLUMN alphaCloneID INTEGER;")
|
||||
10
eos/db/migrations/upgrade21.py
Normal file
10
eos/db/migrations/upgrade21.py
Normal file
@@ -0,0 +1,10 @@
|
||||
"""
|
||||
Migration 21
|
||||
|
||||
- Fixes discrepancy in drone table where we may have an amount active that is not equal to the amount in the stack
|
||||
(we don't support activating only 2/5 drones). See GH issue #728
|
||||
"""
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
saveddata_engine.execute("UPDATE drones SET amountActive = amount where amountActive > 0 AND amountActive <> amount;")
|
||||
45
eos/db/migrations/upgrade22.py
Normal file
45
eos/db/migrations/upgrade22.py
Normal file
@@ -0,0 +1,45 @@
|
||||
"""
|
||||
Migration 22
|
||||
|
||||
- Adds the created and modified fields to most tables
|
||||
"""
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
|
||||
# 1 = created only
|
||||
# 2 = created and modified
|
||||
tables = {
|
||||
"boosters": 2,
|
||||
"cargo": 2,
|
||||
"characters": 2,
|
||||
"crest": 1,
|
||||
"damagePatterns": 2,
|
||||
"drones": 2,
|
||||
"fighters": 2,
|
||||
"fits": 2,
|
||||
"projectedFits": 2,
|
||||
"commandFits": 2,
|
||||
"implants": 2,
|
||||
"implantSets": 2,
|
||||
"modules": 2,
|
||||
"overrides": 2,
|
||||
"characterSkills": 2,
|
||||
"targetResists": 2
|
||||
}
|
||||
|
||||
for table in tables.keys():
|
||||
|
||||
# midnight brain, there's probably a much more simple way to do this, but fuck it
|
||||
if tables[table] > 0:
|
||||
try:
|
||||
saveddata_engine.execute("SELECT created FROM {0} LIMIT 1;".format(table))
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE {} ADD COLUMN created DATETIME;".format(table))
|
||||
|
||||
if tables[table] > 1:
|
||||
try:
|
||||
saveddata_engine.execute("SELECT modified FROM {0} LIMIT 1;".format(table))
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE {} ADD COLUMN modified DATETIME;".format(table))
|
||||
13
eos/db/migrations/upgrade23.py
Normal file
13
eos/db/migrations/upgrade23.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""
|
||||
Migration 23
|
||||
|
||||
- Adds a sec status field to the character table
|
||||
"""
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
try:
|
||||
saveddata_engine.execute("SELECT secStatus FROM characters LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE characters ADD COLUMN secStatus FLOAT;")
|
||||
14
eos/db/migrations/upgrade24.py
Normal file
14
eos/db/migrations/upgrade24.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
Migration 24
|
||||
|
||||
- Adds a boolean value to fit to signify if fit should ignore restrictions
|
||||
"""
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
try:
|
||||
saveddata_engine.execute("SELECT ignoreRestrictions FROM fits LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN ignoreRestrictions BOOLEAN")
|
||||
saveddata_engine.execute("UPDATE fits SET ignoreRestrictions = 0")
|
||||
@@ -6,6 +6,7 @@ Migration 3
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
try:
|
||||
saveddata_engine.execute("SELECT modeID FROM fits LIMIT 1")
|
||||
|
||||
@@ -10,66 +10,65 @@ Migration 4
|
||||
and output of itemDiff.py
|
||||
"""
|
||||
|
||||
|
||||
CONVERSIONS = {
|
||||
506: ( # 'Basic' Capacitor Power Relay
|
||||
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
|
||||
8177 : ( # Mark I Compact Capacitor Power Relay
|
||||
8173, # Beta Reactor Control: Capacitor Power Relay I
|
||||
),
|
||||
8175: ( # Type-D Restrained Capacitor Power Relay
|
||||
8175 : ( # Type-D Restrained Capacitor Power Relay
|
||||
8171, # Local Power Plant Manager: Capacity Power Relay I
|
||||
),
|
||||
|
||||
421: ( # 'Basic' Capacitor Recharger
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
5239 : ( # EP-S Gaussian Scoped Mining Laser
|
||||
5241, # Dual Diode Mining Laser I
|
||||
),
|
||||
5233: ( # Single Diode Basic Mining Laser
|
||||
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
|
||||
5245 : ( # Particle Bore Compact Mining Laser
|
||||
5243, # XeCl Drilling Beam I
|
||||
),
|
||||
|
||||
@@ -80,62 +79,63 @@ CONVERSIONS = {
|
||||
22609, # Erin Mining Laser Upgrade
|
||||
),
|
||||
|
||||
1242: ( # 'Basic' Nanofiber Internal Structure
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
5649 : ( # Mark I Compact Reinforced Bulkheads
|
||||
5645, # Beta Hull Mod Reinforced Bulkheads
|
||||
),
|
||||
5647: ( # Type-D Restrained Reinforced Bulkheads
|
||||
5647 : ( # Type-D Restrained Reinforced Bulkheads
|
||||
5643, # Local Hull Conversion Reinforced Bulkheads I
|
||||
),
|
||||
}
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
|
||||
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))
|
||||
|
||||
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))
|
||||
|
||||
@@ -4,5 +4,6 @@ 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 ?', ("",))
|
||||
|
||||
@@ -4,6 +4,8 @@ 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))
|
||||
saveddata_engine.execute('INSERT INTO damagePatterns VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)',
|
||||
(1, "Uniform", 25, 25, 25, 25, None, None, None))
|
||||
|
||||
@@ -8,17 +8,16 @@ Migration 7
|
||||
Pyfa.
|
||||
"""
|
||||
|
||||
|
||||
CONVERSIONS = {
|
||||
640: ( # Scorpion
|
||||
4005, # Scorpion Ishukone Watch
|
||||
)
|
||||
}
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
|
||||
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))
|
||||
|
||||
saveddata_engine.execute('UPDATE "fits" SET "shipID" = ? WHERE "shipID" = ?',
|
||||
(replacement_item, retired_item))
|
||||
|
||||
@@ -7,18 +7,17 @@ Migration 8
|
||||
modules with their new replacements
|
||||
"""
|
||||
|
||||
|
||||
CONVERSIONS = {
|
||||
8529: ( # Large F-S9 Regolith Compact Shield Extender
|
||||
8529 : ( # Large F-S9 Regolith Compact Shield Extender
|
||||
8409, # Large Subordinate Screen Stabilizer I
|
||||
),
|
||||
8419: ( # Large Azeotropic Restrained Shield Extender
|
||||
8419 : ( # Large Azeotropic Restrained Shield Extender
|
||||
8489, # Large Supplemental Barrier Emitter I
|
||||
),
|
||||
8517: ( # Medium F-S9 Regolith Compact Shield Extender
|
||||
8517 : ( # Medium F-S9 Regolith Compact Shield Extender
|
||||
8397, # Medium Subordinate Screen Stabilizer I
|
||||
),
|
||||
8433: ( # Medium Azeotropic Restrained Shield Extender
|
||||
8433 : ( # Medium Azeotropic Restrained Shield Extender
|
||||
8477, # Medium Supplemental Barrier Emitter I
|
||||
),
|
||||
20627: ( # Small 'Trapper' Shield Extender
|
||||
@@ -29,10 +28,10 @@ CONVERSIONS = {
|
||||
8387, # Micro Subordinate Screen Stabilizer I
|
||||
8465, # Micro Supplemental Barrier Emitter I
|
||||
),
|
||||
8521: ( # Small F-S9 Regolith Compact Shield Extender
|
||||
8521 : ( # Small F-S9 Regolith Compact Shield Extender
|
||||
8401, # Small Subordinate Screen Stabilizer I
|
||||
),
|
||||
8427: ( # Small Azeotropic Restrained Shield Extender
|
||||
8427 : ( # Small Azeotropic Restrained Shield Extender
|
||||
8481, # Small Supplemental Barrier Emitter I
|
||||
),
|
||||
11343: ( # 100mm Crystalline Carbonide Restrained Plates
|
||||
@@ -71,15 +70,16 @@ CONVERSIONS = {
|
||||
11321, # 800mm Reinforced Nanofiber Plates I
|
||||
),
|
||||
11317: ( # 800mm Rolled Tungsten Compact Plates
|
||||
11315, # 800mm Reinforced Titanium Plates I
|
||||
11315, # 800mm Reinforced Titanium Plates I
|
||||
),
|
||||
}
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
|
||||
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))
|
||||
|
||||
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,8 +16,10 @@ CREATE TABLE boostersTemp (
|
||||
)
|
||||
"""
|
||||
|
||||
|
||||
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(
|
||||
"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,18 @@
|
||||
__all__ = ["character", "fit", "module", "user", "crest", "skill", "price",
|
||||
"booster", "drone", "implant", "fleet", "damagePattern",
|
||||
"miscData", "targetResists"]
|
||||
__all__ = [
|
||||
"character",
|
||||
"fit",
|
||||
"module",
|
||||
"user",
|
||||
"skill",
|
||||
"price",
|
||||
"booster",
|
||||
"drone",
|
||||
"implant",
|
||||
"damagePattern",
|
||||
"miscData",
|
||||
"targetResists",
|
||||
"override",
|
||||
"crest",
|
||||
"implantSet",
|
||||
"loadDefaultDatabaseValues"
|
||||
]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,25 +15,30 @@
|
||||
#
|
||||
# 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, ForeignKey, Integer, UniqueConstraint, Boolean
|
||||
from sqlalchemy.orm import mapper, relation
|
||||
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.types import Booster
|
||||
from eos.saveddata.booster import Booster
|
||||
|
||||
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("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))
|
||||
Column("boosterID", ForeignKey("boosters.ID"), primary_key=True),
|
||||
Column("effectID", Integer, primary_key=True))
|
||||
|
||||
|
||||
class ActiveSideEffectsDummy(object):
|
||||
def __init__(self, effectID):
|
||||
@@ -42,6 +47,6 @@ class ActiveSideEffectsDummy(object):
|
||||
|
||||
mapper(ActiveSideEffectsDummy, activeSideEffects_table)
|
||||
mapper(Booster, boosters_table,
|
||||
properties = {"_Booster__activeSideEffectDummies" : relation(ActiveSideEffectsDummy)})
|
||||
properties={"_Booster__activeSideEffectDummies": relation(ActiveSideEffectsDummy)})
|
||||
|
||||
Booster._Booster__activeSideEffectIDs = association_proxy("_Booster__activeSideEffectDummies", "effectID")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,18 +15,27 @@
|
||||
#
|
||||
# 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, ForeignKey, Boolean
|
||||
from sqlalchemy.orm import mapper
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, DateTime
|
||||
from sqlalchemy.orm import mapper, relation
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import Cargo
|
||||
from eos.saveddata.cargo import Cargo
|
||||
from eos.saveddata.fit import Fit
|
||||
|
||||
cargo_table = Table("cargo", saveddata_meta,
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable = False, index = True),
|
||||
Column("itemID", Integer, nullable = False),
|
||||
Column("amount", Integer, nullable = False))
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False, index=True),
|
||||
Column("itemID", Integer, nullable=False),
|
||||
Column("amount", Integer, nullable=False),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
|
||||
)
|
||||
|
||||
mapper(Cargo, cargo_table)
|
||||
mapper(Cargo, cargo_table,
|
||||
properties={
|
||||
"owner": relation(Fit)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,30 +15,53 @@
|
||||
#
|
||||
# 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, ForeignKey, String
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, String, DateTime, Float
|
||||
from sqlalchemy.orm import relation, mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.db.saveddata.implant import charImplants_table
|
||||
from eos.types import Character, User, Skill, Implant
|
||||
from eos.effectHandlerHelpers import HandledImplantBoosterList
|
||||
from eos.saveddata.implant import Implant
|
||||
from eos.saveddata.user import User
|
||||
from eos.saveddata.character import Character, Skill
|
||||
|
||||
characters_table = Table("characters", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("name", String, nullable = False),
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("name", String, nullable=False),
|
||||
Column("apiID", Integer),
|
||||
Column("apiKey", String),
|
||||
Column("defaultChar", Integer),
|
||||
Column("chars", String, nullable = True),
|
||||
Column("chars", String, nullable=True),
|
||||
Column("defaultLevel", Integer, nullable=True),
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable = True))
|
||||
Column("alphaCloneID", Integer, nullable=True),
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True),
|
||||
Column("secStatus", Float, nullable=True, default=0.0),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now))
|
||||
|
||||
mapper(Character, characters_table,
|
||||
properties = {"_Character__owner" : relation(User, backref = "characters"),
|
||||
"_Character__skills" : relation(Skill, backref="character", cascade = "all,delete-orphan"),
|
||||
"_Character__implants" : relation(Implant, collection_class = HandledImplantBoosterList, cascade='all,delete-orphan', single_parent=True,
|
||||
primaryjoin = charImplants_table.c.charID == characters_table.c.ID,
|
||||
secondaryjoin = charImplants_table.c.implantID == Implant.ID,
|
||||
secondary = charImplants_table),})
|
||||
properties={
|
||||
"_Character__alphaCloneID": characters_table.c.alphaCloneID,
|
||||
"savedName" : characters_table.c.name,
|
||||
"_Character__secStatus": characters_table.c.secStatus,
|
||||
"_Character__owner" : relation(
|
||||
User,
|
||||
backref="characters"),
|
||||
"_Character__skills" : relation(
|
||||
Skill,
|
||||
backref="character",
|
||||
cascade="all,delete-orphan"),
|
||||
"_Character__implants" : relation(
|
||||
Implant,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all,delete-orphan',
|
||||
backref='character',
|
||||
single_parent=True,
|
||||
primaryjoin=charImplants_table.c.charID == characters_table.c.ID,
|
||||
secondaryjoin=charImplants_table.c.implantID == Implant.ID,
|
||||
secondary=charImplants_table),
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,17 +15,20 @@
|
||||
#
|
||||
# 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, String, Boolean
|
||||
from sqlalchemy import Table, Column, Integer, String, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import CrestChar
|
||||
from eos.saveddata.crestchar import CrestChar
|
||||
|
||||
crest_table = Table("crest", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("name", String, nullable = False, unique = True),
|
||||
Column("refresh_token", String, nullable = False))
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("name", String, nullable=False, unique=True),
|
||||
Column("refresh_token", String, nullable=False),
|
||||
# These records aren't updated. Instead, they are dropped and created, hence we don't have a modified field
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now))
|
||||
|
||||
mapper(CrestChar, crest_table)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,21 +15,25 @@
|
||||
#
|
||||
# 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, ForeignKey, String
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, String, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import DamagePattern
|
||||
from eos.saveddata.damagePattern import DamagePattern
|
||||
|
||||
damagePatterns_table = Table("damagePatterns", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("name", String),
|
||||
Column("emAmount", Integer),
|
||||
Column("thermalAmount", Integer),
|
||||
Column("kineticAmount", Integer),
|
||||
Column("explosiveAmount", Integer),
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True))
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(DamagePattern, damagePatterns_table)
|
||||
|
||||
239
eos/db/saveddata/databaseRepair.py
Normal file
239
eos/db/saveddata/databaseRepair.py
Normal file
@@ -0,0 +1,239 @@
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of pyfa.
|
||||
#
|
||||
# pyfa is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# pyfa is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
from sqlalchemy.exc import DatabaseError
|
||||
from logbook import Logger
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class DatabaseCleanup(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def ExecuteSQLQuery(saveddata_engine, query):
|
||||
try:
|
||||
results = saveddata_engine.execute(query)
|
||||
return results
|
||||
except DatabaseError:
|
||||
pyfalog.error("Failed to connect to database or error executing query:\n{0}", query)
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def OrphanedCharacterSkills(saveddata_engine):
|
||||
# Find orphaned character skills.
|
||||
# This solves an issue where the character doesn't exist, but skills for that character do.
|
||||
# See issue #917
|
||||
pyfalog.debug("Running database cleanup for character skills.")
|
||||
query = "SELECT COUNT(*) AS num FROM characterSkills WHERE characterID NOT IN (SELECT ID from characters)"
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
return
|
||||
|
||||
row = results.first()
|
||||
|
||||
if row and row['num']:
|
||||
query = "DELETE FROM characterSkills WHERE characterID NOT IN (SELECT ID from characters)"
|
||||
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount)
|
||||
|
||||
@staticmethod
|
||||
def OrphanedFitDamagePatterns(saveddata_engine):
|
||||
# Find orphaned damage patterns.
|
||||
# This solves an issue where the damage pattern doesn't exist, but fits reference the pattern.
|
||||
# See issue #777
|
||||
pyfalog.debug("Running database cleanup for orphaned damage patterns attached to fits.")
|
||||
query = "SELECT COUNT(*) AS num FROM fits WHERE damagePatternID NOT IN (SELECT ID FROM damagePatterns) OR damagePatternID IS NULL"
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
return
|
||||
|
||||
row = results.first()
|
||||
|
||||
if row and row['num']:
|
||||
# Get Uniform damage pattern ID
|
||||
uniform_query = "SELECT ID FROM damagePatterns WHERE name = 'Uniform'"
|
||||
uniform_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, uniform_query)
|
||||
|
||||
if uniform_results is None:
|
||||
return
|
||||
|
||||
rows = uniform_results.fetchall()
|
||||
|
||||
if len(rows) == 0:
|
||||
pyfalog.error("Missing uniform damage pattern.")
|
||||
elif len(rows) > 1:
|
||||
pyfalog.error("More than one uniform damage pattern found.")
|
||||
else:
|
||||
uniform_damage_pattern_id = rows[0]['ID']
|
||||
update_query = "UPDATE 'fits' SET 'damagePatternID' = {} " \
|
||||
"WHERE damagePatternID NOT IN (SELECT ID FROM damagePatterns) OR damagePatternID IS NULL".format(uniform_damage_pattern_id)
|
||||
update_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, update_query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", update_results.rowcount)
|
||||
|
||||
@staticmethod
|
||||
def OrphanedFitCharacterIDs(saveddata_engine):
|
||||
# Find orphaned character IDs. This solves an issue where the character doesn't exist, but fits reference the pattern.
|
||||
pyfalog.debug("Running database cleanup for orphaned characters attached to fits.")
|
||||
query = "SELECT COUNT(*) AS num FROM fits WHERE characterID NOT IN (SELECT ID FROM characters) OR characterID IS NULL"
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
return
|
||||
|
||||
row = results.first()
|
||||
|
||||
if row and row['num']:
|
||||
# Get All 5 character ID
|
||||
all5_query = "SELECT ID FROM characters WHERE name = 'All 5'"
|
||||
all5_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, all5_query)
|
||||
|
||||
if all5_results is None:
|
||||
return
|
||||
|
||||
rows = all5_results.fetchall()
|
||||
|
||||
if len(rows) == 0:
|
||||
pyfalog.error("Missing 'All 5' character.")
|
||||
elif len(rows) > 1:
|
||||
pyfalog.error("More than one 'All 5' character found.")
|
||||
else:
|
||||
all5_id = rows[0]['ID']
|
||||
update_query = "UPDATE 'fits' SET 'characterID' = " + str(all5_id) + \
|
||||
" WHERE characterID not in (select ID from characters) OR characterID IS NULL"
|
||||
update_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, update_query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", update_results.rowcount)
|
||||
|
||||
@staticmethod
|
||||
def NullDamagePatternNames(saveddata_engine):
|
||||
# Find damage patterns that are missing the name.
|
||||
# This solves an issue where the damage pattern ends up with a name that is null.
|
||||
# See issue #949
|
||||
pyfalog.debug("Running database cleanup for missing damage pattern names.")
|
||||
query = "SELECT COUNT(*) AS num FROM damagePatterns WHERE name IS NULL OR name = ''"
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
return
|
||||
|
||||
row = results.first()
|
||||
|
||||
if row and row['num']:
|
||||
query = "DELETE FROM damagePatterns WHERE name IS NULL OR name = ''"
|
||||
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount)
|
||||
|
||||
@staticmethod
|
||||
def NullTargetResistNames(saveddata_engine):
|
||||
# Find target resists that are missing the name.
|
||||
# This solves an issue where the target resist ends up with a name that is null.
|
||||
# See issue #949
|
||||
pyfalog.debug("Running database cleanup for missing target resist names.")
|
||||
query = "SELECT COUNT(*) AS num FROM targetResists WHERE name IS NULL OR name = ''"
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
return
|
||||
|
||||
row = results.first()
|
||||
|
||||
if row and row['num']:
|
||||
query = "DELETE FROM targetResists WHERE name IS NULL OR name = ''"
|
||||
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount)
|
||||
|
||||
@staticmethod
|
||||
def OrphanedFitIDItemID(saveddata_engine):
|
||||
# Orphaned items that are missing the fit ID or item ID.
|
||||
# See issue #954
|
||||
for table in ['drones', 'cargo', 'fighters']:
|
||||
pyfalog.debug("Running database cleanup for orphaned {0} items.", table)
|
||||
query = "SELECT COUNT(*) AS num FROM {} WHERE itemID IS NULL OR itemID = '' or itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(
|
||||
table)
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
return
|
||||
|
||||
row = results.first()
|
||||
|
||||
if row and row['num']:
|
||||
query = "DELETE FROM {} WHERE itemID IS NULL OR itemID = '' or itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(
|
||||
table)
|
||||
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount)
|
||||
|
||||
for table in ['modules']:
|
||||
pyfalog.debug("Running database cleanup for orphaned {0} items.", table)
|
||||
query = "SELECT COUNT(*) AS num FROM {} WHERE itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(
|
||||
table)
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
return
|
||||
|
||||
row = results.first()
|
||||
|
||||
if row and row['num']:
|
||||
query = "DELETE FROM {} WHERE itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(table)
|
||||
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount)
|
||||
|
||||
@staticmethod
|
||||
def NullDamageTargetPatternValues(saveddata_engine):
|
||||
# Find patterns that have null values
|
||||
# See issue #954
|
||||
for profileType in ['damagePatterns', 'targetResists']:
|
||||
for damageType in ['em', 'thermal', 'kinetic', 'explosive']:
|
||||
pyfalog.debug("Running database cleanup for null {0} values. ({1})", profileType, damageType)
|
||||
query = "SELECT COUNT(*) AS num FROM {0} WHERE {1}Amount IS NULL OR {1}Amount = ''".format(profileType,
|
||||
damageType)
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
return
|
||||
|
||||
row = results.first()
|
||||
|
||||
if row and row['num']:
|
||||
query = "UPDATE '{0}' SET '{1}Amount' = '0' WHERE {1}Amount IS NULL OR {1}Amount = ''".format(profileType,
|
||||
damageType)
|
||||
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount)
|
||||
|
||||
@staticmethod
|
||||
def DuplicateSelectedAmmoName(saveddata_engine):
|
||||
# Orphaned items that are missing the fit ID or item ID.
|
||||
# See issue #954
|
||||
pyfalog.debug("Running database cleanup for duplicated selected ammo profiles.")
|
||||
query = "SELECT COUNT(*) AS num FROM damagePatterns WHERE name = 'Selected Ammo'"
|
||||
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
|
||||
if results is None:
|
||||
return
|
||||
|
||||
row = results.first()
|
||||
|
||||
if row and row['num'] > 1:
|
||||
query = "DELETE FROM damagePatterns WHERE name = 'Selected Ammo'"
|
||||
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
|
||||
pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount)
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,19 +15,29 @@
|
||||
#
|
||||
# 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, ForeignKey, Boolean, DateTime
|
||||
from sqlalchemy.orm import mapper, relation
|
||||
import datetime
|
||||
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean
|
||||
from sqlalchemy.orm import mapper
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import Drone
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fit import Fit
|
||||
|
||||
drones_table = Table("drones", saveddata_meta,
|
||||
Column("groupID", Integer, primary_key=True),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable = False, index = True),
|
||||
Column("itemID", Integer, nullable = False),
|
||||
Column("amount", Integer, nullable = False),
|
||||
Column("amountActive", Integer, nullable = False),
|
||||
Column("projected", Boolean, default = False))
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False, index=True),
|
||||
Column("itemID", Integer, nullable=False),
|
||||
Column("amount", Integer, nullable=False),
|
||||
Column("amountActive", Integer, nullable=False),
|
||||
Column("projected", Boolean, default=False),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(Drone, drones_table)
|
||||
mapper(Drone, drones_table,
|
||||
properties={
|
||||
"owner": relation(Fit)
|
||||
}
|
||||
)
|
||||
|
||||
55
eos/db/saveddata/fighter.py
Normal file
55
eos/db/saveddata/fighter.py
Normal file
@@ -0,0 +1,55 @@
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# 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, ForeignKey, Boolean, DateTime
|
||||
from sqlalchemy.orm import mapper, relation
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.fighterAbility import FighterAbility
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from eos.saveddata.fit import Fit
|
||||
|
||||
fighters_table = Table("fighters", saveddata_meta,
|
||||
Column("groupID", Integer, primary_key=True),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False, index=True),
|
||||
Column("itemID", Integer, nullable=False),
|
||||
Column("active", Boolean, nullable=True),
|
||||
Column("amount", Integer, nullable=False),
|
||||
Column("projected", Boolean, default=False),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
fighter_abilities_table = Table("fightersAbilities", saveddata_meta,
|
||||
Column("groupID", Integer, ForeignKey("fighters.groupID"), primary_key=True,
|
||||
index=True),
|
||||
Column("effectID", Integer, nullable=False, primary_key=True),
|
||||
Column("active", Boolean, default=False))
|
||||
|
||||
mapper(Fighter, fighters_table,
|
||||
properties={
|
||||
"owner" : relation(Fit),
|
||||
"_Fighter__abilities": relation(
|
||||
FighterAbility,
|
||||
backref="fighter",
|
||||
cascade='all, delete, delete-orphan'),
|
||||
})
|
||||
|
||||
mapper(FighterAbility, fighter_abilities_table)
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,41 +15,71 @@
|
||||
#
|
||||
# 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 *
|
||||
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 sqlalchemy.sql import and_
|
||||
from sqlalchemy.orm import relation, reconstructor, mapper, relationship
|
||||
from sqlalchemy import ForeignKey, Column, Integer, String, Table, Boolean, DateTime
|
||||
import datetime
|
||||
|
||||
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 import saveddata_session
|
||||
from eos.db.saveddata.cargo import cargo_table
|
||||
from eos.db.saveddata.drone import drones_table
|
||||
from eos.db.saveddata.fighter import fighters_table
|
||||
from eos.db.saveddata.implant import fitImplants_table
|
||||
from eos.types import Fit, Module, User, Booster, Drone, Cargo, Implant, Character, DamagePattern, TargetResists
|
||||
from eos.effectHandlerHelpers import *
|
||||
from eos.db.saveddata.module import modules_table
|
||||
from eos.effectHandlerHelpers import HandledModuleList, HandledImplantBoosterList, HandledProjectedModList, \
|
||||
HandledDroneCargoList, HandledProjectedDroneList
|
||||
from eos.saveddata.implant import Implant
|
||||
from eos.saveddata.character import Character
|
||||
from eos.saveddata.user import User
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from eos.saveddata.fit import Fit as es_Fit, ImplantLocation
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.booster import Booster
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.cargo import Cargo
|
||||
from eos.saveddata.damagePattern import DamagePattern
|
||||
from eos.saveddata.targetResists import TargetResists
|
||||
|
||||
fits_table = Table("fits", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable = True, index = True),
|
||||
Column("shipID", Integer, nullable = False, index = True),
|
||||
Column("name", String, nullable = False),
|
||||
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("targetResistsID", ForeignKey("targetResists.ID"), nullable=True),
|
||||
Column("modeID", Integer, nullable=True),
|
||||
)
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("ownerID", ForeignKey("users.ID"), nullable=True, index=True),
|
||||
Column("shipID", Integer, nullable=False, index=True),
|
||||
Column("name", String, nullable=False),
|
||||
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("targetResistsID", ForeignKey("targetResists.ID"), nullable=True),
|
||||
Column("modeID", Integer, nullable=True),
|
||||
Column("implantLocation", Integer, nullable=False, default=ImplantLocation.FIT),
|
||||
Column("notes", String, nullable=True),
|
||||
Column("ignoreRestrictions", Boolean, default=0),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, default=datetime.datetime.now, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
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, nullable = False, default = 1),
|
||||
Column("active", Boolean, nullable = False, default = 1),
|
||||
)
|
||||
Column("sourceID", ForeignKey("fits.ID"), primary_key=True),
|
||||
Column("victimID", ForeignKey("fits.ID"), primary_key=True),
|
||||
Column("amount", Integer, nullable=False, default=1),
|
||||
Column("active", Boolean, nullable=False, default=1),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
commandFits_table = Table("commandFits", saveddata_meta,
|
||||
Column("boosterID", ForeignKey("fits.ID"), primary_key=True),
|
||||
Column("boostedID", ForeignKey("fits.ID"), primary_key=True),
|
||||
Column("active", Boolean, nullable=False, default=1),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
|
||||
class ProjectedFit(object):
|
||||
def __init__(self, sourceID, source_fit, amount=1, active=True):
|
||||
@@ -62,9 +92,9 @@ class ProjectedFit(object):
|
||||
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)
|
||||
saveddata_session.delete(self.source_fit)
|
||||
saveddata_session.flush()
|
||||
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
|
||||
@@ -78,88 +108,151 @@ class ProjectedFit(object):
|
||||
|
||||
def __repr__(self):
|
||||
return "ProjectedFit(sourceID={}, victimID={}, amount={}, active={}) at {}".format(
|
||||
self.sourceID, self.victimID, self.amount, self.active, hex(id(self))
|
||||
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)
|
||||
|
||||
class CommandFit(object):
|
||||
def __init__(self, boosterID, booster_fit, active=True):
|
||||
self.boosterID = boosterID
|
||||
self.booster_fit = booster_fit
|
||||
self.active = active
|
||||
|
||||
@reconstructor
|
||||
def init(self):
|
||||
if self.booster_fit.isInvalid:
|
||||
# Very rare for this to happen, but be prepared for it
|
||||
saveddata_session.delete(self.booster_fit)
|
||||
saveddata_session.flush()
|
||||
saveddata_session.refresh(self.boosted_fit)
|
||||
|
||||
def __repr__(self):
|
||||
return "CommandFit(boosterID={}, boostedID={}, active={}) at {}".format(
|
||||
self.boosterID, self.boostedID, self.active, hex(id(self))
|
||||
)
|
||||
|
||||
|
||||
es_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"),
|
||||
"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'),
|
||||
es_Fit._Fit__commandFits = association_proxy(
|
||||
"boostedOf", # look at the boostedOf association...
|
||||
"booster_fit", # .. and return the booster fit
|
||||
creator=lambda boosterID, booster_fit: CommandFit(boosterID, booster_fit)
|
||||
)
|
||||
|
||||
|
||||
# These relationships are broken out so that we can easily access it in the events stuff
|
||||
# We sometimes don't want particular relationships to cause a fit modified update (eg: projecting
|
||||
# a fit onto another would 'modify' both fits unless the following relationship is ignored)
|
||||
projectedFitSourceRel = 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')
|
||||
|
||||
|
||||
boostedOntoRel = relationship(
|
||||
CommandFit,
|
||||
primaryjoin=commandFits_table.c.boosterID == fits_table.c.ID,
|
||||
backref='booster_fit',
|
||||
collection_class=attribute_mapped_collection('boostedID'),
|
||||
cascade='all, delete, delete-orphan')
|
||||
|
||||
mapper(es_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), # noqa
|
||||
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)), # noqa
|
||||
"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',
|
||||
backref='owner',
|
||||
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)), # noqa
|
||||
"_Fit__fighters": relation(
|
||||
Fighter,
|
||||
collection_class=HandledDroneCargoList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(fighters_table.c.fitID == fits_table.c.ID, fighters_table.c.projected == False)), # noqa
|
||||
"_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)), # noqa
|
||||
"_Fit__projectedFighters": relation(
|
||||
Fighter,
|
||||
collection_class=HandledProjectedDroneList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
single_parent=True,
|
||||
primaryjoin=and_(fighters_table.c.fitID == fits_table.c.ID, fighters_table.c.projected == True)), # noqa
|
||||
"_Fit__implants": relation(
|
||||
Implant,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
backref='owner',
|
||||
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": projectedFitSourceRel,
|
||||
"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'),
|
||||
"boostedOnto": boostedOntoRel,
|
||||
"boostedOf": relationship(
|
||||
CommandFit,
|
||||
primaryjoin=fits_table.c.ID == commandFits_table.c.boostedID,
|
||||
backref='boosted_fit',
|
||||
collection_class=attribute_mapped_collection('boosterID'),
|
||||
cascade='all, delete, delete-orphan'),
|
||||
}
|
||||
)
|
||||
|
||||
mapper(ProjectedFit, projectedFits_table,
|
||||
properties = {
|
||||
"_ProjectedFit__amount": projectedFits_table.c.amount,
|
||||
}
|
||||
properties={
|
||||
"_ProjectedFit__amount": projectedFits_table.c.amount,
|
||||
}
|
||||
)
|
||||
|
||||
mapper(CommandFit, commandFits_table)
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# 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, ForeignKey, String
|
||||
from sqlalchemy.orm import mapper, relation
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import Fleet, Wing, Squad, Fit
|
||||
from eos.db.saveddata.fit import fits_table
|
||||
|
||||
gangs_table = Table("gangs", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("leaderID", ForeignKey("fits.ID")),
|
||||
Column("boosterID", ForeignKey("fits.ID")),
|
||||
Column("name", String))
|
||||
|
||||
wings_table = Table("wings", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("gangID", ForeignKey("gangs.ID")),
|
||||
Column("boosterID", ForeignKey("fits.ID")),
|
||||
Column("leaderID", ForeignKey("fits.ID")))
|
||||
|
||||
squads_table = Table("squads", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("wingID", ForeignKey("wings.ID")),
|
||||
Column("leaderID", ForeignKey("fits.ID")),
|
||||
Column("boosterID", ForeignKey("fits.ID")))
|
||||
|
||||
squadmembers_table = Table("squadmembers", saveddata_meta,
|
||||
Column("squadID", ForeignKey("squads.ID"), primary_key = True),
|
||||
Column("memberID", ForeignKey("fits.ID"), primary_key = True))
|
||||
|
||||
mapper(Fleet, gangs_table,
|
||||
properties = {"wings" : relation(Wing, backref="gang"),
|
||||
"leader" : relation(Fit, primaryjoin = gangs_table.c.leaderID == fits_table.c.ID),
|
||||
"booster": relation(Fit, primaryjoin = gangs_table.c.boosterID == fits_table.c.ID)})
|
||||
|
||||
mapper(Wing, wings_table,
|
||||
properties = {"squads" : relation(Squad, backref="wing"),
|
||||
"leader" : relation(Fit, primaryjoin = wings_table.c.leaderID == fits_table.c.ID),
|
||||
"booster": relation(Fit, primaryjoin = wings_table.c.boosterID == fits_table.c.ID)})
|
||||
|
||||
mapper(Squad, squads_table,
|
||||
properties = {"leader" : relation(Fit, primaryjoin = squads_table.c.leaderID == fits_table.c.ID),
|
||||
"booster" : relation(Fit, primaryjoin = squads_table.c.boosterID == fits_table.c.ID),
|
||||
"members" : relation(Fit,
|
||||
primaryjoin = squads_table.c.ID == squadmembers_table.c.squadID,
|
||||
secondaryjoin = squadmembers_table.c.memberID == fits_table.c.ID,
|
||||
secondary = squadmembers_table)})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,25 +15,33 @@
|
||||
#
|
||||
# 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, ForeignKey, Boolean
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import Implant
|
||||
from eos.saveddata.implant import Implant
|
||||
|
||||
implants_table = Table("implants", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("itemID", Integer),
|
||||
Column("active", Boolean))
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("itemID", Integer),
|
||||
Column("active", Boolean),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
fitImplants_table = Table("fitImplants", saveddata_meta,
|
||||
Column("fitID", ForeignKey("fits.ID"), index = True),
|
||||
Column("implantID", ForeignKey("implants.ID"), primary_key = True))
|
||||
Column("fitID", ForeignKey("fits.ID"), index=True),
|
||||
Column("implantID", ForeignKey("implants.ID"), primary_key=True))
|
||||
|
||||
charImplants_table = Table("charImplants", saveddata_meta,
|
||||
Column("charID", ForeignKey("characters.ID"), index = True),
|
||||
Column("implantID", ForeignKey("implants.ID"), primary_key = True))
|
||||
Column("charID", ForeignKey("characters.ID"), index=True),
|
||||
Column("implantID", ForeignKey("implants.ID"), primary_key=True))
|
||||
|
||||
implantsSetMap_table = Table("implantSetMap", saveddata_meta,
|
||||
Column("setID", ForeignKey("implantSets.ID"), index=True),
|
||||
Column("implantID", ForeignKey("implants.ID"), primary_key=True))
|
||||
|
||||
mapper(Implant, implants_table)
|
||||
|
||||
49
eos/db/saveddata/implantSet.py
Normal file
49
eos/db/saveddata/implantSet.py
Normal file
@@ -0,0 +1,49 @@
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2016 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, String, DateTime
|
||||
from sqlalchemy.orm import relation, mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.db.saveddata.implant import implantsSetMap_table
|
||||
from eos.effectHandlerHelpers import HandledImplantBoosterList
|
||||
from eos.saveddata.implant import Implant
|
||||
from eos.saveddata.implantSet import ImplantSet
|
||||
|
||||
implant_set_table = Table("implantSets", saveddata_meta,
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("name", String, nullable=False),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(ImplantSet, implant_set_table,
|
||||
properties={
|
||||
"_ImplantSet__implants": relation(
|
||||
Implant,
|
||||
collection_class=HandledImplantBoosterList,
|
||||
cascade='all, delete, delete-orphan',
|
||||
backref='set',
|
||||
single_parent=True,
|
||||
primaryjoin=implantsSetMap_table.c.setID == implant_set_table.c.ID,
|
||||
secondaryjoin=implantsSetMap_table.c.implantID == Implant.ID,
|
||||
secondary=implantsSetMap_table),
|
||||
}
|
||||
)
|
||||
198
eos/db/saveddata/loadDefaultDatabaseValues.py
Normal file
198
eos/db/saveddata/loadDefaultDatabaseValues.py
Normal file
@@ -0,0 +1,198 @@
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of pyfa.
|
||||
#
|
||||
# pyfa is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# pyfa is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
import eos.db
|
||||
from eos.saveddata.damagePattern import DamagePattern as es_DamagePattern
|
||||
from eos.saveddata.targetResists import TargetResists as es_TargetResists
|
||||
|
||||
|
||||
class ImportError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class DefaultDatabaseValues(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
instance = None
|
||||
|
||||
@classmethod
|
||||
def importDamageProfileDefaults(cls):
|
||||
damageProfileList = [["Uniform", "25", "25", "25", "25"], ["[Generic]EM", "100", "0", "0", "0"],
|
||||
["[Generic]Thermal", "0", "100", "0", "0"], ["[Generic]Kinetic", "0", "0", "100", "0"],
|
||||
["[Generic]Explosive", "0", "0", "0", "100"],
|
||||
["[NPC][Asteroid] Blood Raiders", "5067", "4214", "0", "0"],
|
||||
["[Bombs]Concussion Bomb", "0", "0", "6400", "0"],
|
||||
["[Bombs]Electron Bomb", "6400", "0", "0", "0"],
|
||||
["[Bombs]Scorch Bomb", "0", "6400", "0", "0"],
|
||||
["[Bombs]Shrapnel Bomb", "0", "0", "0", "6400"],
|
||||
["[Frequency Crystals][T2] Gleam", "56", "56", "0", "0"],
|
||||
["[Frequency Crystals][T2] Aurora", "40", "24", "0", "0"],
|
||||
["[Frequency Crystals][T2] Scorch", "72", "16", "0", "0"],
|
||||
["[Frequency Crystals][T2] Conflagration", "61.6", "61.6", "0", "0"],
|
||||
["[Frequency Crystals]Gamma", "61.6", "35.2", "0", "0"],
|
||||
["[Frequency Crystals]Infrared", "44", "17.6", "0", "0"],
|
||||
["[Frequency Crystals]Microwave", "35.2", "17.6", "0", "0"],
|
||||
["[Frequency Crystals]Multifrequency", "61.6", "44", "0", "0"],
|
||||
["[Frequency Crystals]Radio", "44", "0", "0", "0"],
|
||||
["[Frequency Crystals]Standard", "44", "26.4", "0", "0"],
|
||||
["[Frequency Crystals]Ultraviolet", "52.8", "26.4", "0", "0"],
|
||||
["[Frequency Crystals]Xray", "52.8", "35.2", "0", "0"],
|
||||
["[Hybrid Charges][T2] Void", "0", "61.6", "61.6", "0"],
|
||||
["[Hybrid Charges][T2] Null", "0", "48", "40", "0"],
|
||||
["[Hybrid Charges][T2] Javelin", "0", "64", "48", "0"],
|
||||
["[Hybrid Charges][T2] Spike", "0", "32", "32", "0"],
|
||||
["[Hybrid Charges]Antimatter", "0", "48", "67.2", "0"],
|
||||
["[Hybrid Charges]Iridium", "0", "28.8", "38.4", "0"],
|
||||
["[Hybrid Charges]Iron", "0", "19.2", "28.8", "0"],
|
||||
["[Hybrid Charges]Lead", "0", "28.8", "48", "0"],
|
||||
["[Hybrid Charges]Plutonium", "0", "48", "57.6", "0"],
|
||||
["[Hybrid Charges]Thorium", "0", "38.4", "48", "0"],
|
||||
["[Hybrid Charges]Tungsten", "0", "19.2", "38.4", "0"],
|
||||
["[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"],
|
||||
["[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"],
|
||||
["[Projectile Ammo][T2] Barrage", "0", "0", "40", "48"],
|
||||
["[Projectile Ammo]Carbonized Lead", "0", "0", "35.2", "8.8"],
|
||||
["[Projectile Ammo]Depleted Uranium", "0", "26.4", "17.6", "26.4"],
|
||||
["[Projectile Ammo]EMP", "79.2", "0", "8.8", "17.6"],
|
||||
["[Projectile Ammo]Fusion", "0", "0", "17.6", "88"],
|
||||
["[Projectile Ammo]Nuclear", "0", "0", "8.8", "35.2"],
|
||||
["[Projectile Ammo]Phased Plasma", "0", "88", "17.6", "0"],
|
||||
["[Projectile Ammo]Proton", "26.4", "0", "17.6", "0"],
|
||||
["[Projectile Ammo]Titanium Sabot", "0", "0", "52.8", "176"],
|
||||
["[NPC][Burner] Cruor (Blood Raiders)", "90", "90", "0", "0"],
|
||||
["[NPC][Burner] Dramiel (Angel)", "55", "0", "20", "96"],
|
||||
["[NPC][Burner] Daredevil (Serpentis)", "0", "110", "154", "0"],
|
||||
["[NPC][Burner] Succubus (Sanshas Nation)", "135", "30", "0", "0"],
|
||||
["[NPC][Burner] Worm (Guristas)", "0", "0", "228", "0"],
|
||||
["[NPC][Burner] Enyo", "0", "147", "147", "0"],
|
||||
["[NPC][Burner] Hawk", "0", "0", "247", "0"],
|
||||
["[NPC][Burner] Jaguar", "36", "0", "50", "182"],
|
||||
["[NPC][Burner] Vengeance", "232", "0", "0", "0"],
|
||||
["[NPC][Burner] Ashimmu (Blood Raiders)", "260", "100", "0", "0"],
|
||||
["[NPC][Burner] Talos", "0", "413", "413", "0"],
|
||||
["[NPC][Burner] Sentinel", "0", "75", "0", "90"],
|
||||
["[NPC][Asteroid] Angel Cartel", "1838", "562", "2215", "3838"],
|
||||
["[NPC][Deadspace] Angel Cartel", "369", "533", "1395", "3302"],
|
||||
["[NPC][Deadspace] Blood Raiders", "6040", "5052", "10", "15"],
|
||||
["[NPC][Asteroid] Guristas", "0", "1828", "7413", "0"],
|
||||
["[NPC][Deadspace] Guristas", "0", "1531", "9680", "0"],
|
||||
["[NPC][Asteroid] Rogue Drone", "394", "666", "1090", "1687"],
|
||||
["[NPC][Deadspace] Rogue Drone", "276", "1071", "1069", "871"],
|
||||
["[NPC][Asteroid] Sanshas Nation", "5586", "4112", "0", "0"],
|
||||
["[NPC][Deadspace] Sanshas Nation", "3009", "2237", "0", "0"],
|
||||
["[NPC][Asteroid] Serpentis", "0", "5373", "4813", "0"],
|
||||
["[NPC][Deadspace] Serpentis", "0", "3110", "1929", "0"],
|
||||
["[NPC][Mission] Amarr Empire", "4464", "3546", "97", "0"],
|
||||
["[NPC][Mission] Caldari State", "0", "2139", "4867", "0"],
|
||||
["[NPC][Mission] CONCORD", "336", "134", "212", "412"],
|
||||
["[NPC][Mission] Gallente Federation", "9", "3712", "2758", "0"],
|
||||
["[NPC][Mission] Khanid", "612", "483", "43", "6"],
|
||||
["[NPC][Mission] Minmatar Republic", "1024", "388", "1655", "4285"],
|
||||
["[NPC][Mission] Mordus Legion", "25", "262", "625", "0"],
|
||||
["[NPC][Mission] Thukker", "0", "52", "10", "79"],
|
||||
["[NPC][Other] Sleepers", "1472", "1472", "1384", "1384"],
|
||||
["[NPC][Other] Sansha Incursion", "1682", "1347", "3678", "3678"]]
|
||||
|
||||
for damageProfileRow in damageProfileList:
|
||||
name, em, therm, kin, exp = damageProfileRow
|
||||
damageProfile = eos.db.getDamagePattern(name)
|
||||
if damageProfile is None:
|
||||
damageProfile = es_DamagePattern(em, therm, kin, exp)
|
||||
damageProfile.name = name
|
||||
eos.db.save(damageProfile)
|
||||
|
||||
@classmethod
|
||||
def importResistProfileDefaults(cls):
|
||||
targetResistProfileList = [["Uniform (25%)", "0.25", "0.25", "0.25", "0.25"],
|
||||
["Uniform (50%)", "0.50", "0.50", "0.50", "0.50"],
|
||||
["Uniform (75%)", "0.75", "0.75", "0.75", "0.75"],
|
||||
["Uniform (90%)", "0.90", "0.90", "0.90", "0.90"],
|
||||
["[T1 Resist]Shield", "0.0", "0.20", "0.40", "0.50"],
|
||||
["[T1 Resist]Armor", "0.50", "0.45", "0.25", "0.10"],
|
||||
["[T1 Resist]Hull", "0.33", "0.33", "0.33", "0.33"],
|
||||
["[T1 Resist]Shield (+T2 DCU)", "0.125", "0.30", "0.475", "0.562"],
|
||||
["[T1 Resist]Armor (+T2 DCU)", "0.575", "0.532", "0.363", "0.235"],
|
||||
["[T1 Resist]Hull (+T2 DCU)", "0.598", "0.598", "0.598", "0.598"],
|
||||
["[T2 Resist]Amarr (Shield)", "0.0", "0.20", "0.70", "0.875"],
|
||||
["[T2 Resist]Amarr (Armor)", "0.50", "0.35", "0.625", "0.80"],
|
||||
["[T2 Resist]Caldari (Shield)", "0.20", "0.84", "0.76", "0.60"],
|
||||
["[T2 Resist]Caldari (Armor)", "0.50", "0.8625", "0.625", "0.10"],
|
||||
["[T2 Resist]Gallente (Shield)", "0.0", "0.60", "0.85", "0.50"],
|
||||
["[T2 Resist]Gallente (Armor)", "0.50", "0.675", "0.8375", "0.10"],
|
||||
["[T2 Resist]Minmatar (Shield)", "0.75", "0.60", "0.40", "0.50"],
|
||||
["[T2 Resist]Minmatar (Armor)", "0.90", "0.675", "0.25", "0.10"],
|
||||
["[NPC][Asteroid] Angel Cartel", "0.54", "0.42", "0.37", "0.32"],
|
||||
["[NPC][Asteroid] Blood Raiders", "0.34", "0.39", "0.45", "0.52"],
|
||||
["[NPC][Asteroid] Guristas", "0.55", "0.35", "0.3", "0.48"],
|
||||
["[NPC][Asteroid] Rogue Drones", "0.35", "0.38", "0.44", "0.49"],
|
||||
["[NPC][Asteroid] Sanshas Nation", "0.35", "0.4", "0.47", "0.53"],
|
||||
["[NPC][Asteroid] Serpentis", "0.49", "0.38", "0.29", "0.51"],
|
||||
["[NPC][Deadspace] Angel Cartel", "0.59", "0.48", "0.4", "0.32"],
|
||||
["[NPC][Deadspace] Blood Raiders", "0.31", "0.39", "0.47", "0.56"],
|
||||
["[NPC][Deadspace] Guristas", "0.57", "0.39", "0.31", "0.5"],
|
||||
["[NPC][Deadspace] Rogue Drones", "0.42", "0.42", "0.47", "0.49"],
|
||||
["[NPC][Deadspace] Sanshas Nation", "0.31", "0.39", "0.47", "0.56"],
|
||||
["[NPC][Deadspace] Serpentis", "0.49", "0.38", "0.29", "0.56"],
|
||||
["[NPC][Mission] Amarr Empire", "0.34", "0.38", "0.42", "0.46"],
|
||||
["[NPC][Mission] Caldari State", "0.51", "0.38", "0.3", "0.51"],
|
||||
["[NPC][Mission] CONCORD", "0.47", "0.46", "0.47", "0.47"],
|
||||
["[NPC][Mission] Gallente Federation", "0.51", "0.38", "0.31", "0.52"],
|
||||
["[NPC][Mission] Khanid", "0.51", "0.42", "0.36", "0.4"],
|
||||
["[NPC][Mission] Minmatar Republic", "0.51", "0.46", "0.41", "0.35"],
|
||||
["[NPC][Mission] Mordus Legion", "0.32", "0.48", "0.4", "0.62"],
|
||||
["[NPC][Other] Sleeper", "0.61", "0.61", "0.61", "0.61"],
|
||||
["[NPC][Other] Sansha Incursion", "0.65", "0.63", "0.64", "0.65"],
|
||||
["[NPC][Burner] Cruor (Blood Raiders)", "0.8", "0.73", "0.69", "0.67"],
|
||||
["[NPC][Burner] Dramiel (Angel)", "0.35", "0.48", "0.61", "0.68"],
|
||||
["[NPC][Burner] Daredevil (Serpentis)", "0.69", "0.59", "0.59", "0.43"],
|
||||
["[NPC][Burner] Succubus (Sanshas Nation)", "0.35", "0.48", "0.61", "0.68"],
|
||||
["[NPC][Burner] Worm (Guristas)", "0.48", "0.58", "0.69", "0.74"],
|
||||
["[NPC][Burner] Enyo", "0.58", "0.72", "0.86", "0.24"],
|
||||
["[NPC][Burner] Hawk", "0.3", "0.86", "0.79", "0.65"],
|
||||
["[NPC][Burner] Jaguar", "0.78", "0.65", "0.48", "0.56"],
|
||||
["[NPC][Burner] Vengeance", "0.66", "0.56", "0.75", "0.86"],
|
||||
["[NPC][Burner] Ashimmu (Blood Raiders)", "0.8", "0.76", "0.68", "0.7"],
|
||||
["[NPC][Burner] Talos", "0.68", "0.59", "0.59", "0.43"],
|
||||
["[NPC][Burner] Sentinel", "0.58", "0.45", "0.52", "0.66"]]
|
||||
|
||||
for targetResistProfileRow in targetResistProfileList:
|
||||
name, em, therm, kin, exp = targetResistProfileRow
|
||||
resistsProfile = eos.db.eos.db.getTargetResists(name)
|
||||
if resistsProfile is None:
|
||||
resistsProfile = es_TargetResists(em, therm, kin, exp)
|
||||
resistsProfile.name = name
|
||||
eos.db.save(resistsProfile)
|
||||
|
||||
@classmethod
|
||||
def importRequiredDefaults(cls):
|
||||
damageProfileList = [["Uniform", "25", "25", "25", "25"]]
|
||||
|
||||
for damageProfileRow in damageProfileList:
|
||||
name, em, therm, kin, exp = damageProfileRow
|
||||
damageProfile = eos.db.getDamagePattern(name)
|
||||
if damageProfile is None:
|
||||
damageProfile = es_DamagePattern(em, therm, kin, exp)
|
||||
damageProfile.name = name
|
||||
eos.db.save(damageProfile)
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2011 Anton Vorobyov
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,15 +15,16 @@
|
||||
#
|
||||
# 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 Column, Table, String
|
||||
from sqlalchemy.orm import mapper
|
||||
from eos.types import MiscData
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.miscData import MiscData
|
||||
|
||||
miscdata_table = Table("miscdata", saveddata_meta,
|
||||
Column("fieldName", String, primary_key=True),
|
||||
Column("fieldValue", String))
|
||||
Column("fieldName", String, primary_key=True),
|
||||
Column("fieldValue", String))
|
||||
|
||||
mapper(MiscData, miscdata_table)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,25 +15,28 @@
|
||||
#
|
||||
# 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, ForeignKey, CheckConstraint, Boolean
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, CheckConstraint, Boolean, DateTime
|
||||
from sqlalchemy.orm import relation, mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import Module, Fit
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.fit import Fit
|
||||
|
||||
modules_table = Table("modules", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable = False, index = True),
|
||||
Column("itemID", Integer, nullable = True),
|
||||
Column("dummySlot", Integer, nullable = True, default = None),
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False, index=True),
|
||||
Column("itemID", Integer, nullable=True),
|
||||
Column("dummySlot", Integer, nullable=True, default=None),
|
||||
Column("chargeID", Integer),
|
||||
Column("state", Integer, CheckConstraint("state >= -1"), CheckConstraint("state <= 2")),
|
||||
Column("projected", Boolean, default = False, nullable = False),
|
||||
Column("projected", Boolean, default=False, nullable=False),
|
||||
Column("position", Integer),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
|
||||
CheckConstraint('("dummySlot" = NULL OR "itemID" = NULL) AND "dummySlot" != "itemID"'))
|
||||
|
||||
mapper(Module, modules_table,
|
||||
properties = {"owner" : relation(Fit)})
|
||||
|
||||
properties={"owner": relation(Fit)})
|
||||
|
||||
35
eos/db/saveddata/override.py
Normal file
35
eos/db/saveddata/override.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# 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, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.saveddata.override import Override
|
||||
|
||||
overrides_table = Table("overrides", saveddata_meta,
|
||||
Column("itemID", Integer, primary_key=True, index=True),
|
||||
Column("attrID", Integer, primary_key=True, index=True),
|
||||
Column("value", Float, nullable=False),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(Override, overrides_table)
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,17 +15,18 @@
|
||||
#
|
||||
# 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, Float, Integer
|
||||
from sqlalchemy.orm import mapper
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import Price
|
||||
from eos.saveddata.price import Price
|
||||
|
||||
prices_table = Table("prices", saveddata_meta,
|
||||
Column("typeID", Integer, primary_key=True),
|
||||
Column("price", Float),
|
||||
Column("time", Integer, nullable = False),
|
||||
Column("time", Integer, nullable=False),
|
||||
Column("failed", Integer))
|
||||
|
||||
mapper(Price, prices_table)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,26 +15,44 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
|
||||
import sys
|
||||
|
||||
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, TargetResists, CrestChar
|
||||
from eos.db.saveddata.fleet import squadmembers_table
|
||||
from eos.db.saveddata.fit import projectedFits_table
|
||||
from sqlalchemy.sql import and_
|
||||
from sqlalchemy import desc, select
|
||||
|
||||
from eos.db import saveddata_session, sd_lock
|
||||
from eos.db.saveddata.fit import projectedFits_table
|
||||
from eos.db.util import processEager, processWhere
|
||||
from eos.saveddata.price import Price
|
||||
from eos.saveddata.user import User
|
||||
from eos.saveddata.crestchar import CrestChar
|
||||
from eos.saveddata.damagePattern import DamagePattern
|
||||
from eos.saveddata.targetResists import TargetResists
|
||||
from eos.saveddata.character import Character
|
||||
from eos.saveddata.implantSet import ImplantSet
|
||||
from eos.saveddata.fit import Fit
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.miscData import MiscData
|
||||
from eos.saveddata.override import Override
|
||||
|
||||
import eos.config
|
||||
|
||||
configVal = getattr(eos.config, "saveddataCache", None)
|
||||
if configVal is True:
|
||||
import weakref
|
||||
|
||||
itemCache = {}
|
||||
queryCache = {}
|
||||
|
||||
def cachedQuery(type, amount, *keywords):
|
||||
itemCache[type] = localItemCache = weakref.WeakValueDictionary()
|
||||
queryCache[type] = typeQueryCache = {}
|
||||
|
||||
def deco(function):
|
||||
localQueryCache = typeQueryCache[function] = {}
|
||||
|
||||
def setCache(cacheKey, args, kwargs):
|
||||
items = function(*args, **kwargs)
|
||||
IDs = set()
|
||||
@@ -43,7 +61,7 @@ if configVal is True:
|
||||
for item in stuff:
|
||||
ID = getattr(item, "ID", None)
|
||||
if ID is None:
|
||||
#Some uncachable data, don't cache this query
|
||||
# Some uncachable data, don't cache this query
|
||||
del localQueryCache[cacheKey]
|
||||
break
|
||||
localItemCache[ID] = item
|
||||
@@ -54,6 +72,7 @@ if configVal is True:
|
||||
def checkAndReturn(*args, **kwargs):
|
||||
useCache = kwargs.pop("useCache", True)
|
||||
cacheKey = []
|
||||
items = None
|
||||
cacheKey.extend(args)
|
||||
for keyword in keywords:
|
||||
cacheKey.append(kwargs.get(keyword))
|
||||
@@ -69,7 +88,7 @@ if configVal is True:
|
||||
for ID in IDs:
|
||||
data = localItemCache.get(ID)
|
||||
if data is None:
|
||||
#Fuck, some of our stuff isn't cached it seems.
|
||||
# Fuck, some of our stuff isn't cached it seems.
|
||||
items = setCache(cacheKey, args, kwargs)
|
||||
break
|
||||
items.append(data)
|
||||
@@ -81,11 +100,13 @@ if configVal is True:
|
||||
break
|
||||
|
||||
return items
|
||||
|
||||
return checkAndReturn
|
||||
|
||||
return deco
|
||||
|
||||
def removeCachedEntry(type, ID):
|
||||
if not type in queryCache:
|
||||
if type not in queryCache:
|
||||
return
|
||||
functionCache = queryCache[type]
|
||||
for _, localCache in functionCache.iteritems():
|
||||
@@ -110,11 +131,13 @@ else:
|
||||
return function(*args, **kwargs)
|
||||
|
||||
return checkAndReturn
|
||||
|
||||
return deco
|
||||
|
||||
def removeCachedEntry(*args, **kwargs):
|
||||
return
|
||||
|
||||
|
||||
def sqlizeString(line):
|
||||
# Escape backslashes first, as they will be as escape symbol in queries
|
||||
# Then escape percent and underscore signs
|
||||
@@ -122,6 +145,7 @@ def sqlizeString(line):
|
||||
line = line.replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_").replace("*", "%")
|
||||
return line
|
||||
|
||||
|
||||
@cachedQuery(User, 1, "lookfor")
|
||||
def getUser(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
@@ -140,6 +164,7 @@ def getUser(lookfor, eager=None):
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return user
|
||||
|
||||
|
||||
@cachedQuery(Character, 1, "lookfor")
|
||||
def getCharacter(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
@@ -153,17 +178,20 @@ def getCharacter(lookfor, eager=None):
|
||||
elif isinstance(lookfor, basestring):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
character = saveddata_session.query(Character).options(*eager).filter(Character.name == lookfor).first()
|
||||
character = saveddata_session.query(Character).options(*eager).filter(
|
||||
Character.savedName == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return character
|
||||
|
||||
|
||||
def getCharacterList(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
characters = saveddata_session.query(Character).options(*eager).all()
|
||||
return characters
|
||||
|
||||
|
||||
def getCharactersForUser(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
eager = processEager(eager)
|
||||
@@ -173,6 +201,7 @@ def getCharactersForUser(lookfor, eager=None):
|
||||
raise TypeError("Need integer as argument")
|
||||
return characters
|
||||
|
||||
|
||||
@cachedQuery(Fit, 1, "lookfor")
|
||||
def getFit(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
@@ -182,7 +211,7 @@ def getFit(lookfor, eager=None):
|
||||
else:
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fit = saveddata_session.query(Fit).options(*eager).filter(Fit.ID == fitID).first()
|
||||
fit = saveddata_session.query(Fit).options(*eager).filter(Fit.ID == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
|
||||
@@ -193,47 +222,6 @@ def getFit(lookfor, eager=None):
|
||||
|
||||
return fit
|
||||
|
||||
@cachedQuery(Fleet, 1, "fleetID")
|
||||
def getFleet(fleetID, eager=None):
|
||||
if isinstance(fleetID, int):
|
||||
if eager is None:
|
||||
with sd_lock:
|
||||
fleet = saveddata_session.query(Fleet).get(fleetID)
|
||||
else:
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fleet = saveddata_session.query(Fleet).options(*eager).filter(Fleet.ID == fleetID).first()
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
return fleet
|
||||
|
||||
@cachedQuery(Wing, 1, "wingID")
|
||||
def getWing(wingID, eager=None):
|
||||
if isinstance(wingID, int):
|
||||
if eager is None:
|
||||
with sd_lock:
|
||||
wing = saveddata_session.query(Wing).get(wingID)
|
||||
else:
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
wing = saveddata_session.query(Wing).options(*eager).filter(Wing.ID == wingID).first()
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
return wing
|
||||
|
||||
@cachedQuery(Squad, 1, "squadID")
|
||||
def getSquad(squadID, eager=None):
|
||||
if isinstance(squadID, int):
|
||||
if eager is None:
|
||||
with sd_lock:
|
||||
squad = saveddata_session.query(Squad).get(squadID)
|
||||
else:
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
squad = saveddata_session.query(Squad).options(*eager).filter(Fleet.ID == squadID).first()
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
return squad
|
||||
|
||||
def getFitsWithShip(shipID, ownerID=None, where=None, eager=None):
|
||||
"""
|
||||
@@ -256,50 +244,73 @@ def getFitsWithShip(shipID, ownerID=None, where=None, eager=None):
|
||||
|
||||
return fits
|
||||
|
||||
def getBoosterFits(ownerID=None, where=None, eager=None):
|
||||
"""
|
||||
Get all the fits that are flagged as a boosting ship
|
||||
If no user is passed, do this for all users.
|
||||
"""
|
||||
|
||||
if ownerID is not None and not isinstance(ownerID, int):
|
||||
raise TypeError("OwnerID must be integer")
|
||||
filter = Fit.booster == 1
|
||||
if ownerID is not None:
|
||||
filter = and_(filter, Fit.ownerID == ownerID)
|
||||
|
||||
filter = processWhere(filter, where)
|
||||
def getRecentFits(ownerID=None, where=None, eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fits = removeInvalid(saveddata_session.query(Fit).options(*eager).filter(filter).all())
|
||||
q = select((
|
||||
Fit.ID,
|
||||
Fit.shipID,
|
||||
Fit.name,
|
||||
Fit.modified,
|
||||
Fit.created,
|
||||
Fit.timestamp,
|
||||
Fit.notes
|
||||
)).order_by(desc(Fit.modified), desc(Fit.timestamp)).limit(50)
|
||||
fits = eos.db.saveddata_session.execute(q).fetchall()
|
||||
|
||||
return fits
|
||||
|
||||
|
||||
def getFitsWithModules(typeIDs, eager=None):
|
||||
"""
|
||||
Get all the fits that have typeIDs fitted to them
|
||||
"""
|
||||
|
||||
if not hasattr(typeIDs, "__iter__"):
|
||||
typeIDs = (typeIDs,)
|
||||
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fits = removeInvalid(saveddata_session.query(Fit).join(Module).options(*eager).filter(Module.itemID.in_(typeIDs)).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):
|
||||
|
||||
def countFitsWithShip(lookfor, ownerID=None, where=None, eager=None):
|
||||
"""
|
||||
Get all the fits using a certain ship.
|
||||
If no user is passed, do this for all users.
|
||||
"""
|
||||
if isinstance(shipID, int):
|
||||
if ownerID is not None and not isinstance(ownerID, int):
|
||||
raise TypeError("OwnerID must be integer")
|
||||
filter = Fit.shipID == shipID
|
||||
if ownerID is not None:
|
||||
filter = and_(filter, Fit.ownerID == ownerID)
|
||||
if ownerID is not None and not isinstance(ownerID, int):
|
||||
raise TypeError("OwnerID must be integer")
|
||||
|
||||
filter = processWhere(filter, where)
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
count = saveddata_session.query(Fit).options(*eager).filter(filter).count()
|
||||
if isinstance(lookfor, int):
|
||||
filter = Fit.shipID == lookfor
|
||||
elif isinstance(lookfor, list):
|
||||
if len(lookfor) == 0:
|
||||
return 0
|
||||
filter = Fit.shipID.in_(lookfor)
|
||||
else:
|
||||
raise TypeError("ShipID must be integer")
|
||||
raise TypeError("You must supply either an integer or ShipID must be integer")
|
||||
|
||||
if ownerID is not None:
|
||||
filter = and_(filter, Fit.ownerID == ownerID)
|
||||
|
||||
filter = processWhere(filter, where)
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
count = saveddata_session.query(Fit).options(*eager).filter(filter).count()
|
||||
|
||||
return count
|
||||
|
||||
|
||||
def getFitList(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
@@ -307,11 +318,6 @@ def getFitList(eager=None):
|
||||
|
||||
return fits
|
||||
|
||||
def getFleetList(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
fleets = saveddata_session.query(Fleet).options(*eager).all()
|
||||
return fleets
|
||||
|
||||
@cachedQuery(Price, 1, "typeID")
|
||||
def getPrice(typeID):
|
||||
@@ -322,12 +328,14 @@ 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:
|
||||
@@ -336,18 +344,42 @@ def getMiscData(field):
|
||||
raise TypeError("Need string as argument")
|
||||
return data
|
||||
|
||||
|
||||
def getDamagePatternList(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
patterns = saveddata_session.query(DamagePattern).options(*eager).all()
|
||||
return patterns
|
||||
|
||||
|
||||
def clearDamagePatterns():
|
||||
with sd_lock:
|
||||
deleted_rows = saveddata_session.query(DamagePattern).filter(DamagePattern.name != 'Uniform').delete()
|
||||
commit()
|
||||
return deleted_rows
|
||||
|
||||
|
||||
def getTargetResistsList(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
patterns = saveddata_session.query(TargetResists).options(*eager).all()
|
||||
return patterns
|
||||
|
||||
|
||||
def clearTargetResists():
|
||||
with sd_lock:
|
||||
deleted_rows = saveddata_session.query(TargetResists).delete()
|
||||
commit()
|
||||
return deleted_rows
|
||||
|
||||
|
||||
def getImplantSetList(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
sets = saveddata_session.query(ImplantSet).options(*eager).all()
|
||||
return sets
|
||||
|
||||
|
||||
@cachedQuery(DamagePattern, 1, "lookfor")
|
||||
def getDamagePattern(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
@@ -357,15 +389,18 @@ def getDamagePattern(lookfor, eager=None):
|
||||
else:
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(DamagePattern).options(*eager).filter(DamagePattern.ID == lookfor).first()
|
||||
pattern = saveddata_session.query(DamagePattern).options(*eager).filter(
|
||||
DamagePattern.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(DamagePattern).options(*eager).filter(DamagePattern.name == lookfor).first()
|
||||
pattern = saveddata_session.query(DamagePattern).options(*eager).filter(
|
||||
DamagePattern.name == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return pattern
|
||||
|
||||
|
||||
@cachedQuery(TargetResists, 1, "lookfor")
|
||||
def getTargetResists(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
@@ -375,22 +410,45 @@ def getTargetResists(lookfor, eager=None):
|
||||
else:
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(TargetResists).options(*eager).filter(TargetResists.ID == lookfor).first()
|
||||
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()
|
||||
pattern = saveddata_session.query(TargetResists).options(*eager).filter(
|
||||
TargetResists.name == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return pattern
|
||||
|
||||
|
||||
@cachedQuery(ImplantSet, 1, "lookfor")
|
||||
def getImplantSet(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
if eager is None:
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(ImplantSet).get(lookfor)
|
||||
else:
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(ImplantSet).options(*eager).filter(
|
||||
TargetResists.ID == lookfor).first()
|
||||
elif isinstance(lookfor, basestring):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
pattern = saveddata_session.query(ImplantSet).options(*eager).filter(TargetResists.name == lookfor).first()
|
||||
else:
|
||||
raise TypeError("Improper argument")
|
||||
return pattern
|
||||
|
||||
|
||||
def searchFits(nameLike, where=None, eager=None):
|
||||
if not isinstance(nameLike, basestring):
|
||||
raise TypeError("Need string as argument")
|
||||
# Prepare our string for request
|
||||
nameLike = u"%{0}%".format(sqlizeString(nameLike))
|
||||
|
||||
#Add any extra components to the search to our where clause
|
||||
# Add any extra components to the search to our where clause
|
||||
filter = processWhere(Fit.name.like(nameLike, escape="\\"), where)
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
@@ -398,14 +456,6 @@ def searchFits(nameLike, where=None, eager=None):
|
||||
|
||||
return fits
|
||||
|
||||
def getSquadsIDsWithFitID(fitID):
|
||||
if isinstance(fitID, int):
|
||||
with sd_lock:
|
||||
squads = saveddata_session.query(squadmembers_table.c.squadID).filter(squadmembers_table.c.memberID == fitID).all()
|
||||
squads = tuple(entry[0] for entry in squads)
|
||||
return squads
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
|
||||
def getProjectedFits(fitID):
|
||||
if isinstance(fitID, int):
|
||||
@@ -416,12 +466,14 @@ def getProjectedFits(fitID):
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
|
||||
|
||||
def getCrestCharacters(eager=None):
|
||||
eager = processEager(eager)
|
||||
with sd_lock:
|
||||
characters = saveddata_session.query(CrestChar).options(*eager).all()
|
||||
return characters
|
||||
|
||||
|
||||
@cachedQuery(CrestChar, 1, "lookfor")
|
||||
def getCrestCharacter(lookfor, eager=None):
|
||||
if isinstance(lookfor, int):
|
||||
@@ -440,6 +492,25 @@ def getCrestCharacter(lookfor, eager=None):
|
||||
raise TypeError("Need integer or string as argument")
|
||||
return character
|
||||
|
||||
|
||||
def getOverrides(itemID, eager=None):
|
||||
if isinstance(itemID, int):
|
||||
return saveddata_session.query(Override).filter(Override.itemID == itemID).all()
|
||||
else:
|
||||
raise TypeError("Need integer as argument")
|
||||
|
||||
|
||||
def clearOverrides():
|
||||
with sd_lock:
|
||||
deleted_rows = saveddata_session.query(Override).delete()
|
||||
commit()
|
||||
return deleted_rows
|
||||
|
||||
|
||||
def getAllOverrides(eager=None):
|
||||
return saveddata_session.query(Override).all()
|
||||
|
||||
|
||||
def removeInvalid(fits):
|
||||
invalids = [f for f in fits if f.isInvalid]
|
||||
|
||||
@@ -450,14 +521,17 @@ def removeInvalid(fits):
|
||||
|
||||
return fits
|
||||
|
||||
|
||||
def add(stuff):
|
||||
with sd_lock:
|
||||
saveddata_session.add(stuff)
|
||||
|
||||
|
||||
def save(stuff):
|
||||
add(stuff)
|
||||
commit()
|
||||
|
||||
|
||||
def remove(stuff):
|
||||
removeCachedEntry(type(stuff), stuff.ID)
|
||||
with sd_lock:
|
||||
@@ -467,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], exc_info[2]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,17 +15,22 @@
|
||||
#
|
||||
# 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, ForeignKey
|
||||
from sqlalchemy import Table, Column, Integer, ForeignKey, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import Skill
|
||||
from eos.saveddata.character import Skill
|
||||
|
||||
|
||||
skills_table = Table("characterSkills", saveddata_meta,
|
||||
Column("characterID", ForeignKey("characters.ID"), primary_key = True, index = True),
|
||||
Column("itemID", Integer, primary_key = True),
|
||||
Column("_Skill__level", Integer, nullable = True))
|
||||
Column("characterID", ForeignKey("characters.ID"), primary_key=True, index=True),
|
||||
Column("itemID", Integer, primary_key=True),
|
||||
Column("_Skill__level", Integer, nullable=True),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(Skill, skills_table)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2014 Ryan Holmes
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,21 +15,25 @@
|
||||
#
|
||||
# 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 import Table, Column, Integer, Float, ForeignKey, String, DateTime
|
||||
from sqlalchemy.orm import mapper
|
||||
import datetime
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import TargetResists
|
||||
from eos.saveddata.targetResists 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))
|
||||
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),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
|
||||
)
|
||||
|
||||
mapper(TargetResists, targetResists_table)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,18 +15,18 @@
|
||||
#
|
||||
# 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, String, Boolean
|
||||
from sqlalchemy.orm import mapper
|
||||
|
||||
from eos.db import saveddata_meta
|
||||
from eos.types import User
|
||||
from eos.saveddata.user import User
|
||||
|
||||
users_table = Table("users", saveddata_meta,
|
||||
Column("ID", Integer, primary_key = True),
|
||||
Column("username", String, nullable = False, unique = True),
|
||||
Column("password", String, nullable = False),
|
||||
Column("admin", Boolean, nullable = False))
|
||||
Column("ID", Integer, primary_key=True),
|
||||
Column("username", String, nullable=False, unique=True),
|
||||
Column("password", String, nullable=False),
|
||||
Column("admin", Boolean, nullable=False))
|
||||
|
||||
mapper(User, users_table)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,24 +15,27 @@
|
||||
#
|
||||
# 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.orm import eagerload
|
||||
from sqlalchemy.sql import and_
|
||||
|
||||
replace = {"attributes": "_Item__attributes",
|
||||
"modules": "_Fit__modules",
|
||||
"projectedModules": "_Fit__projectedModules",
|
||||
"boosters": "_Fit__boosters",
|
||||
"drones": "_Fit__drones",
|
||||
"projectedDrones": "_Fit__projectedDrones",
|
||||
"implants": "_Fit__implants",
|
||||
"character": "_Fit__character",
|
||||
"damagePattern": "_Fit__damagePattern",
|
||||
"projectedFits": "_Fit__projectedFits"}
|
||||
replace = {
|
||||
"attributes" : "_Item__attributes",
|
||||
"modules" : "_Fit__modules",
|
||||
"projectedModules": "_Fit__projectedModules",
|
||||
"boosters" : "_Fit__boosters",
|
||||
"drones" : "_Fit__drones",
|
||||
"projectedDrones" : "_Fit__projectedDrones",
|
||||
"implants" : "_Fit__implants",
|
||||
"character" : "_Fit__character",
|
||||
"damagePattern" : "_Fit__damagePattern",
|
||||
"projectedFits" : "_Fit__projectedFits"
|
||||
}
|
||||
|
||||
|
||||
def processEager(eager):
|
||||
if eager == None:
|
||||
if eager is None:
|
||||
return tuple()
|
||||
else:
|
||||
l = []
|
||||
@@ -44,6 +47,7 @@ def processEager(eager):
|
||||
|
||||
return l
|
||||
|
||||
|
||||
def _replacements(eagerString):
|
||||
splitEager = eagerString.split(".")
|
||||
for i in xrange(len(splitEager)):
|
||||
@@ -54,6 +58,7 @@ def _replacements(eagerString):
|
||||
|
||||
return ".".join(splitEager)
|
||||
|
||||
|
||||
def processWhere(clause, where):
|
||||
if where is not None:
|
||||
if not hasattr(where, "__iter__"):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of eos.
|
||||
@@ -15,14 +15,12 @@
|
||||
#
|
||||
# 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.orm.attributes import flag_modified
|
||||
import eos.db
|
||||
import eos.types
|
||||
import logging
|
||||
from logbook import Logger
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class HandledList(list):
|
||||
def filteredItemPreAssign(self, filter, *args, **kwargs):
|
||||
@@ -108,11 +106,12 @@ class HandledList(list):
|
||||
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")
|
||||
# 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")
|
||||
@@ -135,6 +134,7 @@ class HandledModuleList(HandledList):
|
||||
HandledList.append(self, mod)
|
||||
if mod.isInvalid:
|
||||
self.remove(mod)
|
||||
return
|
||||
|
||||
def insert(self, index, mod):
|
||||
mod.position = index
|
||||
@@ -155,7 +155,7 @@ class HandledModuleList(HandledList):
|
||||
def toDummy(self, index):
|
||||
mod = self[index]
|
||||
if not mod.isEmpty:
|
||||
dummy = eos.types.Module.buildEmpty(mod.slot)
|
||||
dummy = mod.buildEmpty(mod.slot)
|
||||
dummy.position = index
|
||||
self[index] = dummy
|
||||
|
||||
@@ -164,10 +164,12 @@ class HandledModuleList(HandledList):
|
||||
self[index] = mod
|
||||
|
||||
def freeSlot(self, slot):
|
||||
for i in range(len(self) -1, -1, -1):
|
||||
for i in range(len(self)):
|
||||
mod = self[i]
|
||||
if mod.getModifiedItemAttr("subSystemSlot") == slot:
|
||||
del self[i]
|
||||
self.toDummy(i)
|
||||
break
|
||||
|
||||
|
||||
class HandledDroneCargoList(HandledList):
|
||||
def find(self, item):
|
||||
@@ -185,6 +187,7 @@ class HandledDroneCargoList(HandledList):
|
||||
if thing.isInvalid:
|
||||
self.remove(thing)
|
||||
|
||||
|
||||
class HandledImplantBoosterList(HandledList):
|
||||
def append(self, thing):
|
||||
if thing.isInvalid:
|
||||
@@ -195,12 +198,13 @@ class HandledImplantBoosterList(HandledList):
|
||||
# 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)
|
||||
pyfalog.info("Slot {0} occupied with {1}, replacing with {2}", thing.slot, oldObj.item.name, thing.item.name)
|
||||
oldObj.itemID = 0 # hack to remove from DB. See GH issue #324
|
||||
self.remove(oldObj)
|
||||
|
||||
HandledList.append(self, thing)
|
||||
|
||||
|
||||
class HandledProjectedModList(HandledList):
|
||||
def append(self, proj):
|
||||
if proj.isInvalid:
|
||||
@@ -218,7 +222,7 @@ class HandledProjectedModList(HandledList):
|
||||
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)
|
||||
pyfalog.info("System effect occupied with {0}, replacing with {1}", oldEffect.item.name, proj.item.name)
|
||||
self.remove(oldEffect)
|
||||
|
||||
HandledList.append(self, proj)
|
||||
@@ -227,6 +231,7 @@ class HandledProjectedModList(HandledList):
|
||||
if not proj.item.isType("projected") and not isSystemEffect:
|
||||
self.remove(proj)
|
||||
|
||||
|
||||
class HandledProjectedDroneList(HandledDroneCargoList):
|
||||
def append(self, proj):
|
||||
proj.projected = True
|
||||
@@ -236,6 +241,7 @@ class HandledProjectedDroneList(HandledDroneCargoList):
|
||||
if proj.isInvalid or not proj.item.isType("projected"):
|
||||
self.remove(proj)
|
||||
|
||||
|
||||
class HandledItem(object):
|
||||
def preAssignItemAttr(self, *args, **kwargs):
|
||||
self.itemModifiedAttributes.preAssign(*args, **kwargs)
|
||||
@@ -252,6 +258,7 @@ class HandledItem(object):
|
||||
def forceItemAttr(self, *args, **kwargs):
|
||||
self.itemModifiedAttributes.force(*args, **kwargs)
|
||||
|
||||
|
||||
class HandledCharge(object):
|
||||
def preAssignChargeAttr(self, *args, **kwargs):
|
||||
self.chargeModifiedAttributes.preAssign(*args, **kwargs)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
# 2010 Anton Vorobyov
|
||||
#
|
||||
@@ -16,4 +16,4 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
#===============================================================================
|
||||
# ===============================================================================
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
# Used by:
|
||||
# Modules named like: Dynamic Fuel Valve (8 of 8)
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, container, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Propulsion Module",
|
||||
"capacitorNeed", container.getModifiedItemAttr("capNeedBonus"))
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
# Implant: Zor's Custom Navigation Hyper-Link
|
||||
# Skill: Acceleration Control
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, container, context):
|
||||
level = container.level if "skill" in context else 1
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Propulsion Module",
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
# Used by:
|
||||
# Implants named like: Eifyr and Co. 'Rogue' Acceleration Control AC (6 of 6)
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, implant, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Propulsion Module",
|
||||
"speedFactor", implant.getModifiedItemAttr("speedFBonus"))
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
# Implant: Poteque 'Prospector' Archaeology AC-905
|
||||
# Implant: Poteque 'Prospector' Environmental Analysis EY-1005
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, container, context):
|
||||
fit.modules.filteredItemIncrease(lambda module: module.item.requiresSkill("Archaeology"),
|
||||
"accessDifficultyBonus",
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
# Implant: Poteque 'Prospector' Environmental Analysis EY-1005
|
||||
# Implant: Poteque 'Prospector' Hacking HC-905
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, container, context):
|
||||
fit.modules.filteredItemIncrease(lambda c: c.item.requiresSkill("Hacking"),
|
||||
"accessDifficultyBonus",
|
||||
container.getModifiedItemAttr("accessDifficultyBonusModifier"), position="post")
|
||||
"accessDifficultyBonus",
|
||||
container.getModifiedItemAttr("accessDifficultyBonusModifier"), position="post")
|
||||
|
||||
@@ -2,9 +2,124 @@
|
||||
#
|
||||
# Used by:
|
||||
# Module: Reactive Armor Hardener
|
||||
from logbook import Logger
|
||||
import eos.config
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
runTime = "late"
|
||||
type = "active"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
for type in ("kinetic", "thermal", "explosive", "em"):
|
||||
attr = "armor%sDamageResonance" % type.capitalize()
|
||||
fit.ship.multiplyItemAttr(attr, module.getModifiedItemAttr(attr),
|
||||
stackingPenalties=True, penaltyGroup="preMul")
|
||||
damagePattern = fit.damagePattern
|
||||
|
||||
static_adaptive_behavior = eos.config.settings['useStaticAdaptiveArmorHardener']
|
||||
|
||||
if (damagePattern.emAmount == damagePattern.thermalAmount == damagePattern.kineticAmount == damagePattern.explosiveAmount) and static_adaptive_behavior:
|
||||
pyfalog.debug("Setting adaptivearmorhardener resists to uniform profile.")
|
||||
return
|
||||
|
||||
# Skip if there is no damage pattern. Example: projected ships or fleet boosters
|
||||
if damagePattern:
|
||||
|
||||
# Populate a tuple with the damage profile modified by current armor resists.
|
||||
baseDamageTaken = (
|
||||
damagePattern.emAmount * fit.ship.getModifiedItemAttr('armorEmDamageResonance'),
|
||||
damagePattern.thermalAmount * fit.ship.getModifiedItemAttr('armorThermalDamageResonance'),
|
||||
damagePattern.kineticAmount * fit.ship.getModifiedItemAttr('armorKineticDamageResonance'),
|
||||
damagePattern.explosiveAmount * fit.ship.getModifiedItemAttr('armorExplosiveDamageResonance'),
|
||||
)
|
||||
# pyfalog.debug("Damage Adjusted for Armor Resists: %f/%f/%f/%f", baseDamageTaken[0], baseDamageTaken[1], baseDamageTaken[2], baseDamageTaken[3])
|
||||
|
||||
resistanceShiftAmount = module.getModifiedItemAttr(
|
||||
'resistanceShiftAmount') / 100 # The attribute is in percent and we want a fraction
|
||||
RAHResistance = [
|
||||
module.getModifiedItemAttr('armorEmDamageResonance'),
|
||||
module.getModifiedItemAttr('armorThermalDamageResonance'),
|
||||
module.getModifiedItemAttr('armorKineticDamageResonance'),
|
||||
module.getModifiedItemAttr('armorExplosiveDamageResonance'),
|
||||
]
|
||||
|
||||
# Simulate RAH cycles until the RAH either stops changing or enters a loop.
|
||||
# The number of iterations is limited to prevent an infinite loop if something goes wrong.
|
||||
cycleList = []
|
||||
loopStart = -20
|
||||
for num in range(50):
|
||||
# pyfalog.debug("Starting cycle %d.", num)
|
||||
# The strange order is to emulate the ingame sorting when different types have taken the same amount of damage.
|
||||
# This doesn't take into account stacking penalties. In a few cases fitting a Damage Control causes an inaccurate result.
|
||||
damagePattern_tuples = [
|
||||
(0, baseDamageTaken[0] * RAHResistance[0], RAHResistance[0]),
|
||||
(3, baseDamageTaken[3] * RAHResistance[3], RAHResistance[3]),
|
||||
(2, baseDamageTaken[2] * RAHResistance[2], RAHResistance[2]),
|
||||
(1, baseDamageTaken[1] * RAHResistance[1], RAHResistance[1]),
|
||||
]
|
||||
|
||||
# Sort the tuple to drop the highest damage value to the bottom
|
||||
sortedDamagePattern_tuples = sorted(damagePattern_tuples, key=lambda damagePattern: damagePattern[1])
|
||||
|
||||
if sortedDamagePattern_tuples[2][1] == 0:
|
||||
# One damage type: the top damage type takes from the other three
|
||||
# Since the resistances not taking damage will end up going to the type taking damage we just do the whole thing at once.
|
||||
change0 = 1 - sortedDamagePattern_tuples[0][2]
|
||||
change1 = 1 - sortedDamagePattern_tuples[1][2]
|
||||
change2 = 1 - sortedDamagePattern_tuples[2][2]
|
||||
change3 = -(change0 + change1 + change2)
|
||||
elif sortedDamagePattern_tuples[1][1] == 0:
|
||||
# Two damage types: the top two damage types take from the other two
|
||||
# Since the resistances not taking damage will end up going equally to the types taking damage we just do the whole thing at once.
|
||||
change0 = 1 - sortedDamagePattern_tuples[0][2]
|
||||
change1 = 1 - sortedDamagePattern_tuples[1][2]
|
||||
change2 = -(change0 + change1) / 2
|
||||
change3 = -(change0 + change1) / 2
|
||||
else:
|
||||
# Three or four damage types: the top two damage types take from the other two
|
||||
change0 = min(resistanceShiftAmount, 1 - sortedDamagePattern_tuples[0][2])
|
||||
change1 = min(resistanceShiftAmount, 1 - sortedDamagePattern_tuples[1][2])
|
||||
change2 = -(change0 + change1) / 2
|
||||
change3 = -(change0 + change1) / 2
|
||||
|
||||
RAHResistance[sortedDamagePattern_tuples[0][0]] = sortedDamagePattern_tuples[0][2] + change0
|
||||
RAHResistance[sortedDamagePattern_tuples[1][0]] = sortedDamagePattern_tuples[1][2] + change1
|
||||
RAHResistance[sortedDamagePattern_tuples[2][0]] = sortedDamagePattern_tuples[2][2] + change2
|
||||
RAHResistance[sortedDamagePattern_tuples[3][0]] = sortedDamagePattern_tuples[3][2] + change3
|
||||
# pyfalog.debug("Resistances shifted to %f/%f/%f/%f", RAHResistance[0], RAHResistance[1], RAHResistance[2], RAHResistance[3])
|
||||
|
||||
# See if the current RAH profile has been encountered before, indicating a loop.
|
||||
for i, val in enumerate(cycleList):
|
||||
tolerance = 1e-06
|
||||
if abs(RAHResistance[0] - val[0]) <= tolerance and \
|
||||
abs(RAHResistance[1] - val[1]) <= tolerance and \
|
||||
abs(RAHResistance[2] - val[2]) <= tolerance and \
|
||||
abs(RAHResistance[3] - val[3]) <= tolerance:
|
||||
loopStart = i
|
||||
# pyfalog.debug("Loop found: %d-%d", loopStart, num)
|
||||
break
|
||||
if loopStart >= 0:
|
||||
break
|
||||
|
||||
cycleList.append(list(RAHResistance))
|
||||
|
||||
if loopStart < 0:
|
||||
pyfalog.error("Reactive Armor Hardener failed to find equilibrium. Damage profile after armor: {0}/{1}/{2}/{3}",
|
||||
baseDamageTaken[0], baseDamageTaken[1], baseDamageTaken[2], baseDamageTaken[3])
|
||||
|
||||
# Average the profiles in the RAH loop, or the last 20 if it didn't find a loop.
|
||||
loopCycles = cycleList[loopStart:]
|
||||
numCycles = len(loopCycles)
|
||||
average = [0, 0, 0, 0]
|
||||
for cycle in loopCycles:
|
||||
for i in range(4):
|
||||
average[i] += cycle[i]
|
||||
|
||||
for i in range(4):
|
||||
average[i] = round(average[i] / numCycles, 3)
|
||||
|
||||
# Set the new resistances
|
||||
# pyfalog.debug("Setting new resist profile: %f/%f/%f/%f", average[0], average[1], average[2],average[3])
|
||||
for i, attr in enumerate((
|
||||
'armorEmDamageResonance', 'armorThermalDamageResonance', 'armorKineticDamageResonance',
|
||||
'armorExplosiveDamageResonance')):
|
||||
module.increaseItemAttr(attr, average[i] - module.getModifiedItemAttr(attr))
|
||||
fit.ship.multiplyItemAttr(attr, average[i], stackingPenalties=True, penaltyGroup="preMul")
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Missile Launcher Bomb (2 of 2)
|
||||
# Modules from group: Shield Extender (25 of 25)
|
||||
# Modules from group: Shield Extender (33 of 33)
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
fit.ship.increaseItemAttr("signatureRadius", module.getModifiedItemAttr("signatureRadiusAdd"))
|
||||
fit.ship.increaseItemAttr("signatureRadius", module.getModifiedItemAttr("signatureRadiusAdd"))
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# advancedDroneInterfacingMaxGroupDCUSkillLevel
|
||||
#
|
||||
# Used by:
|
||||
# Skill: Advanced Drone Interfacing
|
||||
type = "passive"
|
||||
def handler(fit, skill, context):
|
||||
fit.modules.filteredItemIncrease(lambda mod: mod.item.group.name == "Drone Control Unit",
|
||||
"maxGroupActive", skill.level)
|
||||
@@ -5,7 +5,9 @@
|
||||
# Implant: Zor's Custom Navigation Link
|
||||
# Skill: Afterburner
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, container, context):
|
||||
level = container.level if "skill" in context else 1
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Afterburner"),
|
||||
"duration", container.getModifiedItemAttr("durationBonus") * level)
|
||||
"duration", container.getModifiedItemAttr("durationBonus") * level)
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
# 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",
|
||||
module.getModifiedItemAttr("agilityMultiplier"),
|
||||
stackingPenalties = True)
|
||||
stackingPenalties=True)
|
||||
|
||||
@@ -3,5 +3,7 @@
|
||||
# Used by:
|
||||
# Modules named like: Polycarbon Engine Housing (8 of 8)
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
fit.ship.boostItemAttr("agility", module.getModifiedItemAttr("agilityMultiplier"), stackingPenalties = True)
|
||||
fit.ship.boostItemAttr("agility", module.getModifiedItemAttr("agilityMultiplier"), stackingPenalties=True)
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
# ammoFallofMultiplier
|
||||
#
|
||||
# Used by:
|
||||
# Charges from group: Advanced Artillery Ammo (6 of 6)
|
||||
# Charges from group: Advanced Autocannon Ammo (6 of 6)
|
||||
# Charges from group: Advanced Beam Laser Crystal (6 of 6)
|
||||
# Charges from group: Advanced Blaster Charge (6 of 6)
|
||||
# Charges from group: Advanced Pulse Laser Crystal (6 of 6)
|
||||
# Charges from group: Advanced Railgun Charge (6 of 6)
|
||||
# Charges from group: Advanced Artillery Ammo (8 of 8)
|
||||
# Charges from group: Advanced Autocannon Ammo (8 of 8)
|
||||
# Charges from group: Advanced Beam Laser Crystal (8 of 8)
|
||||
# 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)
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
module.multiplyItemAttr("falloff", module.getModifiedChargeAttr("fallofMultiplier") or 1)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
# ammoInfluenceCapNeed
|
||||
#
|
||||
# Used by:
|
||||
# Items from category: Charge (458 of 831)
|
||||
# Items from category: Charge (466 of 913)
|
||||
# Charges from group: Frequency Crystal (185 of 185)
|
||||
# Charges from group: Hybrid Charge (209 of 209)
|
||||
type = "passive"
|
||||
|
||||
|
||||
def handler(fit, module, context):
|
||||
# Dirty hack to work around cap charges setting cap booster
|
||||
# injection amount to zero
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user