Compare commits

...

465 Commits

Author SHA1 Message Date
Ryan Holmes
ca27cd3250 bump stable release (#1329) 2017-10-29 18:54:46 -04:00
Ryan Holmes
c0e15f61c6 Merge pull request #1322 from burnsypet/issue-1315
Stop applying neut resistance twice
2017-10-29 15:27:27 -04:00
blitzmann
4355f35eef Revert "Stop applying neut resistance twice" and instead remove the resistance application from addDrain()
This reverts commit 7b32fe08ac.
2017-10-29 15:07:05 -04:00
Ryan Holmes
029e61edaf Merge branch 'master' into issue-1315 2017-10-29 12:36:29 -04:00
Ryan Holmes
b18f82505b Merge pull request #1327 from pyfa-org/bug1316
Bug1316
2017-10-29 12:25:00 -04:00
blitzmann
f8a65de47f tox fix 2017-10-29 12:23:45 -04:00
blitzmann
e5a0ef1877 Re-work menu spawning for Command and Projected views to be a bit more straightforward and allow spawning up context menu when right clicking the DummyEntry (#1316) 2017-10-29 12:22:15 -04:00
Ryan Holmes
8647fe460c Merge pull request #1326 from pyfa-org/133bugfixes
133bugfixes
2017-10-28 22:44:27 -04:00
blitzmann
a4950e9015 Remove the rifter test as it's not properly mocked out and recent balancing passes have since made it useless 2017-10-28 22:36:00 -04:00
blitzmann
82d50cfa0d Fix effect that used to only be for skill, but is now for a booster (#1324) 2017-10-28 21:04:51 -04:00
blitzmann
efea46006a Better include all missiles in the MISC column (#1325) 2017-10-28 20:37:29 -04:00
blitzmann
d9800dcf19 Fix some effects for #1320 2017-10-28 19:45:09 -04:00
blitzmann
266b3ce985 Set Victor and Virtuso to not published, and fix bug which allowed user fits to return in search even if ship isn't published (#1310) 2017-10-28 19:25:19 -04:00
blitzmann
3b61a07c55 Fix for #1321 - make sure we have attribute on ship 2017-10-28 19:25:15 -04:00
blitzmann
5dc092ace5 bump dev 2017-10-28 19:25:10 -04:00
burnsypet
7b32fe08ac Stop applying neut resistance twice
Energy neut/nos resistance was being applied twice when a nos or
neut is projected onto a fit. I have removed the redundant resistance
application in energyneutralizerfalloff.py and also in
energynosferatufalloff.py as they are already being applied once in
eos.saveddata.fit.addDrain.
2017-10-26 17:53:16 +01:00
Ryan Holmes
fd6e318ae3 Release/v1.33.0 (#1319)
* update database file to SISI 1202899

* Effect and group renaming

* Add civilian modules (#1308)

* Add new effects

* update effect headers

* update database to tq - lifeblood (1203953)

* Update renders

* Update icons

* bump version

* fix tox errors

* change up tox config to ignore E722

* more tox ignores

* Try disabling tests for now. Rifter stats changed, causing breakage. This is why we need properly mocked data, not crap straight from the database.

* Try this

* more testing

* Fuck it, disable branch protection until I can evaluate the test failures and what needs to be done to get them back on the path
2017-10-25 23:33:05 -04:00
Ryan Holmes
34c692c972 Use unicode string to prevent non-ASCII ship names from causing error (#1317) 2017-10-21 22:04:40 -04:00
Ryan Holmes
b4dfcf53fb Merge pull request #1303 from burnsypet/issue-1289
Change how skillsMap is generated
2017-10-08 21:42:40 -04:00
Ryan Holmes
3c26676b66 Merge branch 'master' into issue-1289 2017-10-08 21:30:53 -04:00
Ryan Holmes
3fb7411b9d Issue/1305 (#1311)
* Bump dev version

* fix issue in itemDiff

* Do not apply Prop Jamming to Grapplers (#1305)
2017-10-08 21:13:38 -04:00
burnsypet
cac8e528a3 Change how skillsMap is generated
Changes to characterSelection.py:
grantMissingSkills now uses _buildSkillsTooltipCondensed to
generate a list of skills to update
_buildSkillsTooltipCondensed now outputs level and ID rather than
just level so that it can be used by grantMissingSkills
Anything else using _buildSkillsTooltipCondensed like exportSkills
and fitChanged have been amended to extract just the level from
the skills map rather than level and ID
2017-09-26 18:22:24 +01:00
Ryan Holmes
dfe3d5c82a Update forum references (#1301) 2017-09-24 18:00:21 -04:00
Ryan Holmes
72062e6213 Release/1.32.0 (#1300)
* update database

* update effect headers

* Bump version
2017-09-24 16:43:51 -04:00
Ryan Holmes
10836acab2 Bug/1275 (#1299)
* Add stacking penalties to the max targeting range bonus of the Info Command Burst : Sensor Optimization

* Move Information Burst: Sensor Optimization: Targeting Range effect to proper position

* Fix tox issue
2017-09-24 13:38:52 -04:00
Ryan Holmes
08ab8fbc5b Make sure efxBmp is created (#1265) (#1298) 2017-09-24 13:29:57 -04:00
Ryan Holmes
da5aaf2f78 Feature/evemarketdata (#1297)
* Add preliminary support for eve market data

* Break out market sources into their own classes and register them onto the price service. Create preference option to select which source user wants. Default to eve central

* fix tox stuff
2017-09-23 19:39:38 -04:00
Ryan Holmes
4484b68a3a Fix for #1260 - need to unbind event handling from frame when closed (#1296) 2017-09-23 19:15:03 -04:00
Ryan Holmes
81fce93186 Merge pull request #1294 from pyfa-org/bug/1263
Bug/1263
2017-09-23 13:18:01 -04:00
Ryan Holmes
d58987e427 Merge branch 'master' into bug/1263 2017-09-23 12:56:29 -04:00
Ryan Holmes
05a5ebff00 Merge pull request #1293 from pyfa-org/bug/1278
Bug/1278
2017-09-23 12:56:13 -04:00
blitzmann
2f28afc7ae Merge branch 'bug/1278' of https://github.com/pyfa-org/Pyfa into bug/1278 2017-09-23 12:49:05 -04:00
blitzmann
0134c3b9a1 Fix formatting 2017-09-23 12:33:51 -04:00
Ryan Holmes
9f433fd072 Merge branch 'master' into bug/1278 2017-09-23 03:11:04 -04:00
blitzmann
7729bd9210 Opps commented wrong thing 2017-09-22 02:35:01 -04:00
blitzmann
ce5803dd9c Disable an odd bit of code from a long time ago that fitting max group fitting restrictions to be bypassed (#1278) 2017-09-22 02:33:46 -04:00
blitzmann
821ede8579 Do the same thing for damage patterns as we did for character for global setting 2017-09-22 02:08:53 -04:00
blitzmann
592f9a2298 Trigger a recalc on fit switching if the characters are not the same and the global character flag is set. 2017-09-22 02:01:27 -04:00
Ryan Holmes
73d9dd60e6 Don't return None as a price, always return a float (#1291) (#1292) 2017-09-21 21:13:05 -04:00
Ryan Holmes
f37f4573bf Add missing effect (#1290) 2017-09-20 00:11:32 -04:00
Ryan Holmes
ee392e07c4 Fixes (#1288)
* Provide correct text formatting index

* Fix remove item context menu in projected pane
2017-09-19 19:20:10 -04:00
Ryan Holmes
59b09a255a Fix override importing (and possibly some other bugs revolving around this?) (#1285) 2017-09-18 23:28:39 -04:00
Ryan Holmes
3e73c2eb34 Fix setting implant set for character implants (#1284) 2017-09-18 20:36:41 -04:00
Ryan Holmes
3625b4395a Merge pull request #1272 from burnsypet/issue-1264
Issue #1264 Don't attempt PopupMenu if getMenu returned False
2017-09-18 20:12:34 -04:00
Ryan Holmes
1444a24e70 Merge branch 'master' into issue-1264 2017-09-18 20:04:09 -04:00
Ryan Holmes
73dfa25ef0 Merge pull request #1282 from burnsypet/issue-1280
Convert booster attribute to value before applying
2017-09-18 19:25:32 -04:00
burnsypet
a01284ff1c Convert booster attribute to value before applying
Changes to boostermissilevelocitypenalty.py:
Get booster attribute value using booster.getModifiedItemAttr()
before attempting to apply it to avoid type error
2017-09-14 21:53:53 +01:00
burnsypet
8cc81cebdd Don't attempt PopupMenu if getMenu returned False
Change to characterEditor.py:
Added logic to prevent a crash when attempting to execute
self.PopupMenu(menu) when menu was False. This would occur in the
situation where there were no saved implant sets.
2017-08-19 18:47:58 +01:00
Ryan Holmes
c33aeb7275 Merge pull request #1270 from pyfa-org/release/v1.31.0
Release/v1.31.0
2017-08-16 20:57:04 -04:00
blitzmann
c0237905b6 Ignore F401 warning (# noqa: E402, F401 isn't being honored ion Travis??) 2017-08-16 20:50:18 -04:00
blitzmann
eda6d738a4 fix some whitespace stuff, update database, effect headers, and release version 2017-08-16 20:39:26 -04:00
blitzmann
eef3b420a9 Merge branch 'burnsypet-issue-1241' into development 2017-08-16 20:36:38 -04:00
burnsypet
caef752a74 Bind contextHandler to children of contentPanel
Changes to statsPane.py:
Added new method applyBinding which loops through all the children
of the contentPanel passed to it and binds contextHandler to each of them

Changes to miningyieldViewFull.py:
Call to new method applyBinding
2017-08-16 22:54:32 +01:00
blitzmann
e13bd7af52 Merge branch 'development' of https://github.com/pyfa-org/Pyfa into development 2017-08-15 21:52:16 -04:00
Ryan Holmes
c263575788 Merge pull request #1262 from burnsypet/issue-1261
Issue #1261 show variations menu for cargo items
2017-08-15 21:51:50 -04:00
Ryan Holmes
5bd80d3d06 Merge pull request #1267 from w9jds/input-fix
Amounts window crashes pyfa if you paste with characters
2017-08-15 21:47:22 -04:00
blitzmann
47cbc71e8a Implement simple skill import/export functionality, and some cleanup top pass tox 2017-08-14 23:28:50 -04:00
blitzmann
fdba8d147f Merge remote-tracking branch 'petosorus/master' into development 2017-08-14 22:22:47 -04:00
Jeremy Shore
4720b611b0 Support Decimals 2017-08-14 15:48:18 -05:00
blitzmann
1f43410780 Merge branch 'qol/file-reorg' into development 2017-08-13 21:20:20 -04:00
blitzmann
ead595e666 Allow burst projector to be projected 2017-08-13 21:19:55 -04:00
Jeremy Shore
89cf40423b Fixed issue crashing pyfa when pasting from calculator with commas 2017-08-13 01:54:59 -05:00
burnsypet
95d6944298 Merge branch 'issue-1261' of https://github.com/burnsypet/Pyfa into issue-1261
Conflicts:
	gui/builtinContextMenus/metaSwap.py
2017-07-30 21:35:59 +01:00
burnsypet
a3c19d1d1c Issue #1261 show variations menu for cargo items
Added logic to condition statement in metaSwap.py to accomodate
cargoItem context. Will replace existing cargo item with selected
item and retain the original stack amount.
2017-07-30 21:34:21 +01:00
burnsypet
88185cb886 Issue #1261 show variations menu for cargo items
Added logic to condition statement in metaSwap.py to accomodate
cargoItem context. Will replace existing cargo item with selected
item and retain the original stack amount.
2017-07-30 21:18:47 +01:00
blitzmann
7962aa7b1b Reorganize file structure of item stats dialog box 2017-07-23 17:55:18 -04:00
Ryan Holmes
220ce23e8f Merge pull request #1254 from pyfa-org/bug-1246
Bug 1246 fix
2017-07-15 21:57:54 -04:00
blitzmann
66752b2cbf Fix cargo bonus for Covert subsytems (#1246) 2017-07-15 21:51:32 -04:00
blitzmann
f59a65f314 bump dev 2017-07-15 21:49:58 -04:00
blitzmann
725034ebc5 Merge remote-tracking branch 'origin/master' into development 2017-07-11 23:00:50 -04:00
Ryan Holmes
0210020658 Merge pull request #1245 from pyfa-org/release/1.30.0
Release/1.30.0
2017-07-11 19:45:44 -04:00
blitzmann
22dc6512c0 Final updates and bump version :D 2017-07-11 19:39:13 -04:00
blitzmann
709b4524e6 Bump version :D 2017-07-11 19:26:02 -04:00
blitzmann
bc462ede3e Fix some back event reference due to sleepiness last night ;_; 2017-07-11 19:23:29 -04:00
blitzmann
277bd14453 See #1234 - temporarily add conditional to ensure we run the skill level checking code only when a character exists to prevent error. This may cause some issues with the alpha characters since that may not get checked anymore. 2017-07-11 19:23:08 -04:00
blitzmann
59fed2c516 Update to TQ 1164320 2017-07-11 19:09:32 -04:00
blitzmann
d19486ce15 cleanup 2017-07-11 02:30:26 -04:00
blitzmann
b55fcfaf04 cleanup 2017-07-11 02:06:09 -04:00
blitzmann
60e5085724 ohgodwhathaveidone.jpg 2017-07-11 01:50:54 -04:00
blitzmann
5adde95807 Remove print statement 2017-07-11 01:42:45 -04:00
blitzmann
3da0b8bc29 Effect header update 2017-07-11 01:31:02 -04:00
blitzmann
0104e8954a Remove the -dev suffix for the user database 2017-07-11 01:17:30 -04:00
blitzmann
78e065feff Apparently, my IDE settings changed from spaces to tabs. Changing this back :3 2017-07-11 01:13:25 -04:00
blitzmann
30fe7930a9 Remove log spam 2017-07-11 01:10:55 -04:00
blitzmann
453054f6c7 Remove command fitting from the command fits context menu upon deletion (#1244) 2017-07-11 01:10:39 -04:00
blitzmann
231f9a91c2 Do not assume number of columns for damagePatterns, see #1238 2017-07-10 22:46:30 -04:00
blitzmann
c553790eaf move the "generating effect" spam - doesn't need to happen every time the handler is called 2017-07-10 01:48:10 -04:00
blitzmann
f2e8506ea7 Merge remote-tracking branch 'origin/singularity' into development 2017-07-10 01:39:32 -04:00
Ryan Holmes
76b22dfe17 Merge pull request #1243 from wendazhou/singularity-fix-loki-effects
Fix loki effects
2017-07-10 01:39:16 -04:00
blitzmann
1202c335d9 Fix implant set clipboard import (#1237) 2017-07-10 00:28:22 -04:00
blitzmann
f70d671f1d Fix implant set copy (#1236) 2017-07-10 00:21:52 -04:00
blitzmann
1305a1f2b6 Do not get variations by "group" unless the item is part of a set of hard-coded categories. #1232 2017-07-10 00:11:54 -04:00
blitzmann
f5108c34db Do not kill the entire XML import if one fitting fails (#1231) 2017-07-09 19:08:46 -04:00
Ebag333
d553c60b65 Fix errors caused by importing a few "skinned" ships. Patch by ebag. See #1231 2017-07-09 19:08:06 -04:00
blitzmann
be84cf1db7 formatting 2017-07-09 18:59:07 -04:00
blitzmann
854d7cb09c Rename "system effects" to "wormhole effects" (#1229) 2017-07-09 18:35:44 -04:00
blitzmann
b70f401a91 Merge branch 'qol/file-reorg' into development 2017-07-09 18:27:18 -04:00
blitzmann
496b28226d Merge branch 'feature/booster-side-effects' into development 2017-07-09 18:26:38 -04:00
blitzmann
fec7c8fd0b Merge branch 'singularity' into development 2017-07-09 18:26:28 -04:00
blitzmann
f8e5e15051 Fixed bug with meta swap context menu for subsystems 2017-07-09 15:08:59 -04:00
blitzmann
78b273455d Fix up some effects 2017-07-09 14:44:57 -04:00
blitzmann
de35692666 Fix a few things with affected by tab (indentation issue, overwriting modifier incorrectly) 2017-07-09 13:18:28 -04:00
blitzmann
49b2e42d8c Fix subsystem count, requires post processing of data from CCP when building the database... this may be fixed by the time it releases, but maybe not, and I don't want to forget about it 2017-07-09 12:17:07 -04:00
blitzmann
307ccd10e8 Implement migration for t3c configurations 2017-07-09 00:34:12 -04:00
blitzmann
1225f2074a update to 1163182 2017-07-08 21:59:28 -04:00
Wenda Zhou
afee4469f0 fix loki effects to apply correctly 2017-07-07 00:26:38 -04:00
blitzmann
e9c691575f Fix RR effect 2017-07-05 23:48:44 -04:00
blitzmann
27236feec3 Add new effects 2017-07-03 22:24:27 -04:00
Ryan Holmes
2e598a7ef7 update sisi database 2017-07-03 14:59:28 -04:00
blitzmann
58a242f753 update effect headers 2017-06-27 21:03:16 -04:00
blitzmann
5c2cf6dd15 Add last bit of t3 effects from sisi data 2017-06-27 21:02:27 -04:00
blitzmann
287f3bc510 Fix some broken effects (due to effect renames) 2017-06-25 02:54:14 -04:00
blitzmann
caaa6bcd0c update config.py to reflect sisi version 2017-06-25 01:33:18 -04:00
blitzmann
b01c961251 change path to database in case these sisi releases screw with data 2017-06-25 01:27:29 -04:00
blitzmann
826c73c903 Merge branch 'strat_cruisers' into singularity 2017-06-25 01:26:55 -04:00
blitzmann
b6a28ae15f Merge branch 'master' into development
Conflicts:
	config.py
2017-06-25 01:23:08 -04:00
blitzmann
ad0d55faed update effect headers 2017-06-25 01:21:37 -04:00
blitzmann
910ae6315d More work on subsystems 2017-06-25 01:19:48 -04:00
blitzmann
25b4d3a45b More work on strat cruiser updates 2017-06-25 00:33:36 -04:00
blitzmann
f355cb3a72 Update effect headers 2017-06-25 00:18:06 -04:00
blitzmann
ff58648f94 start picking at strat cruiser update 2017-06-21 22:19:37 -04:00
Ryan Holmes
ad535ccc78 Merge branch 'qol/additionPanes' into qol/file-reorg 2017-06-12 01:17:22 -04:00
Ryan Holmes
9dee761f6d Move addition pane views into their own directory 2017-06-12 01:17:00 -04:00
Ryan Holmes
f5531b458b Fix up focus for ship browser, allowing space or enter to work to open up new stage 2017-06-12 00:28:06 -04:00
Ryan Holmes
a7c89f7b40 break out market browser to individual class files 2017-06-11 17:54:36 -04:00
Ryan Holmes
048ae0205c Breakout shipBrowser into individual class files 2017-06-11 17:32:43 -04:00
Ryan Holmes
e6a0784466 space to select fit when it's focus'd 2017-06-11 15:43:01 -04:00
blitzmann
53d15425f3 tab / tab+shift to change focus of ship browser items 2017-06-09 01:27:28 -04:00
Ryan Holmes
a79257271e bump to stable 1.29.4 (#1228) 2017-06-08 22:22:30 -04:00
Ryan Holmes
94256876e4 Add tooltip for alpha clones to explain functionality (#1227)
See #1219
2017-06-08 22:13:46 -04:00
Ryan Holmes
d319b74d7a Fix exception when double clicking CREST fit browser hull (#1226) 2017-06-08 21:58:20 -04:00
petosorus
acb7c0878e Basic skill reqs export 2017-06-07 11:17:13 +02:00
blitzmann
47fcbefe8b Finish off user-selectable booster side effects - effects are applied correctly now and each has their own display name. Implements #642 2017-06-05 00:18:36 -04:00
blitzmann
c2cb5d763f Implement selectable booster side effects and persist them to the database, very much based on the fighter ability code. Still need to name them and enable the effects.
This also removes the old boosterActiveSideEffect table definition (migration script to drop table still needs to be written)
2017-06-04 23:33:11 -04:00
Ryan Holmes
208148b670 Fix issue with fit deletion (#1211)
* bump dev

* Fix issue with deleted fit not being removed from database cache (#1207). Also, include some error handling around the our commit stuff
2017-06-02 00:30:58 -04:00
blitzmann
cf02c74272 bump dev 2017-06-01 00:33:46 -04:00
blitzmann
f77cd0b834 Merge branch 'master' into development 2017-06-01 00:32:06 -04:00
Ryan Holmes
461f5219e5 bump release (#1204) 2017-05-31 23:51:46 -04:00
Ryan Holmes
373ead8da6 Add structure painter / web to dps graph (#1203) (#1202) 2017-05-31 23:14:17 -04:00
Ryan Holmes
3371086d54 Fix for #1193 - compounded bonuses during recursive command / projected fittings (#1197)
* Teak calculated logic

* test

* clear() on every calculation if it's not already calculated

* tox fix
2017-05-31 00:01:59 -04:00
Ryan Holmes
45c3533501 Make some extra logging statements and stuff to troubleshoot fit deletion bugs (#1199) 2017-05-30 22:57:52 -04:00
Ryan Holmes
4286f2ea5a Add stacking penalties to armor and shield resist command links (#1198) 2017-05-30 22:44:01 -04:00
Ryan Holmes
344546a583 Merge pull request #1196 from jasconius/mactest
updated drag and drop behavior to not trigger a suspected wx bug on Mac
2017-05-30 22:26:59 -04:00
Michael Ryan
46f61ecfa3 address travis errors 2017-05-30 21:07:02 -05:00
Ryan Holmes
2ec9c5addb Merge pull request #1194 from petosorus/pricing-pane-1158
Pricing pane 1158
2017-05-30 21:42:05 -04:00
Michael Ryan
d09f21fe15 updated drag and drop behavior to not trigger a suspected wx bug on Mac 2017-05-30 20:18:32 -05:00
petosorus
33410f0618 Formatting 2017-05-30 15:51:48 +02:00
petosorus
2c98baade8 Price options labels + total computing in minimal 2017-05-29 15:24:21 +02:00
petosorus
380f90d065 Price options in context menu 2017-05-24 17:30:55 +02:00
petosorus
1781c6dcf0 total computation + settings 2017-05-24 16:27:32 +02:00
Ryan Holmes
cff3d0ee95 Don't process removeModule is ctrl / cmd key is active (#1190) 2017-05-22 01:50:13 -04:00
Ryan Holmes
d1fc2dd6ec Fix issue with calculateSustainableTank not considering remote ancil modules (from https://forums.eveonline.com/default.aspx?g=posts&m=6948134#post6948134) (#1189) 2017-05-22 00:55:35 -04:00
Ryan Holmes
218712835e Merge pull request #1188 from pyfa-org/bug/evemon-char
EVEMon import fix
2017-05-22 00:41:12 -04:00
Ebag333
5a60cff9a1 Fixes EVEMon import. Security status was added, but wasn't handled in the EVEMon import. Also, default secstatus to 0 if it's somehow missing. 2017-05-22 00:29:29 -04:00
Ryan Holmes
18554e3186 Fix a bunch of item swapping mechanisms (see #1186) (#1187) 2017-05-21 20:31:12 -04:00
Ryan Holmes
2e2303c9aa Update some migrations to consider new schema (#1185)
* Update some migrations to consider new schema

* tox
2017-05-20 02:44:26 -04:00
blitzmann
fbf455c9fe Fix for fighter prices (#1178) 2017-05-18 22:28:09 -04:00
blitzmann
00dcda6fad Check if projected / command thing actually exist before attempting to remove it 2017-05-18 22:22:02 -04:00
blitzmann
3be7538daa Bump dev 2017-05-18 22:22:02 -04:00
Ryan Holmes
9e0638c54c Merge pull request #1175 from pyfa-org/bumprelease
Bumprelease
2017-05-16 22:12:29 -04:00
blitzmann
a5ff46fbd1 Bump stable 2017-05-16 21:34:09 -04:00
Ebag333
6900938208 Set all strings to be unicode when referencing fit.name. This won't catch all conversion errors, but it should catch most. 2017-05-16 21:33:45 -04:00
blitzmann
4887817142 Revert "Set all strings to be unicode when referencing fit.name. This won't catch all conversion errors, but it should catch most. (#1168)"
This reverts commit da33a372cb. Was squashed by mistake, commit author was lost
2017-05-16 21:33:28 -04:00
Ryan Holmes
0d721b55a7 Fix for when factor reload when module doesn't have a cycle time (#1171) (#1173) 2017-05-16 00:09:51 -04:00
Ryan Holmes
65f71b6f6b Fix exception with character implants, and don't show implant set menu if there aren't any (#1172) 2017-05-15 22:59:47 -04:00
Ryan Holmes
89b508d0f6 Merge pull request #1170 from pyfa-org/bug/char_fixes
Various character fixes
2017-05-14 23:05:18 -04:00
Ryan Holmes
6344f7a975 Merge branch 'master' into bug/char_fixes 2017-05-14 22:56:34 -04:00
blitzmann
11eea37aa7 Remove duplication of Character.ro property 2017-05-14 22:50:18 -04:00
blitzmann
bff44c46f8 Fix character list sorting (https://forums.eveonline.com/default.aspx?g=posts&m=6940327#post6940327) 2017-05-14 22:44:02 -04:00
blitzmann
7a0ea759ef Fix issue with character copy, as well as instantiating character with duplicate skills (since Skill has a backref to charactrer, it's automatically added to the characters skill list. No more need for the append()) 2017-05-14 22:24:05 -04:00
blitzmann
f9419977c0 Instantiate skills with a character (may help to solve https://forums.eveonline.com/default.aspx?g=posts&m=6939299#post6939299) 2017-05-14 20:55:48 -04:00
Ryan Holmes
da33a372cb Set all strings to be unicode when referencing fit.name. This won't catch all conversion errors, but it should catch most. (#1168) 2017-05-14 20:52:06 -04:00
blitzmann
0db141d0a6 Fix exception when reverting character skills 2017-05-14 02:26:32 -04:00
blitzmann
79445225de fix issue with market shortcuts if not active items are present 2017-05-14 02:21:23 -04:00
Ryan Holmes
a0f5e4cbb3 Merge pull request #1166 from pyfa-org/bug/t3d-mod-delete
Bug/t3d mod delete
2017-05-14 01:59:38 -04:00
blitzmann
3b23c9eacd flake8 2017-05-14 01:41:15 -04:00
blitzmann
d4ce1ef3db Fix issue with Delete key event on t3d mode causing exception (#1160). Additionally, work around the fact that every module that is removed also recalculates the fit, allowing for a faster response time when deleting multiple modules at a time. This is somewhat ugly as the removeModule function was originally based on the assumption of removing only one module. Should clean it up at some point. 2017-05-14 01:37:49 -04:00
Ryan Holmes
b4f063b07a Merge pull request #1165 from pyfa-org/bug/fit-delete-stuff2
Bug/fit delete stuff2
2017-05-14 00:42:26 -04:00
blitzmann
ffe840e245 Fix for #1161. Can't reproduce, but I'm unsure what the root cause is (probably something firing in the wrong order). 9be4ae may also alleviate the root cause. 2017-05-13 23:28:51 -04:00
blitzmann
2e3c3e92f1 Fix for a possible bug (see comments in #1147). 2017-05-13 23:28:50 -04:00
blitzmann
5e20d6973f Fix situation in which deleting a fit that was both a command and projected fit for the same target threw an error 2017-05-13 23:28:49 -04:00
blitzmann
c68739d78c Move the FitRemoved event before the stage selected events. Otherwise, if the stage is selected first and the FitItem (self) is deleted before the FitRemoved is done, we get an error about how self is not valid anymore 2017-05-13 23:28:49 -04:00
blitzmann
5392aaa27e refresh command fits on boosted fits when the booster is deleted 2017-05-13 23:28:48 -04:00
Ryan Holmes
fee82d294b Bump dev and include fix for #1162 (#1163)
* Add some logging to try to figure out what happens with #1149

* Add some logging to try to figure out what happens with #1149, along with some other fixes

* bump dev

* Add remote hull repairers in the calculateSustainableTank() mappings
2017-05-13 22:36:03 -04:00
Ryan Holmes
9f5e14fe2d Bugfixes and bump point release (#1159)
* Add some logging to try to figure out what happens with #1149, along with some other fixes

* Bump point release
2017-05-11 20:53:37 -04:00
Ryan Holmes
b39ec4f9b3 Do not commit price objects to database from within thread (#1154)
* Remove database commit in price worker, essentially bringing it back to the previous functionality (pass thread list of price objects, it modifies, calls back for main thread to commit). There's probably a better way to handle this for the future creating a scoped session or something, but for now this works

* E303 too many blank lines (2)
2017-05-11 01:15:07 -04:00
Ryan Holmes
25bfb4ddb8 Fox for issue #1152 - unicode characters in entity names (#1153) 2017-05-10 22:36:10 -04:00
Ryan Holmes
de9b167242 Bump version and include fix for #1147 (#1150)
* bump dev

* Fix two issues with deleting fits (#1147)
2017-05-10 18:48:33 -04:00
Ryan Holmes
18d44979e4 Merge pull request #1143 from pyfa-org/release-1.29.0
Release 1.29.0
2017-05-09 21:05:42 -04:00
blitzmann
1eddad859a Bump for 1.29.0 release for realz
This reverts commit fc9408d062.
2017-05-09 20:59:35 -04:00
blitzmann
e2de1565bf Forgot to add notes to the import fit list. Caused break. Very bad. 2017-05-09 20:59:11 -04:00
blitzmann
fc9408d062 Revert "bump for 1.29.0 release"
This reverts commit 892ee13542.
2017-05-09 20:56:09 -04:00
Ryan Holmes
cb98618e5e Merge pull request #1142 from pyfa-org/release-1.29.0
Release 1.29.0
2017-05-09 20:54:41 -04:00
blitzmann
892ee13542 bump for 1.29.0 release 2017-05-09 20:49:05 -04:00
blitzmann
2595c59c73 Fix issue in which character editor did not display skill level update when changed from skill search results 2017-05-09 19:57:59 -04:00
blitzmann
93c26aa02f Merge branch 'jeffy-g-fix_unread_description' into release-1.29.0 2017-05-09 18:58:15 -04:00
blitzmann
a6a153b703 Update database, add missing renders, fix bug with not being able to add citadel modules, and fix bug associated with engineering complex properties (debug info, don't care about it) 2017-05-09 18:52:32 -04:00
blitzmann
38e6e7d5ed Add missing Dagon effect 2017-05-08 22:58:25 -04:00
blitzmann
4d8c9e0522 Fix floats in skill tree, and fix typo - apparently I can't spell dependents x_x 2017-05-08 22:49:37 -04:00
blitzmann
e75e2b7605 Bad isinstance() for skill search... I feel like I've fixed this 3 times now??? 2017-05-08 22:40:12 -04:00
blitzmann
0e81c985a3 Fix bad index for fit notes which causes exception on recent fits 2017-05-08 22:38:18 -04:00
blitzmann
21a071ea40 Add "remove" context menu to command fits 2017-05-08 22:34:03 -04:00
blitzmann
4f1e7697ed Fix issue in which "Open Fit" was showing on the command view, not the command fit, potentially causing an error 2017-05-08 22:29:50 -04:00
blitzmann
ccfd414cb3 Disable stopwatch in test (was failing due to import error) and fix bad requests version setting 2017-05-08 22:25:05 -04:00
blitzmann
3de63c5ca5 flake8 fixes 2017-05-08 21:32:13 -04:00
blitzmann
42e64a6223 Fix jsonToSql script and issue with character sec status setter 2017-05-08 21:24:29 -04:00
blitzmann
53f589284b Implement hard constraints for All 5/0 characters with respect to skills and sec status 2017-05-08 19:47:55 -04:00
blitzmann
aecbf8f86e Fix issue with drones causing exception during remote RR calcs 2017-05-08 19:41:34 -04:00
blitzmann
dd09b3d951 Add fitting notes to the ship browser tooltips 2017-05-08 19:20:30 -04:00
blitzmann
f022c2474c Restrict fit notes export to 400 character for CREST and XML export 2017-05-08 19:02:30 -04:00
blitzmann
249956689a text tweaks 2017-05-08 18:26:44 -04:00
blitzmann
6b22bd189a Merge remote-tracking branch 'jeffy/fix_unread_description' into dev, see #1099
Conflicts:
	eos/config.py
	gui/notesView.py
	service/settings.py
2017-05-08 00:44:29 -04:00
blitzmann
524bb43113 Merge branch 'fix_unread_description' of git://github.com/jeffy-g/Pyfa-dev into jeffy-g-fix_unread_description 2017-05-08 00:09:09 -04:00
blitzmann
83a7a854bb Merge branch 'feature/recent' into dev
Conflicts:
	eos/db/saveddata/character.py
	eos/db/saveddata/fit.py

Implements #983 but utilizing sqlalchemy events to update the fit modified date whenever something is added/changed.
2017-05-07 20:48:41 -04:00
blitzmann
0507a55731 Get resists working with more things, and fix bug in which we were still looking at an effect info (which doesn't exist anymore) 2017-05-07 19:59:25 -04:00
blitzmann
f1eb3f68d1 Change func.now() to datetime.datetime.now().
Apparently these are calculated differently (sqlite function is in utc, datetime is in local), and I couldn't figure out how to retrieve the tiome back into local. Since this is a single user application without a concern for time drift on the server, this should work just as well.
2017-05-07 11:35:26 -04:00
blitzmann
1604ea1f2c Fix many bugs related to GUI not receiving a correct timestamp, as well as extending feature out to all other fit entities. 2017-05-07 02:02:54 -04:00
blitzmann
4a9662c0f7 Merge branch 'feature/skill-filter' into dev
Conflicts:
	gui/characterEditor.py

This implements a long-requested feature to be able to search skills in the character editor
2017-05-06 13:25:20 -04:00
blitzmann
47a683c44c Merge branch 'feature/strictSkills' into dev
Conflicts:
	service/character.py

Implements strict skill requirement handling
2017-05-06 13:13:50 -04:00
blitzmann
d888982657 Merge branch 'bug/market-fit-none' into dev 2017-05-06 13:11:26 -04:00
blitzmann
184c46dbce Merge branch 'bug/unicode-skill-export' into dev 2017-05-06 13:11:07 -04:00
blitzmann
b2ae6913d7 Merge branch 'qol/self-projection' into dev 2017-05-06 13:10:48 -04:00
blitzmann
703d6dbc85 Merge branch 'feature/grant-needed-skills' into dev 2017-05-06 13:09:30 -04:00
blitzmann
2e6066e848 Merge branch 'feature/tabbed-fits' into dev 2017-05-06 13:08:52 -04:00
blitzmann
f751eff1cf Fix some styling issues on linux 2017-05-06 12:57:20 -04:00
blitzmann
d342e66db4 Merge branch 'feature/sec-status-change' into dev
Add ability to change characters sec status
2017-05-06 12:23:40 -04:00
blitzmann
1222567a4f Merge branch 'feature/allow-restrictions' into dev.
Allows user to turn off most fitting restrictions (#1117)
2017-05-06 12:11:00 -04:00
blitzmann
1f7858f853 Merge branch 'bug/resist-effects' (also includes current work on sisi branch).
This fixes the ewar resists (and possibly implements remote repair impedance, not tested)
2017-05-06 12:04:10 -04:00
blitzmann
283cb1e50c Add hard requirement for requests (for everything except mac-deprecated) 2017-05-04 21:48:30 -04:00
blitzmann
c2880c0175 Move queue and wait variables to __init__.
Turns out threading.start() returns before the thread actually starts, so there were situations in which we would start the thread and immediately try to use it before run() happened.
2017-05-04 19:27:54 -04:00
blitzmann
3d0a4b84d4 Add hard minimum requirement for logbook 0.10.0, remove requirements.txt loop as it isn't applicable for 95% of users, and Linux users are complaining about seeing console output all the time on dev 2017-05-03 20:53:10 -04:00
blitzmann
622efb624d Refactor how remote resistance works. We now check the resistance ID directly from the effect, and fall back to the remoteResistanceID attribute. See #1139 2017-05-02 22:19:58 -04:00
blitzmann
50965244c0 Merge branch 'bug/1139' into bug/resist-effects 2017-05-02 20:41:54 -04:00
blitzmann
9e6aca2496 Merge branch 'qol/effect-class' into bug/resist-effects 2017-05-02 20:38:20 -04:00
blitzmann
1cf844d415 item.attributes would not contain attributes that were added during runtime. Instead, get the attribute info and search the modified attributes for the resist attribtue. 2017-04-30 01:39:03 -04:00
blitzmann
f57e7cf1ec Implement FloatSpin as well as changing sec status via character editor 2017-04-26 22:14:30 -04:00
Ryan Holmes
bedd6efff2 Fix for #1137 - industrial command skill was applying to incorrect attribute (#1138) 2017-04-26 20:25:35 -04:00
blitzmann
9bffc6afd6 Fix issue in which exception happened because of a bad type check 2017-04-26 19:59:57 -04:00
blitzmann
77b5e8afdc Merge branch 'development' into feature/strictSkills
Conflicts:
	eos/gamedata.py
2017-04-26 19:42:29 -04:00
blitzmann
f9b7376cc7 Move sql alchemy events into their own file for now so that mac-deprecated doesn't get pissy. 2017-04-26 19:34:47 -04:00
blitzmann
34723d7bb1 Merge branch 'development' into feature/recent 2017-04-26 18:51:46 -04:00
blitzmann
32f417ce5a Created first iteration of "Recent Fits" view, in which a nav button is interacted with to show a list of the 100 most recently modified fits. Ship Broswer is littered with ToggleRecentShips() to reset the icon when not in "recent" mode. This should probably be fixed at some point.
Removed the FIT_CHANGED binding from FitItem - this was causing very odd issues when the object was destroyed (navigating to another "stage") such as the Fit Changed event for that fit no longer firing (or at least seemingly so)

To fix this, simply look at the active fit during FitItem.Refresh()

Also creates a new query to get a list of items from the DB, although it's not used (was gonna use it, decided against it, but didn't want to delete the code - could prove handy later)
2017-04-26 18:51:39 -04:00
blitzmann
5657438e3c Change up effect classes for better efficiency 2017-04-24 19:04:07 -04:00
blitzmann
f7349316b4 Revert "Change to using inspect() instead of the current shitty way"
This reverts commit 711537dcf4.

Turns out inspect() was introduced in 0.8, and mac-deprecated has 0.6.4 (without an easy way to jack it up). Stuck with this ugly, but functional code for now.
2017-04-24 00:34:04 -04:00
blitzmann
c0f74cd0a3 Fix old issue with trying to open previous fits that don't exist. 2017-04-23 23:40:51 -04:00
blitzmann
bb73065b43 Update FitItem datetime when fit changes 2017-04-22 22:46:23 -04:00
blitzmann
ae99a179d9 Update FitItem to use modified datetime of fit (fallback to created and old timestamp). Remove activation of FitItem timer (no idea what this is trying to do???) 2017-04-22 19:30:50 -04:00
blitzmann
b4930d15b7 Update Fit.modified whenever modules change, allowing proper "recent" timestamps 2017-04-22 18:58:30 -04:00
blitzmann
86e6250a63 Add strict skills to preference pane 2017-04-22 14:49:13 -04:00
blitzmann
c9a04e886a Add eos setting for strict skills, and update info in skill tree without doing a repopulation 2017-04-22 14:02:40 -04:00
blitzmann
b21c850598 move skill mapping to item class 2017-04-22 03:12:33 -04:00
blitzmann
58abdcfa22 Add dependants tab for skills 2017-04-22 03:09:18 -04:00
blitzmann
d0a4fa1c9d Get strict skills working. Todo: add engine setting 2017-04-22 02:43:06 -04:00
blitzmann
e94b4a1c18 Fix old issue with trying to open previous fits that don't exist. 2017-04-21 23:43:40 -04:00
blitzmann
2a679efc14 Remove print message for except clause when iterating through item properties. This is dev stuff, not too worried about handling it. Was failing on getting a property that doesn't make sense for a module. 2017-04-21 23:38:46 -04:00
Ebag333
4652b91e98 Always show refresh button on compare window (annoying that it hides sometimes when it shouldn't). Move compare window prices to the new price model. 2017-04-21 00:55:06 -04:00
Ebag333
0079f76f67 Change price column to use new method 2017-04-21 00:54:13 -04:00
blitzmann
711537dcf4 Change to using inspect() instead of the current shitty way 2017-04-21 00:45:36 -04:00
blitzmann
e971b7927e Fix issue in which prices are removed all the time (forgot to add the check for deleted to the condition >.<) 2017-04-21 00:40:45 -04:00
Ryan Holmes
3afa829173 Merge pull request #1136 from blitzmann/bug/rr-fuel-1135
Remote Ancil Bug
2017-04-21 00:02:11 -04:00
blitzmann
cd30d74393 Rename fueled to modifier 2017-04-20 23:54:52 -04:00
Ebag333
25a945f9e6 Catch bug where remote reppers have the fueled multiplier applied when they have no charges. 2017-04-20 23:54:36 -04:00
Ryan Holmes
504d582b59 Merge pull request #1134 from blitzmann/bug/drones
Drone bugs
2017-04-19 21:43:39 -04:00
blitzmann
3d8a80aeaa Include drones in RR stats 2017-04-19 21:36:49 -04:00
blitzmann
9ac609528b Fix issue in which drones hp/s does not consider number of drones 2017-04-19 21:04:48 -04:00
blitzmann
988861af1f Add option to ignore fitting restrictions on a per-fit basis 2017-04-18 23:57:34 -04:00
blitzmann
66a8669c64 Implement CONCORD ship sec status bonus. 2017-04-18 01:21:08 -04:00
blitzmann
99b0322289 Merge branch 'singularity' into sisi-dev 2017-04-18 00:03:58 -04:00
blitzmann
b0e7c02a6a Add migration script for character sec status 2017-04-18 00:01:25 -04:00
blitzmann
f0fc5643e9 Return and save sec status for character when updating skills 2017-04-18 00:01:25 -04:00
blitzmann
8c83ac120f Implement asynchronous api skill fetching 2017-04-18 00:01:24 -04:00
blitzmann
53cab4b1ab Merge branch 'master' into development
Conflicts:
	requirements.txt
2017-04-17 21:41:44 -04:00
blitzmann
6d176c0010 Merge branch 'master' into singularity 2017-04-17 21:41:02 -04:00
blitzmann
1aaa93c1fd Set sqlalchemy version to 1.0.5 in requirements... newer version causing issues in builds? 2017-04-17 21:35:22 -04:00
blitzmann
9d1c77f5b7 Damn you effects... 2017-04-17 21:19:51 -04:00
Ryan Holmes
3b351603a3 Merge pull request #1130 from blitzmann/feature/drone-affecting-skills
Add affecting skills context menu to drones and fighters
2017-04-17 19:52:19 -04:00
Ryan Holmes
f563b2666d Merge pull request #1129 from blitzmann/bug/fighters-1128
Fix for #1128
2017-04-17 19:46:51 -04:00
blitzmann
cede46d4a4 Remove PyYAML from list of requirements to run pyfa. 2017-04-17 19:40:47 -04:00
blitzmann
90d854fd24 Add change affecting skills menu to drones and fighters 2017-04-17 19:25:35 -04:00
blitzmann
9c406a0a44 Fix for #1128 - these modifiers are in their own pen-group 2017-04-16 23:53:19 -04:00
blitzmann
81160e9e72 Fix effects (don't need level for ship bonuses x_x) 2017-04-16 22:50:19 -04:00
blitzmann
7bfd19dca4 Update effect headers 2017-04-16 22:24:32 -04:00
blitzmann
8ff244d509 Add new effects to support new hulls 2017-04-16 22:11:28 -04:00
blitzmann
e2061a25c2 Update effects for logi 2017-04-16 21:06:28 -04:00
blitzmann
272201c0fc Update for renamed attribute 2017-04-16 20:34:58 -04:00
blitzmann
54930d7d50 Rename effects. 2017-04-16 20:20:57 -04:00
blitzmann
5ddac97719 Update EVE db from sisi 2017-04-16 19:04:51 -04:00
blitzmann
973432b997 Merge remote-tracking branch 'origin/master' into singularity 2017-04-16 19:02:17 -04:00
blitzmann
1ee679903c Bring dev up to date with master
Conflicts:
	service/fit.py
2017-04-16 11:42:41 -04:00
Ryan Holmes
89614f7948 Merge pull request #1127 from blitzmann/master
Appveyor tweaks
2017-04-16 11:39:16 -04:00
blitzmann
dec5970bd6 Update appveyor to use cx_freeze until pyInstaller is reviewed. 2017-04-16 11:31:08 -04:00
Ebag333
a374fb4a12 Appveyor (#1101)
Appveyor setup
2017-04-16 11:31:01 -04:00
blitzmann
5d066f1401 Merge branch 'development' of https://github.com/pyfa-org/Pyfa into development 2017-04-16 11:12:42 -04:00
blitzmann
e8749d379a Update appveyor to use cx_freeze until pyInstaller is reviewed. 2017-04-16 11:12:15 -04:00
blitzmann
b02506d6cd fixes issue in which fit was recalced on fit switch when characters were different, regardless of calculation state. 2017-04-15 22:33:45 -04:00
blitzmann
cca61b8ac1 Fix issue with selecting item with an empty view 2017-04-14 21:45:41 -04:00
Ryan Holmes
962c45b807 Merge pull request #1124 from StinGer-ShoGuN/PR_01
Default HTML export to pyfa save path, and allow override of database file path
2017-04-14 00:31:59 -04:00
blitzmann
9646cee324 De-jankify self projections. We now check to see if the fit we're about to project is self and, if so, simply run the projections on ourselves. At this point, all bonuses should be applied to our fit. 2017-04-13 23:41:02 -04:00
blitzmann
04242ef52c Fix issue with handling item names that include unicode 2017-04-13 23:39:42 -04:00
blitzmann
da9816d1bd Implement character skill searching 2017-04-13 23:39:00 -04:00
blitzmann
283aba4f85 Add grant missing skills feature 2017-04-13 23:26:08 -04:00
blitzmann
080590a292 Add "Currently Open Fits" context menu for projected and command views 2017-04-13 23:23:48 -04:00
blitzmann
a7ec10525e Apparently this happens on command fits as well... temp fix until I can look into why this happens 2017-04-13 23:23:47 -04:00
blitzmann
e28bf545e9 Fix some bugs with notes view - exception happening due to lack of fit, and possibility of notes saving under the wrong fit 2017-04-12 23:22:57 -04:00
Ryan Holmes
5aeb3a38c8 Fit Calculation Code Cleanup (#1103)
* Remove dirtyStorage, legacy of old fleet boosting system

* Remove withBooster flag from the recalc() function.

This was a legacy parameter dealing with the old fleet boost code, the purpose of which has changed with the addition of command boosts. We no longer have to call recalc with this particular parameter (indeed, it was forced to False in `recalc`). These were never cleaned up. We still have the withBoosters parameter for the `calculateModifiedAttributes` function, however that will be renamed and has a different meaning than it used to (used in the recursion of command fits)

* Add some comments

* Consolidate the tangled mess of conditional flags meant to determine if a fit is local/projected/command. This should make the logic flow a bit clearer.

Also rewrite a blurb about returning on a calculated fit - need to look into this a little bit more.

* fix up test to no longer pass `withBooster`
2017-04-12 19:50:16 -04:00
StinGer ShoGun
c00372900f Save HTML export to .pyfa user's directory by default.
This commit is part of attempts to ease system package creation and
maintenance (specifically Gentoo ebuilds).
2017-04-12 16:13:56 +02:00
StinGer ShoGun
7f50503aec Allow game database file to be loaded from a different directory.
This will allow system-wide installation of Pyfa in Python site-packages
directory, where eve.db has nothing to do.

This commit is part of attempts to ease system package creation and
maintenance (specifically Gentoo ebuilds).
2017-04-12 16:07:21 +02:00
blitzmann
87a600349c Temporarily fix issue with removing a self projected fit 2017-04-11 23:58:05 -04:00
Ryan Holmes
114246bf1e Do not recalc fits on tab switch (#1105)
* Do not recalc fits if they are already calculated. Fits that are projected onto other fits recursively set their victims to `calculated=False` so that the victim will re calculate when it loads again.

* Reset boosted fits when calculating a fit that is boosting others. Also, remove semicolon due to habit :x

* Develop a `__resetDependantCalc()` which will reset any fits that are immediately affected by the current fits calculation.
2017-04-11 23:40:40 -04:00
Ryan Holmes
ebda1349cf Add a small delay on key down for market search (#1123)
* Add a small delay on key down for market search

* prevent a double search if user does something like hit enter in the middle of a timer
2017-04-11 23:30:38 -04:00
Ryan Holmes
45a8aaf387 Merge pull request #1111 from Ebag333/fit_tests
Tests for eos\saveddata\fit.
2017-04-11 00:42:54 -04:00
Ryan Holmes
514933e0e4 Merge pull request #1120 from blitzmann/feature/delete-things
"Delete all" buttons for Prices, Target Resists, Damage Profiles
2017-04-10 22:03:20 -04:00
blitzmann
6f914386ec Remove unused function 2017-04-10 21:58:56 -04:00
blitzmann
efaede0929 Use queries to bulk-delete target resists and damage profiles 2017-04-10 21:49:35 -04:00
Ebag333
73821cbe49 Formatting 2017-04-10 21:41:56 -04:00
Ebag333
e245891cb4 Add delete buttons 2017-04-10 21:40:59 -04:00
blitzmann
50e604f412 convert print to debug statement >.< 2017-04-10 21:32:26 -04:00
blitzmann
4e74555b5d Opps, forgot to change this back from testing. 2017-04-10 21:26:03 -04:00
blitzmann
894c86ebc3 Merge branch 'development' of https://github.com/pyfa-org/Pyfa into development 2017-04-10 21:09:40 -04:00
Ryan Holmes
47ea12f4ba Merge pull request #1048 from Ebag333/ErrorDialog_and_miscfixes
Error Dialog improvements and Pyfa.py refactoring
2017-04-10 21:09:11 -04:00
blitzmann
ce01c66b3e Better manage price object juggling in Item.price property. The previous way was creating new price objects when an object already existed in the database which could lead to Integrity issues. 2017-04-10 20:48:58 -04:00
blitzmann
1260900668 Merge branch 'pricing_v2' into development 2017-04-10 20:46:57 -04:00
jeffy-g
a86ff19c98 Merge branch 'fix_unread_description' of https://github.com/jeffy-g/Pyfa-dev into fix_unread_description 2017-04-10 14:31:29 +09:00
jeffy-g
c07bcf6a29 Determine the necessary changes to use db with test code,
I made necessary edits

.travis.yml
  necessary to depend on wx mod indirectly when running test code

eos\config.py
  copy from development branch, This change was necessary when using data base in test code.

service\settings.py
  copy from development branch.
  and modified SettingsProvider.getSettings and Settings.save.
  After that, we made the same as master branch except for necessary code.
  This change was necessary when using data base in test code.

and other improvement.
2017-04-10 14:23:50 +09:00
Ryan Holmes
82f6d26a88 Merge pull request #1109 from Ebag333/eos_fit_cleanup
Some quick cleanup of logging and shtuff
2017-04-09 23:25:11 -04:00
Ebag333
d1e8f5cf5c Placeholder test (#1113)
* Placeholder test

* pep8
2017-04-09 22:44:28 -04:00
Ryan Holmes
82edaf05d3 Merge pull request #1116 from pyfa-org/eos_cleanup
Eos cleanup
2017-04-09 22:43:29 -04:00
blitzmann
fadc514592 Add back the booster side effect stuff 2017-04-09 22:38:31 -04:00
jeffy-g
fc7ca56f8b searching for a way to open db with minimal changes required 2017-04-10 09:33:54 +09:00
jeffy-g
d629061506 Merge branch 'master' into fix_unread_description 2017-04-10 03:20:35 +09:00
jeffy-g
4a964ab6be apply recent improvements 2017-04-10 03:05:44 +09:00
jeffy-g
53957c24df Reflect changes when writing test code 2017-04-08 22:31:25 +09:00
Ryan Holmes
addff1118c Extend "Open Fit In Context Menu" option for command fits. (#1104) 2017-04-05 19:26:12 -04:00
Ebag333
6a1d106fea Appveyor (#1101)
Appveyor setup
2017-04-05 16:18:03 -07:00
Ryan Holmes
07f88cc4d1 Add Create and Modify fields for most database tables (#1073)
* Add created/modified fields to relevant tables.

* Add migration for created and modified fields

* Seriously tox?
2017-04-05 18:54:57 -04:00
Ryan Holmes
5f35553438 Restrict cap modules to only cap ships (#1097)
* Restrict capital modules to capital hulls

* tweak comment

* Make a isCapitalSize property for modules
2017-04-05 18:54:16 -04:00
Ebag333
802e2afcc0 General cleanup of Eos. Reformats a bunch of files and cleans up unused code or code that's been commented out 2017-04-05 15:47:19 -07:00
Ebag333
ee09b41e08 Use rlock instead of lock 2017-04-05 14:56:22 -07:00
Ebag333
994bd72409 Rework pricing. 2017-04-05 14:40:27 -07:00
Ebag333
01eaba6697 First pass 2017-04-05 11:44:36 -07:00
jeffy-g
d4d69522f5 edit source 2017-04-06 03:37:40 +09:00
jeffy-g
dd88d64d67 im trying PyCharm now! 2017-04-05 21:48:37 +09:00
jeffy-g
0ecaa4d36c edit missied format... 2017-04-05 21:26:45 +09:00
jeffy-g
e9e8ef964c refactoring some code and added docstring
added stopwatch.py(modify from utils.timer.py) for test
2017-04-05 21:18:30 +09:00
Ebag333
c2360528ee Don't flush to DB 2017-04-05 01:09:00 -07:00
Ebag333
3221fba02c Copy/pasta error 2017-04-05 00:52:35 -07:00
Ebag333
c1b74f481a Tox 2017-04-05 00:44:02 -07:00
Ebag333
e2c0dc7e92 Tests for eos\saveddata\fit. 2017-04-05 00:42:19 -07:00
Ebag333
df510c40f4 Some quick cleanup of logging and shtuff 2017-04-05 00:17:13 -07:00
Ebag333
48db3c8ce4 Add some key logging for database information. 2017-04-04 15:01:05 -07:00
Ryan Holmes
9d029b46b1 Respect command fit state (#1100)
* Respect command fit state in calculations

* Utilize `getCommandInfo` instead (we do it this way for projections. Consistency, fuck yeah!)
2017-04-02 23:20:31 -05:00
Ebag333
d2af4f7d9c Locale Tests (#1079)
* Locale tests redo

* Add helper

* Remove line break if found.

* Fix imports

* Remove copy that snuck in

* Install language packs

* Change language pack install

* fix china language pack

* Fix tests that I accidentially broke

* Add debug print

* Don't try and parse Travis cache dirs

* Fix counting
2017-04-02 15:53:14 -07:00
Ryan Holmes
3dd539b4f0 Improve some efficiencies with the variations context menu: Do not recalc twice when switching items. (#1095) 2017-04-02 16:46:25 -05:00
Ebag333
1daafd15e6 Tests (#1086)
* First step in more tests

(cherry picked from commit b9af117)

* Formatting

(cherry picked from commit 5f037e6)

* Booster test fixes

* Switch to wx3.0

* try coda
* Test output

* Tweak travis

* try reduced virtualenv

* Tweak travis

* Reduce test to a single one.

* Formatting
2017-04-02 10:26:11 -07:00
jeffy-g
8fd424814a edit... 2017-04-03 02:00:10 +09:00
jeffy-g
4d8c3eadbc pep8 2017-04-03 01:50:26 +09:00
Ryan Holmes
92722d491f Remove functionality related to auto HTML export (#1088) 2017-04-02 11:46:17 -05:00
jeffy-g
c560d17bdd Improved processing status notification for import and export 2017-04-03 01:34:07 +09:00
Ebag333
55dff65142 Tox things 2017-04-02 01:03:14 -07:00
Ebag333
cdec6fad99 Clean up requirements file. Add detection and warning for possibly missing requirement. Change back to using the modal. 2017-04-02 00:57:11 -07:00
Ryan Holmes
216dac068d Fix for #1090 - using variations on implants is not recalcing fit correctly. (#1094) 2017-04-02 01:04:34 -05:00
Ryan Holmes
f9ec79c8eb Merge pull request #1093 from pyfa-org/master
Bring dev up to date with master
2017-04-01 23:14:26 -05:00
Ryan Holmes
112ab91e34 Fix for #1091 (#1092) 2017-04-01 23:09:32 -05:00
Ryan Holmes
59b0ac127f Merge pull request #1071 from blitzmann/issue-686
Switch units in recharge pane based on effective HP toggle (requested by #686)
2017-04-01 22:31:38 -05:00
Ryan Holmes
e03b3227d4 Fix for #1081 (#1085)
* Break project application code out of main item iteration, and apply it after command boosts have been applied to the fit. Fix for #1081

* Make tox happy
2017-04-01 22:23:50 -05:00
Ryan Holmes
f08a66924c Re-introduce Command Fit State (#1074)
Reintroduce command view state

Squashes `blitzmann/command-fit-state`:

* Reintroduces command view state, allowing users to toggle command fits on and off.
* Remove type() function call and use __class__ instead
2017-04-01 22:04:44 -05:00
Ebag333
535b75225b dump module list and versions 2017-03-28 18:49:10 -07:00
Ebag333
b99c44667e Remove unused import 2017-03-27 21:11:07 -07:00
Ebag333
c6d50b7d6e Merge branch 'development' into ErrorDialog_and_miscfixes 2017-03-27 21:00:51 -07:00
Ebag333
03f12bfca1 Finish implementing wx 2.8 selector. Add a bunch of error catching. General cleanup.
(cherry picked from commit b0ec69e)
2017-03-27 20:52:45 -07:00
Ebag333
78a8c105f4 First pass at re-implementing wx 2.8 preference 2017-03-27 16:57:55 -07:00
Ryan Holmes
878d9d7148 Merge pull request #1072 from blitzmann/fix-string-variables
Fix an exception caused by too few variables for string formatting
2017-03-27 00:04:42 -04:00
blitzman
cb77987129 Fix an exception caused by too few variables for string formatting 2017-03-26 23:51:05 -04:00
blitzman
37ec3d41d9 Switch the units of recharge rates based on EHP / HP 2017-03-26 16:19:14 -04:00
Ryan Holmes
6ececbb81a Merge pull request #1063 from blitzmann/feature/commandmenu
Command Fit Menu
2017-03-26 14:56:50 -04:00
Ryan Holmes
a67c28a4c9 Merge branch 'development' into feature/commandmenu 2017-03-26 14:43:12 -04:00
Ryan Holmes
c3a0176c88 Merge pull request #1021 from Ebag333/MorePreferences
Add more functionality to preferences window.
2017-03-26 14:42:49 -04:00
blitzman
e7de57fc7a tox fixes 2017-03-26 14:39:45 -04:00
blitzman
d928df9c69 Move useStaticAdaptiveArmorHardener to the EOSSettings. Not moving force reload for now 2017-03-26 14:28:13 -04:00
blitzman
b18bb200a9 Merge branch 'development' into MorePreferences 2017-03-26 13:52:59 -04:00
Ryan Holmes
225011f2c1 Merge pull request #1070 from blitzmann/fixforsettings
Fix settings provider
2017-03-26 13:47:41 -04:00
blitzman
024edc500f Fix settings provider 2017-03-26 13:35:46 -04:00
Ryan Holmes
42d59d21a6 Merge pull request #1042 from Ebag333/HandleBadHandleres
Effect Handlers Import - Less Spam
2017-03-26 12:38:47 -04:00
Ryan Holmes
4795571629 Merge branch 'development' into HandleBadHandleres 2017-03-26 12:33:58 -04:00
Ryan Holmes
df587892a3 Merge branch 'development' into feature/commandmenu 2017-03-26 12:27:52 -04:00
Ryan Holmes
57a1f71fdd Merge branch 'development' into ErrorDialog_and_miscfixes 2017-03-26 12:22:08 -04:00
Ryan Holmes
1ffcdc92f2 Merge pull request #1031 from Ebag333/tooltip_capacitor_neut_resistance
Tooltip for capacitor neut resistance
2017-03-26 12:16:41 -04:00
Ryan Holmes
bd043c2358 Fix for #1061 (#1068)
Squash commit that does the following:

* Enable Council Diplo Shuttle
* Disables a test that was preventing Travis from returning success (need to look into this more later)
2017-03-26 12:15:07 -04:00
blitzman
fbd0a6ddda Create a custom pre-check exception that we can check for when doing our unhandled exception handling. 2017-03-25 22:34:35 -04:00
blitzman
e7aceb6a8b Bringing branch up to date with dev
Merge branch 'development' into ErrorDialog_and_miscfixes

Conflicts:
	eos/saveddata/fit.py
	pyfa.py
2017-03-25 22:30:18 -04:00
blitzman
fd745c5f62 Tox fix. 2017-03-25 01:02:20 -04:00
Ryan Holmes
41628ca17f Merge pull request #1065 from Ebag333/pytests
pytests
2017-03-25 00:41:02 -04:00
Ebag333
21fbbf154d Try fake wx module 2017-03-24 18:00:51 -07:00
Ebag333
66c4aefc1e Add comment 2017-03-24 17:27:17 -07:00
Ebag333
5d5c95fb2c Example tests for services! General cleanup.
(cherry picked from commit 9f41bb4)
2017-03-24 11:15:39 -07:00
Ebag333
13305d9ee1 Use correct formula. \o/
(cherry picked from commit b20b6c1)
2017-03-24 11:15:37 -07:00
Ebag333
4a9638767d use math
(cherry picked from commit 4b75f57)
2017-03-24 11:15:34 -07:00
Ebag333
55cd0d5000 Clean up test structure a bit
(cherry picked from commit 320e05b)
2017-03-24 11:15:32 -07:00
Ebag333
1da15cfde3 Add right number of levels to remove.
(cherry picked from commit 1d0a682)
2017-03-24 11:15:30 -07:00
Ebag333
9df0ee9a1c Comment out print
(cherry picked from commit df48cda)
2017-03-24 11:15:28 -07:00
Ebag333
8baeafbdc2 Rename a few tests to follow standards. Move fits into a helper so they can be reused. Add two new Eos tests.
(cherry picked from commit f87ac4d)
2017-03-24 11:15:25 -07:00
Ebag333
aacddb251d pep8 stuff
(cherry picked from commit e87b6c3)
2017-03-24 11:15:23 -07:00
Ebag333
1240e0f768 attempt terrible hack make run in memory
(cherry picked from commit 357275c)
2017-03-24 11:15:20 -07:00
Ebag333
cdbd2979d2 Back to what works on Windows
(cherry picked from commit 3401b87)
2017-03-24 11:15:05 -07:00
Ebag333
da493d07c0 recreate DB connection
(cherry picked from commit 5593e28)
2017-03-24 11:15:02 -07:00
Ebag333
bccb1d2805 update config
(cherry picked from commit b18aecf)
2017-03-24 11:15:00 -07:00
Ebag333
d84787b041 add test
(cherry picked from commit b1b5cb1)
2017-03-24 11:14:57 -07:00
Ebag333
f1d6252d8b Add pyfa path to python paths
(cherry picked from commit dd51c38)
2017-03-24 11:14:53 -07:00
Ebag333
38a7a50d1c move helpers functions out
(cherry picked from commit 2047d3f)
2017-03-24 11:14:50 -07:00
Ebag333
3ca181fce4 Add comment
(cherry picked from commit dbbe3aa)
2017-03-24 11:14:48 -07:00
Ebag333
9eeb01b746 Add debug output
(cherry picked from commit f8d7012)
2017-03-24 11:14:45 -07:00
Ebag333
9ef9a0f1fb disable import tests
(cherry picked from commit 58ac331)
2017-03-24 11:14:43 -07:00
Ebag333
599b5318fc Add local path
(cherry picked from commit c9c340d)
2017-03-24 11:14:41 -07:00
Ebag333
75df133071 Add hack to add in root path to python paths
(cherry picked from commit 1068c41)
2017-03-24 11:14:38 -07:00
Ebag333
403b39659c Fix tox things.
(cherry picked from commit 60298c8)
2017-03-24 11:14:34 -07:00
Ebag333
8d357ee282 Test more Rifter things!
(cherry picked from commit b92f584)
2017-03-24 11:14:32 -07:00
Ebag333
96ad687944 Baby's first (real) Eos test.
(cherry picked from commit df51f9f)
2017-03-24 11:14:29 -07:00
blitzman
79040adf1a tox fixes 2017-03-23 01:13:41 -04:00
blitzman
cbcc81d42e Actually apply the command fit, and remove print statement 2017-03-23 00:38:24 -04:00
blitzman
732386b83a Get command fit menu up and running. Had to revert to a non-cached version of the menu, as the instance has root menu, which we need in order to properly bind. Don't think caching the menu would have really given a large performance gain anyway. 2017-03-23 00:38:24 -04:00
blitzman
4065022866 Initial work on caching command fits unless needing to update. FitChanged event can now carry an action and typeID, only used in the CommandFit context menu (for now, can use this elsewhere). If the module being added or removed, we update the cached list. 2017-03-23 00:38:23 -04:00
blitzman
6c1d949cef Proof of concept for gathering fits based on modules that are fit 2017-03-23 00:38:23 -04:00
blitzman
c4293bba6b bump dev 2017-03-23 00:36:20 -04:00
blitzman
0a1008f64f Merge branch 'master' into development 2017-03-23 00:35:28 -04:00
Ebag333
a5cb2a9f00 Add logbook version warning 2017-03-22 18:52:04 -07:00
blitzman
4a6c0db4fa Bump to stable point release 2017-03-20 21:05:09 -04:00
blitzman
f31ec9a154 Merge branch 'master' of https://github.com/pyfa-org/Pyfa 2017-03-19 16:29:27 -04:00
blitzman
b4ad4becd3 Fix for #1060 2017-03-19 16:27:41 -04:00
Ryan Holmes
554807968a Update requirements.txt 2017-03-19 00:23:17 -04:00
Ryan Holmes
5cecb24654 Update README.md 2017-03-19 00:22:50 -04:00
blitzman
5911538e29 Do a version check for logbook 2017-03-19 00:22:17 -04:00
Ebag333
0ccd812398 Add logging OS version. Deprioritize some messages to debug, so devs can run at info level with less spam (and much less impact on recalc times). 2017-03-18 13:27:07 -07:00
Ebag333
9c693cd7ed Python now properly requires 2.7 and not 2.6 or 2.7. Removed duplicate output to log, now that we handle exceptions. 2017-03-18 13:11:40 -07:00
Ebag333
fbcd8396db Few little tweaks 2017-03-18 12:55:53 -07:00
Ebag333
b1be2eee06 Add unhandled exception handler. Now catches problems and will try and output to the pyfalog, falling back to outputting to the console. 2017-03-18 12:37:23 -07:00
Ryan Holmes
bca26721ff Merge pull request #1057 from Ebag333/Moar_Logging!
Fit service logging
2017-03-17 21:41:13 -04:00
Ebag333
301e874cd4 Add a ton of logging to the fitting service 2017-03-17 16:05:09 -07:00
blitzman
2ff66970ad remove __all__ from contect menus 2017-03-16 19:05:07 -04:00
Ryan Holmes
58142664cc Merge pull request #1051 from Ebag333/Fix_PR943
Fix bad merge of #943
2017-03-16 18:58:09 -04:00
Ryan Holmes
73f6a68b9d Merge pull request #1047 from Ebag333/Hotfix_Implant_ContextMenu
Hotfix - Implant ContextMenu
2017-03-16 18:54:04 -04:00
Ryan Holmes
b88f4bc77f Merge pull request #1050 from Ebag333/Hotfix_Matplotlib
Hotfix - Matplotlib import
2017-03-16 18:52:48 -04:00
Ebag333
e3c2220a1c Fix matplotlib importing 2017-03-16 14:09:10 -07:00
Ebag333
26238e731d Fix matplotlib importing 2017-03-16 10:22:40 -07:00
Ebag333
717db2f906 Further pyfa.py refactoring 2017-03-16 09:40:17 -07:00
Ebag333
1c59a27902 Fix typo and missing setting
(cherry picked from commit c122047)
2017-03-16 08:40:18 -07:00
Ebag333
6ce52a1da9 PEP8 cleanup
(cherry picked from commit 63f2f85)
2017-03-16 08:40:14 -07:00
Ebag333
f2a0e42810 Rework error dialog to have better layout and more information 2017-03-16 02:13:02 -07:00
Ebag333
63f2f85c25 PEP8 cleanup 2017-03-16 02:12:26 -07:00
blitzman
80375d1f5b Merge branch 'master' into development 2017-03-15 20:19:22 -04:00
blitzman
20ac2ad847 bump dev 2017-03-15 20:19:05 -04:00
Ebag333
a588aec978 Simple change to not try and reimport handlers if they have failed previously. 2017-03-15 15:53:40 -07:00
Ebag333
9d34c2a2e6 Add TODO 2017-03-13 11:52:18 -07:00
Ebag333
4f12caa05f Remove test variable 2017-03-13 11:30:07 -07:00
Ebag333
649ba71c0f Make sure overrides are enabled before we return override values 2017-03-13 11:15:14 -07:00
Ebag333
af5a9b31bc Fix another hidden import (move to top) 2017-03-13 11:09:12 -07:00
Ebag333
b72304203c Add default option to getOriginal. This eliminates some double lookups and simplifies the code. 2017-03-13 10:56:33 -07:00
Ebag333
f70d250995 Cleanup code. Use slightly faster comparison (is instead of isinstance). Rename OVERRIDES variable to eliminate confusion. 2017-03-13 10:11:15 -07:00
Ebag333
46626e9a63 Kill another double lookup 2017-03-09 15:31:19 -08:00
Ebag333
b5626c13b1 Refactor __calculateValue 2017-03-09 15:16:52 -08:00
Ebag333
84de420002 Remove comment 2017-03-09 12:27:45 -08:00
Ebag333
99f939026f Refactor some logic in modifiedAttributeDict 2017-03-09 12:14:23 -08:00
Ebag333
8322307ae0 Add tooltip for neut resist. Add handling missing attributes in getting modified value (return default, not exception). Tox fixes to clean up a little. 2017-03-07 09:45:34 -08:00
Ebag333
9a284bc740 Add preference to disable ship browser tooltip popup. 2017-02-27 14:33:18 -08:00
Ebag333
d67573f83a Add more functionality to preferences window. 2017-02-27 12:05:38 -08:00
blitzman
356c0c8be1 Merge branch 'master' into singularity 2017-02-07 19:08:30 -05:00
725 changed files with 24540 additions and 6045 deletions

186
.appveyor.yml Normal file
View 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
#

View File

@@ -1,4 +1,5 @@
language: python
cache: pip
python:
- '2.7'
env:
@@ -6,20 +7,33 @@ env:
addons:
apt:
packages:
# for wxPython:
- python-wxgtk2.8
- python-wxtools
- wx2.8-doc
- wx2.8-examples
- wx2.8-headers
- wx2.8-i18n
before_install:
- pip install -U tox
- 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:
- tox
- py.test --cov=./
after_success:
- bash <(curl -s https://codecov.io/bash)
before_deploy:
- pip install -r requirements_build_linux.txt

View File

@@ -42,6 +42,7 @@ If you wish to help with development or simply need to run pyfa through a Python
* `dateutil`
* `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 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).
@@ -51,7 +52,7 @@ pyfa is licensed under the GNU GPL v3.0, see LICENSE
## Resources
* Development repository: [https://github.com/pyfa-org/Pyfa](https://github.com/pyfa-org/Pyfa)
* [EVE forum thread](https://forums.eveonline.com/default.aspx?g=posts&t=466425)
* [EVE forum thread](https://forums.eveonline.com/t/27156)
* [EVE University guide using pyfa](http://wiki.eveuniversity.org/Guide_to_using_PYFA)
* [EVE Online website](http://www.eveonline.com/)

0
_development/__init__.py Normal file
View File

145
_development/helpers.py Normal file
View 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

View 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

View 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)

View 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

View File

@@ -19,9 +19,9 @@ debug = False
saveInRoot = False
# Version data
version = "1.28.0"
version = "1.33.1"
tag = "Stable"
expansionName = "YC119.3"
expansionName = "Lifeblood"
expansionVersion = "1.0"
evemonMinVersion = "4081"
@@ -29,6 +29,7 @@ pyfaPath = None
savePath = None
saveDB = None
gameDB = None
logPath = None
def isFrozen():
@@ -95,7 +96,9 @@ def defPaths(customSavePath):
# 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
import eos.config

View File

@@ -40,7 +40,7 @@ for root, folders, files in os.walk("eos/effects"):
a = Analysis(
['pyfa.py'],
pathex=['C:\\Users\\Ebag333\\Documents\\GitHub\\Ebag333\\Pyfa'],
pathex=['C:\\projects\\pyfa\\'],
binaries=[],
datas=added_files,
hiddenimports=import_these,

View 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',
)

View File

@@ -1,17 +1,30 @@
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())
gamedata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "eve.db")), sys.getfilesystemencoding())
pyfalog.debug("Gamedata connection string: {0}", gamedata_connectionstring)
if istravis is True or hasattr(sys, '_called_from_test'):
# Running in Travis. Run saveddata database in memory.
saveddata_connectionstring = 'sqlite:///:memory:'
else:
saveddata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "saveddata", "saveddata.db")), sys.getfilesystemencoding())
pyfalog.debug("Saveddata connection string: {0}", saveddata_connectionstring)
settings = {
"setting1": True
"useStaticAdaptiveArmorHardener": False,
"strictSkillLevels": True,
}
# Autodetect path, only change if the autodetection bugs out.

View File

@@ -27,7 +27,9 @@ 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
@@ -47,7 +49,7 @@ gamedata_session = sessionmaker(bind=gamedata_engine, autoflush=False, expire_on
# game db because we haven't reached gamedata_meta.create_all()
try:
config.gamedata_version = gamedata_session.execute(
"SELECT `field_value` FROM `metadata` WHERE `field_name` LIKE 'client_build'"
"SELECT `field_value` FROM `metadata` WHERE `field_name` LIKE 'client_build'"
).fetchone()[0]
except Exception as e:
pyfalog.warning("Missing gamedata version.")
@@ -68,13 +70,14 @@ 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
# 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
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
# noinspection PyPep8
@@ -85,8 +88,10 @@ from eos.db.saveddata.queries import *
# 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()

View File

@@ -40,11 +40,11 @@ alphacloneskskills_table = Table(
mapper(AlphaClone, alphaclones_table,
properties={
"ID": synonym("alphaCloneID"),
"ID" : synonym("alphaCloneID"),
"skills": relation(
AlphaCloneSkill,
cascade="all,delete-orphan",
backref="clone")
AlphaCloneSkill,
cascade="all,delete-orphan",
backref="clone")
})
mapper(AlphaCloneSkill, alphacloneskskills_table)

View File

@@ -45,11 +45,13 @@ mapper(Attribute, typeattributes_table,
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")

View File

@@ -31,7 +31,9 @@ categories_table = Table("invcategories", gamedata_meta,
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)
})

View File

@@ -18,11 +18,10 @@
# ===============================================================================
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 sqlalchemy.orm import mapper, synonym, deferred
from eos.db import gamedata_meta
from eos.gamedata import Effect, EffectInfo
from eos.gamedata import Effect, ItemEffect
typeeffects_table = Table("dgmtypeeffects", gamedata_meta,
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True, index=True),
@@ -34,17 +33,14 @@ effects_table = Table("dgmeffects", gamedata_meta,
Column("description", String),
Column("published", Boolean),
Column("isAssistance", Boolean),
Column("isOffensive", Boolean))
Column("isOffensive", Boolean),
Column("resistanceID", Integer))
mapper(EffectInfo, effects_table,
properties={"ID": synonym("effectID"),
"name": synonym("effectName"),
"description": deferred(effects_table.c.description)})
mapper(Effect, 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)

View File

@@ -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)
})

View File

@@ -29,5 +29,7 @@ icons_table = Table("icons", gamedata_meta,
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)
})

View File

@@ -21,6 +21,7 @@ from sqlalchemy import Column, String, Integer, Boolean, ForeignKey, Table, Floa
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.gamedata import Attribute, Effect, Group, Icon, Item, MetaType, Traits
@@ -43,19 +44,20 @@ 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,
properties={
"group" : relation(Group, backref="items"),
"icon" : relation(Icon),
"_Item__attributes": relation(Attribute, cascade='all, delete, delete-orphan', collection_class=attribute_mapped_collection('name')),
"effects": relation(Effect, secondary=typeeffects_table, collection_class=attribute_mapped_collection('name')),
"metaGroup" : relation(MetaType,
primaryjoin=metatypes_table.c.typeID == items_table.c.typeID,
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)
})
"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")

View File

@@ -33,10 +33,12 @@ marketgroups_table = Table("invmarketgroups", gamedata_meta,
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)
})

View File

@@ -35,13 +35,17 @@ metatypes_table = Table("invmetatypes", gamedata_meta,
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")

View File

@@ -17,7 +17,7 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
from sqlalchemy.orm import join, exc
from sqlalchemy.orm import join, exc, aliased
from sqlalchemy.sql import and_, or_, select
import eos.config
@@ -27,12 +27,11 @@ from eos.db.gamedata.group import groups_table
from eos.db.util import processEager, processWhere
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 = []
@@ -98,6 +97,35 @@ def getItem(lookfor, eager=None):
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):
@@ -152,7 +180,7 @@ def getCategory(lookfor, eager=None):
category = gamedata_session.query(Category).get(lookfor)
else:
category = gamedata_session.query(Category).options(*processEager(eager)).filter(
Category.ID == lookfor).first()
Category.ID == lookfor).first()
elif isinstance(lookfor, basestring):
if lookfor in categoryNameMap:
id = categoryNameMap[lookfor]
@@ -160,11 +188,11 @@ def getCategory(lookfor, eager=None):
category = gamedata_session.query(Category).get(id)
else:
category = gamedata_session.query(Category).options(*processEager(eager)).filter(
Category.ID == id).first()
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.name == lookfor).first()
categoryNameMap[lookfor] = category.ID
else:
raise TypeError("Need integer or string as argument")
@@ -181,7 +209,7 @@ def getMetaGroup(lookfor, eager=None):
metaGroup = gamedata_session.query(MetaGroup).get(lookfor)
else:
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(
MetaGroup.ID == lookfor).first()
MetaGroup.ID == lookfor).first()
elif isinstance(lookfor, basestring):
if lookfor in metaGroupNameMap:
id = metaGroupNameMap[lookfor]
@@ -189,11 +217,11 @@ def getMetaGroup(lookfor, eager=None):
metaGroup = gamedata_session.query(MetaGroup).get(id)
else:
metaGroup = gamedata_session.query(MetaGroup).options(*processEager(eager)).filter(
MetaGroup.ID == id).first()
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.name == lookfor).first()
metaGroupNameMap[lookfor] = metaGroup.ID
else:
raise TypeError("Need integer or string as argument")
@@ -207,7 +235,7 @@ def getMarketGroup(lookfor, eager=None):
marketGroup = gamedata_session.query(MarketGroup).get(lookfor)
else:
marketGroup = gamedata_session.query(MarketGroup).options(*processEager(eager)).filter(
MarketGroup.ID == lookfor).first()
MarketGroup.ID == lookfor).first()
else:
raise TypeError("Need integer as argument")
return marketGroup
@@ -224,7 +252,7 @@ def getItemsByCategory(filter, where=None, eager=None):
filter = processWhere(filter, where)
return gamedata_session.query(Item).options(*processEager(eager)).join(Item.group, Group.category).filter(
filter).all()
filter).all()
@cachedQuery(3, "where", "nameLike", "join")
@@ -249,6 +277,22 @@ def searchItems(nameLike, where=None, join=None, eager=None):
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, groupIDs=None, where=None, eager=None):
for itemid in itemids:
@@ -262,7 +306,7 @@ def getVariations(itemids, groupIDs=None, where=None, eager=None):
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()
filter).all()
if vars:
return vars
@@ -271,9 +315,9 @@ def getVariations(itemids, groupIDs=None, where=None, eager=None):
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()
filter).all()
return vars
return vars
@cachedQuery(1, "attr")
@@ -315,3 +359,25 @@ def directAttributeRequest(itemIDs, attrIDs):
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

View File

@@ -29,5 +29,7 @@ groups_table = Table("dgmunits", gamedata_meta,
Column("displayName", String))
mapper(Unit, groups_table,
properties={"ID": synonym("unitID"),
"name": synonym("unitName")})
properties={
"ID" : synonym("unitID"),
"name": synonym("unitName")
})

View File

@@ -14,32 +14,32 @@ 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
@@ -47,17 +47,17 @@ CONVERSIONS = {
15425, # Naiyon's Modified Co-Processor (never existed but convert
# 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,15 +69,15 @@ CONVERSIONS = {
31936: [ # Navy Micro Auxiliary Power Core
16543, # Micro 'Vigor' Core Augmentation
],
8089: [ # Compact 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
]
}

View File

@@ -14,7 +14,7 @@ CONVERSIONS = {
22947: ( # 'Beatnik' Small Remote Armor Repairer
23414, # 'Brotherhood' Small Remote Armor Repairer
),
8295: ( # Type-D Restrained Shield Flux Coil
8295 : ( # Type-D Restrained Shield Flux Coil
8293, # Beta Reactor Control: Shield Flux I
),
16499: ( # Heavy Knave Scoped Energy Nosferatu
@@ -29,13 +29,13 @@ CONVERSIONS = {
16447: ( # Medium Solace Scoped Remote Armor Repairer
16445, # Medium 'Arup' Remote Armor Repairer
),
508: ( # 'Basic' Shield Flux Coil
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
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
@@ -47,57 +47,57 @@ CONVERSIONS = {
16505: ( # Medium Ghoul Compact Energy Nosferatu
16511, # Medium Diminishing Power System Drain I
),
8297: ( # Mark I Compact Shield Flux Coil
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
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
5137 : ( # Small Knave Scoped Energy Nosferatu
5135, # E5 Prototype Energy Vampire
),
8579: ( # Medium Murky Compact Remote Shield Booster
8579 : ( # Medium Murky Compact Remote Shield Booster
8581, # Medium 'Atonement' Remote Shield Booster
),
8531: ( # Small Murky Compact 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
4477 : ( # Small Gremlin Compact Energy Neutralizer
4475, # Small Unstable Power Fluctuator I
),
8337: ( # Mark I Compact Shield Power Relay
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
5141 : ( # Small Ghoul Compact Energy Nosferatu
5139, # Small Diminishing Power System Drain I
),
4471: ( # Small Infectious Scoped Energy Neutralizer
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
8335 : ( # Type-D Restrained Shield Power Relay
8333, # Beta Reactor Control: Shield Power Relay I
),
405: ( # 'Micro' Remote Shield Booster
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
8635 : ( # Large Murky Compact Remote Shield Booster
8637, # Large 'Atonement' Remote Shield Booster
),
16507: ( # Medium Knave Scoped Energy Nosferatu

View File

@@ -13,26 +13,26 @@ CONVERSIONS = {
16461, # Multiphasic Bolt Array I
16463, # 'Pandemonium' Ballistic Enhancement
),
5281: ( # Coadjunct Scoped Remote Sensor Booster
5281 : ( # Coadjunct Scoped Remote Sensor Booster
7218, # Piercing ECCM Emitter I
),
5365: ( # Cetus Scoped Burst Jammer
5365 : ( # Cetus Scoped Burst Jammer
5359, # 1Z-3 Subversive ECM Eruption
),
1973: ( # Sensor Booster I
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
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
521 : ( # 'Basic' Damage Control
5829, # GLFF Containment Field
5831, # Interior Force Field Array
5835, # F84 Local Damage System
@@ -42,13 +42,13 @@ CONVERSIONS = {
22939, # 'Boss' Remote Sensor Booster
22941, # 'Entrepreneur' Remote Sensor Booster
),
5443: ( # Faint Epsilon Scoped Warp Scrambler
5443 : ( # Faint Epsilon Scoped Warp Scrambler
5441, # Fleeting Progressive Warp Scrambler I
),
1963: ( # Remote Sensor Booster I
1963 : ( # Remote Sensor Booster I
1959, # ECCM Projector I
),
6325: ( # Fourier Compact Tracking Enhancer
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
@@ -68,19 +68,19 @@ CONVERSIONS = {
22919: ( # 'Monopoly' Magnetic Field Stabilizer
22917, # 'Capitalist' Magnetic Field Stabilizer I
),
5839: ( # IFFA Compact Damage Control
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
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
518 : ( # 'Basic' Gyrostabilizer
5915, # Lateral Gyrostabilizer
5919, # F-M2 Weapon Inertial Suspensor
5913, # Hydraulic Stabilization Actuator
@@ -89,19 +89,19 @@ CONVERSIONS = {
19931: ( # Compulsive Scoped Multispectral ECM
19933, # 'Hypnos' Multispectral ECM I
),
5403: ( # Faint Scoped Warp Disruptor
5403 : ( # Faint Scoped Warp Disruptor
5401, # Fleeting Warp Disruptor I
),
23902: ( # 'Trebuchet' Heat Sink I
23900, # 'Mangonel' Heat Sink I
),
1893: ( # 'Basic' Heat Sink
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
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
@@ -123,40 +123,40 @@ CONVERSIONS = {
19952: ( # Umbra Scoped Radar ECM
9520, # 'Penumbra' White Noise ECM
),
1952: ( # Sensor Booster II
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
5282 : ( # Linked Enduring Sensor Booster
7219, # Scattering ECCM Projector I
),
1986: ( # Signal Amplifier 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
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
1964 : ( # Remote Sensor Booster II
1960, # ECCM Projector II
),
5933: ( # Counterbalanced Compact Gyrostabilizer
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
4025 : ( # X5 Enduring Stasis Webifier
4029, # 'Langour' Drive Disruptor I
),
4027: ( # Fleeting Compact Stasis Webifier
4027 : ( # Fleeting Compact Stasis Webifier
4031, # Patterned Stasis Web I
),
22937: ( # 'Enterprise' Remote Tracking Computer
@@ -165,7 +165,7 @@ CONVERSIONS = {
22929: ( # 'Marketeer' Tracking Computer
22927, # 'Economist' Tracking Computer I
),
1987: ( # Signal Amplifier II
1987 : ( # Signal Amplifier II
2580, # Gravimetric Backup Array II
2584, # Ladar Backup Array II
2588, # Magnetometric Backup Array II
@@ -175,13 +175,13 @@ CONVERSIONS = {
19939: ( # Enfeebling Scoped Ladar ECM
9522, # Faint Phase Inversion ECM I
),
5340: ( # P-S Compact Remote Tracking Computer
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
1949 : ( # 'Basic' Signal Amplifier
1946, # Basic RADAR Backup Array
1982, # Basic Ladar Backup Array
1983, # Basic Gravimetric Backup Array
@@ -222,10 +222,10 @@ CONVERSIONS = {
23416: ( # 'Peace' Large Remote Armor Repairer
None, # 'Pacifier' Large Remote Armor Repairer
),
6176: ( # F-12 Enduring Tracking Computer
6176 : ( # F-12 Enduring Tracking Computer
6174, # Monopulse Tracking Mechanism I
),
6159: ( # Alumel-Wired Enduring Sensor Booster
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
@@ -247,7 +247,7 @@ CONVERSIONS = {
7914, # Prototype ECCM Magnetometric Sensor Cluster
6158, # Prototype Sensor Booster
),
5849: ( # Extruded Compact Heat Sink
5849 : ( # Extruded Compact Heat Sink
5846, # Thermal Exhaust System I
5858, # C4S Coiled Circuit Thermal Radiator
5857, # 'Skadi' Coolant System I
@@ -263,15 +263,15 @@ CONVERSIONS = {
22945: ( # 'Executive' Remote Sensor Dampener
22943, # 'Broker' Remote Sensor Dampener I
),
6173: ( # Optical Compact Tracking Computer
6173 : ( # Optical Compact Tracking Computer
6175, # 'Orion' Tracking CPU I
),
5279: ( # F-23 Compact Remote Sensor Booster
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
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
@@ -279,7 +279,7 @@ CONVERSIONS = {
19946: ( # BZ-5 Scoped Gravimetric ECM
9519, # FZ-3 Subversive Spatial Destabilizer ECM
),
6073: ( # Medium Compact Pb-Acid Cap Battery
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
@@ -287,7 +287,7 @@ CONVERSIONS = {
21484: ( # 'Full Duplex' Ballistic Control System
21482, # Ballistic 'Purge' Targeting System I
),
6296: ( # F-89 Compact Signal Amplifier
6296 : ( # F-89 Compact Signal Amplifier
6218, # Protected Gravimetric Backup Cluster I
6222, # Protected Ladar Backup Cluster I
6226, # Protected Magnetometric Backup Cluster I
@@ -324,7 +324,7 @@ CONVERSIONS = {
6293, # Wavelength Signal Enhancer I
6295, # Type-D Attenuation Signal Augmentation
),
5302: ( # Phased Muon Scoped Sensor Dampener
5302 : ( # Phased Muon Scoped Sensor Dampener
5300, # Indirect Scanning Dampening Unit I
),
}

View File

@@ -16,23 +16,27 @@ def upgrade(saveddata_engine):
JOIN wings w on w.ID = s.wingID
JOIN gangs g on g.ID = w.gangID
"""
try:
results = saveddata_session.execute(sql)
results = saveddata_session.execute(sql)
inserts = []
inserts = []
for row in results:
boosted = row["boostedFit"]
types = ("squad", "wing", "gang")
for x in types:
value = row["{}Boost".format(x)]
if value is None:
continue
for row in results:
boosted = row["boostedFit"]
types = ("squad", "wing", "gang")
for x in types:
value = row["{}Boost".format(x)]
if value is None:
continue
inserts.append({"boosterID": value, "boostedID": boosted, "active": 1})
try:
saveddata_session.execute(commandFits_table.insert(),
{"boosterID": value, "boostedID": boosted, "active": 1})
except Exception:
pass
saveddata_session.commit()
inserts.append({"boosterID": value, "boostedID": boosted, "active": 1})
try:
saveddata_session.execute(commandFits_table.insert(),
{"boosterID": value, "boostedID": boosted, "active": 1})
except Exception:
pass
saveddata_session.commit()
except:
# Shouldn't fail unless you have updated database without the old fleet schema and manually modify the database version
# If it does, simply fail. Fleet data migration isn't critically important here
pass

View 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))

View 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;")

View 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")

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
"""
Migration 26
- Deletes invalid command fit relationships caused by a bug (see #1244)
"""
def upgrade(saveddata_engine):
saveddata_engine.execute("DELETE FROM commandFits WHERE boosterID NOT IN (SELECT ID FROM fits) OR boostedID NOT IN (SELECT ID FROM fits)")

View File

@@ -11,64 +11,64 @@ Migration 4
"""
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
),
@@ -79,53 +79,53 @@ 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
),
}

View File

@@ -7,5 +7,5 @@ Overwrites damage profile 0 to reset bad uniform values (bad values set with bug
def upgrade(saveddata_engine):
saveddata_engine.execute('DELETE FROM damagePatterns WHERE name LIKE ? OR ID LIKE ?', ("Uniform", "1"))
saveddata_engine.execute('INSERT INTO damagePatterns VALUES (?, ?, ?, ?, ?, ?, ?)',
saveddata_engine.execute('INSERT INTO damagePatterns (ID, name, emAmount, thermalAmount, kineticAmount, explosiveAmount, ownerID) VALUES (?, ?, ?, ?, ?, ?, ?)',
(1, "Uniform", 25, 25, 25, 25, None))

View File

@@ -8,16 +8,16 @@ Migration 8
"""
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
@@ -28,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

View File

@@ -20,6 +20,6 @@ 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")
"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")

View File

@@ -17,33 +17,39 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
from sqlalchemy import Table, Column, ForeignKey, Integer, Boolean
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy import Table, Column, ForeignKey, Integer, Boolean, DateTime
from sqlalchemy.orm import mapper, relation
import datetime
from eos.db import saveddata_meta
from eos.saveddata.booster import Booster
from eos.saveddata.boosterSideEffect import BoosterSideEffect
boosters_table = Table("boosters", saveddata_meta,
Column("ID", Integer, primary_key=True),
Column("itemID", Integer),
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False),
Column("active", Boolean),
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
)
# Legacy booster side effect code, should disable but a mapper relies on it.
activeSideEffects_table = Table("boostersActiveSideEffects", saveddata_meta,
Column("boosterID", ForeignKey("boosters.ID"), primary_key=True),
Column("effectID", Integer, primary_key=True))
booster_side_effect_table = Table("boosterSideEffects", saveddata_meta,
Column("boosterID", Integer, ForeignKey("boosters.ID"), primary_key=True, index=True),
Column("effectID", Integer, nullable=False, primary_key=True),
Column("active", Boolean, default=False)
)
class ActiveSideEffectsDummy(object):
def __init__(self, effectID):
self.effectID = effectID
mapper(ActiveSideEffectsDummy, activeSideEffects_table)
mapper(Booster, boosters_table,
properties={"_Booster__activeSideEffectDummies": relation(ActiveSideEffectsDummy)})
properties={
"_Booster__sideEffects": relation(
BoosterSideEffect,
backref="booster",
cascade='all, delete, delete-orphan'),
}
)
Booster._Booster__activeSideEffectIDs = association_proxy("_Booster__activeSideEffectDummies", "effectID")
mapper(BoosterSideEffect, booster_side_effect_table)

View File

@@ -17,16 +17,25 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
from sqlalchemy import Table, Column, Integer, ForeignKey
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.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("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)
}
)

View File

@@ -17,8 +17,9 @@
# 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
@@ -36,27 +37,31 @@ characters_table = Table("characters", saveddata_meta,
Column("chars", String, nullable=True),
Column("defaultLevel", Integer, nullable=True),
Column("alphaCloneID", Integer, nullable=True),
Column("ownerID", ForeignKey("users.ID"), 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__alphaCloneID": characters_table.c.alphaCloneID,
"savedName": characters_table.c.name,
"_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),
"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),
}
)

View File

@@ -17,8 +17,9 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
from sqlalchemy import Table, Column, Integer, String
from sqlalchemy import Table, Column, Integer, String, DateTime
from sqlalchemy.orm import mapper
import datetime
from eos.db import saveddata_meta
from eos.saveddata.crestchar import CrestChar
@@ -26,6 +27,8 @@ 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("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)

View File

@@ -17,8 +17,9 @@
# 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.saveddata.damagePattern import DamagePattern
@@ -30,6 +31,9 @@ damagePatterns_table = Table("damagePatterns", saveddata_meta,
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)

View File

@@ -168,7 +168,7 @@ class DatabaseCleanup(object):
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)
table)
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
if results is None:
@@ -178,14 +178,14 @@ class DatabaseCleanup(object):
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)
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)
table)
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
if results is None:
@@ -215,8 +215,8 @@ class DatabaseCleanup(object):
row = results.first()
if row and row['num']:
query = "UPDATE '{0}' SET '{1}Amount' = '0' WHERE {1}Amount IS NULL OR Amount = ''".format(profileType,
damageType)
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)

View File

@@ -17,11 +17,13 @@
# 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, Boolean, DateTime
from sqlalchemy.orm import mapper, relation
import datetime
from eos.db import saveddata_meta
from eos.saveddata.drone import Drone
from eos.saveddata.fit import Fit
drones_table = Table("drones", saveddata_meta,
Column("groupID", Integer, primary_key=True),
@@ -29,6 +31,13 @@ drones_table = Table("drones", saveddata_meta,
Column("itemID", Integer, nullable=False),
Column("amount", Integer, nullable=False),
Column("amountActive", Integer, nullable=False),
Column("projected", Boolean, default=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)
}
)

View File

@@ -17,8 +17,9 @@
# 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, relation
import datetime
from eos.db import saveddata_meta
from eos.saveddata.fighterAbility import FighterAbility
@@ -31,7 +32,10 @@ fighters_table = Table("fighters", saveddata_meta,
Column("itemID", Integer, nullable=False),
Column("active", Boolean, nullable=True),
Column("amount", Integer, nullable=False),
Column("projected", Boolean, default=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,
@@ -41,11 +45,11 @@ fighter_abilities_table = Table("fightersAbilities", saveddata_meta,
mapper(Fighter, fighters_table,
properties={
"owner": relation(Fit),
"owner" : relation(Fit),
"_Fighter__abilities": relation(
FighterAbility,
backref="fighter",
cascade='all, delete, delete-orphan'),
FighterAbility,
backref="fighter",
cascade='all, delete, delete-orphan'),
})
mapper(FighterAbility, fighter_abilities_table)

View File

@@ -21,7 +21,8 @@ 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
from sqlalchemy import ForeignKey, Column, Integer, String, Table, Boolean, DateTime
import datetime
from eos.db import saveddata_meta
from eos.db import saveddata_session
@@ -57,6 +58,9 @@ fits_table = Table("fits", saveddata_meta,
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,
@@ -64,12 +68,16 @@ projectedFits_table = Table("projectedFits", saveddata_meta,
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("active", Boolean, nullable=False, default=1),
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
)
@@ -100,7 +108,7 @@ 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))
)
@@ -120,120 +128,131 @@ class CommandFit(object):
def __repr__(self):
return "CommandFit(boosterID={}, boostedID={}, active={}) at {}".format(
self.boosterID, self.boostedID, self.active, hex(id(self))
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)
"victimOf", # look at the victimOf association...
"source_fit", # .. and return the source fits
creator=lambda sourceID, source_fit: ProjectedFit(sourceID, source_fit)
)
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)
"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'),
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
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"),
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),
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
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
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)),
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
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
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='fit',
single_parent=True,
primaryjoin=fitImplants_table.c.fitID == fits_table.c.ID,
secondaryjoin=fitImplants_table.c.implantID == Implant.ID,
secondary=fitImplants_table),
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"),
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'),
"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": 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'),
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'),
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)

View File

@@ -17,8 +17,9 @@
# 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.saveddata.implant import Implant
@@ -26,7 +27,10 @@ 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("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),

View File

@@ -17,8 +17,9 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
from sqlalchemy import Table, Column, Integer, String
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
@@ -29,18 +30,20 @@ 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),
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),
}
)

View File

@@ -17,8 +17,9 @@
# 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.saveddata.module import Module
@@ -33,6 +34,8 @@ modules_table = Table("modules", saveddata_meta,
Column("state", Integer, CheckConstraint("state >= -1"), CheckConstraint("state <= 2")),
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,

View File

@@ -17,8 +17,9 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
from sqlalchemy import Table, Column, Integer, Float
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
@@ -26,6 +27,9 @@ 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("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)

View File

@@ -25,8 +25,10 @@ from eos.saveddata.price import Price
prices_table = Table("prices", saveddata_meta,
Column("typeID", Integer, primary_key=True),
Column("price", Float),
Column("price", Float, default=0.0),
Column("time", Integer, nullable=False),
Column("failed", Integer))
mapper(Price, prices_table)
mapper(Price, prices_table, properties={
"_Price__price": prices_table.c.price,
})

View File

@@ -17,7 +17,10 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
import sys
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
@@ -30,6 +33,7 @@ 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
@@ -175,7 +179,7 @@ def getCharacter(lookfor, eager=None):
eager = processEager(eager)
with sd_lock:
character = saveddata_session.query(Character).options(*eager).filter(
Character.savedName == lookfor).first()
Character.savedName == lookfor).first()
else:
raise TypeError("Need integer or string as argument")
return character
@@ -241,22 +245,34 @@ 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
@@ -336,6 +352,13 @@ def getDamagePatternList(eager=None):
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:
@@ -343,6 +366,13 @@ def getTargetResistsList(eager=None):
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:
@@ -360,12 +390,12 @@ def getDamagePattern(lookfor, eager=None):
eager = processEager(eager)
with sd_lock:
pattern = saveddata_session.query(DamagePattern).options(*eager).filter(
DamagePattern.ID == lookfor).first()
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()
DamagePattern.name == lookfor).first()
else:
raise TypeError("Need integer or string as argument")
return pattern
@@ -381,12 +411,12 @@ def getTargetResists(lookfor, eager=None):
eager = processEager(eager)
with sd_lock:
pattern = saveddata_session.query(TargetResists).options(*eager).filter(
TargetResists.ID == lookfor).first()
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()
TargetResists.name == lookfor).first()
else:
raise TypeError("Need integer or string as argument")
return pattern
@@ -402,7 +432,7 @@ def getImplantSet(lookfor, eager=None):
eager = processEager(eager)
with sd_lock:
pattern = saveddata_session.query(ImplantSet).options(*eager).filter(
TargetResists.ID == lookfor).first()
TargetResists.ID == lookfor).first()
elif isinstance(lookfor, basestring):
eager = processEager(eager)
with sd_lock:
@@ -511,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]

View File

@@ -17,15 +17,20 @@
# 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.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("_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)

View File

@@ -17,8 +17,9 @@
# 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.saveddata.targetResists import TargetResists
@@ -30,6 +31,9 @@ targetResists_table = Table("targetResists", saveddata_meta,
Column("thermalAmount", Float),
Column("kineticAmount", Float),
Column("explosiveAmount", Float),
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(TargetResists, targetResists_table)

View File

@@ -20,16 +20,18 @@
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):

View File

@@ -3,6 +3,7 @@
# Used by:
# Module: Reactive Armor Hardener
from logbook import Logger
import eos.config
pyfalog = Logger(__name__)
@@ -13,6 +14,12 @@ type = "active"
def handler(fit, module, context):
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:

View File

@@ -0,0 +1,9 @@
# agilityBonus
#
# Used by:
# Subsystems named like: Propulsion Interdiction Nullifier (4 of 4)
type = "passive"
def handler(fit, src, context):
fit.ship.increaseItemAttr("agility", src.getModifiedItemAttr("agilityBonusAdd"))

View File

@@ -1,9 +1,7 @@
# ammoInfluenceCapNeed
#
# Used by:
# Items from category: Charge (465 of 912)
# Charges from group: Frequency Crystal (185 of 185)
# Charges from group: Hybrid Charge (209 of 209)
# Items from category: Charge (478 of 924)
type = "passive"

View File

@@ -1,7 +1,7 @@
# ammoInfluenceRange
#
# Used by:
# Items from category: Charge (571 of 912)
# Items from category: Charge (572 of 924)
type = "passive"

View File

@@ -3,7 +3,6 @@
# Used by:
# Charges from group: Festival Charges (22 of 22)
# Charges from group: Interdiction Probe (2 of 2)
# Charges from group: Survey Probe (3 of 3)
type = "passive"

View File

@@ -7,7 +7,7 @@
# Charges from group: Advanced Blaster Charge (8 of 8)
# Charges from group: Advanced Pulse Laser Crystal (8 of 8)
# Charges from group: Advanced Railgun Charge (8 of 8)
# Charges from group: Projectile Ammo (129 of 129)
# Charges from group: Projectile Ammo (128 of 128)
type = "passive"

View File

@@ -1,9 +1,9 @@
# armorHPBonusAddPassive
#
# Used by:
# Subsystems from group: Defensive Systems (16 of 16)
# Subsystems from group: Defensive Systems (9 of 12)
type = "passive"
def handler(fit, module, context):
fit.ship.increaseItemAttr("armorHP", module.getModifiedItemAttr("armorHPBonusAdd"))
fit.ship.increaseItemAttr("armorHP", module.getModifiedItemAttr("armorHPBonusAdd") or 0)

View File

@@ -1,10 +1,15 @@
# boosterArmorHpPenalty
#
# Used by:
# Implants from group: Booster (12 of 48)
# Implants from group: Booster (12 of 52)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Armor Capacity"
# Attribute that this effect targets
attr = "boosterArmorHPPenalty"
def handler(fit, booster, context):
fit.ship.boostItemAttr("armorHP", booster.getModifiedItemAttr("boosterArmorHPPenalty"))
fit.ship.boostItemAttr("armorHP", booster.getModifiedItemAttr(attr))

View File

@@ -5,9 +5,14 @@
# Implants named like: Mindflood Booster (3 of 4)
# Implants named like: Sooth Sayer Booster (3 of 4)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Armor Repair Amount"
# Attribute that this effect targets
attr = "boosterArmorRepairAmountPenalty"
def handler(fit, booster, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Armor Repair Unit",
"armorDamageAmount", booster.getModifiedItemAttr("boosterArmorRepairAmountPenalty"))
"armorDamageAmount", booster.getModifiedItemAttr(attr))

View File

@@ -4,8 +4,13 @@
# Implants named like: Blue Pill Booster (3 of 5)
# Implants named like: Exile Booster (3 of 4)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Cap Capacity"
# Attribute that this effect targets
attr = "boosterCapacitorCapacityPenalty"
def handler(fit, booster, context):
fit.ship.boostItemAttr("capacitorCapacity", booster.getModifiedItemAttr("boosterCapacitorCapacityPenalty"))
fit.ship.boostItemAttr("capacitorCapacity", booster.getModifiedItemAttr(attr))

View File

@@ -1,10 +1,15 @@
# boosterMaxVelocityPenalty
#
# Used by:
# Implants from group: Booster (12 of 48)
# Implants from group: Booster (12 of 52)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Velocity"
# Attribute that this effect targets
attr = "boosterMaxVelocityPenalty"
def handler(fit, booster, context):
fit.ship.boostItemAttr("maxVelocity", booster.getModifiedItemAttr("boosterMaxVelocityPenalty"))
fit.ship.boostItemAttr("maxVelocity", booster.getModifiedItemAttr(attr))

View File

@@ -4,9 +4,14 @@
# Implants named like: Exile Booster (3 of 4)
# Implants named like: Mindflood Booster (3 of 4)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Missile Explosion Radius"
# Attribute that this effect targets
attr = "boosterMissileAOECloudPenalty"
def handler(fit, booster, context):
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
"aoeCloudSize", booster.getModifiedItemAttr("boosterMissileAOECloudPenalty"))
"aoeCloudSize", booster.getModifiedItemAttr(attr))

View File

@@ -3,9 +3,14 @@
# Used by:
# Implants named like: Blue Pill Booster (3 of 5)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Missile Explosion Velocity"
# Attribute that this effect targets
attr = "boosterAOEVelocityPenalty"
def handler(fit, booster, context):
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
"aoeVelocity", booster.getModifiedItemAttr("boosterAOEVelocityPenalty"))
"aoeVelocity", booster.getModifiedItemAttr(attr))

View File

@@ -4,9 +4,14 @@
# Implants named like: Crash Booster (3 of 4)
# Implants named like: X Instinct Booster (3 of 4)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Missile Velocity"
# Attribute that this effect targets
attr = "boosterMissileVelocityPenalty"
def handler(fit, booster, context):
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"),
"maxVelocity", "boosterMissileVelocityPenalty")
"maxVelocity", booster.getModifiedItemAttr(attr))

View File

@@ -1,10 +1,15 @@
# boosterShieldCapacityPenalty
#
# Used by:
# Implants from group: Booster (12 of 48)
# Implants from group: Booster (12 of 52)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Shield Capacity"
# Attribute that this effect targets
attr = "boosterShieldCapacityPenalty"
def handler(fit, booster, context):
fit.ship.boostItemAttr("shieldCapacity", booster.getModifiedItemAttr("boosterShieldCapacityPenalty"))
fit.ship.boostItemAttr("shieldCapacity", booster.getModifiedItemAttr(attr))

View File

@@ -4,9 +4,14 @@
# Implants named like: Drop Booster (3 of 4)
# Implants named like: X Instinct Booster (3 of 4)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Turret Falloff"
# Attribute that this effect targets
attr = "boosterTurretFalloffPenalty"
def handler(fit, booster, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
"falloff", booster.getModifiedItemAttr("boosterTurretFalloffPenalty"))
"falloff", booster.getModifiedItemAttr(attr))

View File

@@ -5,9 +5,14 @@
# Implants named like: Mindflood Booster (3 of 4)
# Implants named like: Sooth Sayer Booster (3 of 4)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Turret Optimal Range"
# Attribute that this effect targets
attr = "boosterTurretOptimalRange"
def handler(fit, booster, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
"maxRange", booster.getModifiedItemAttr("boosterTurretOptimalRange"))
"maxRange", booster.getModifiedItemAttr(attr))

View File

@@ -4,9 +4,14 @@
# Implants named like: Exile Booster (3 of 4)
# Implants named like: Frentix Booster (3 of 4)
type = "boosterSideEffect"
activeByDefault = False
# User-friendly name for the side effect
displayName = "Turret Tracking"
# Attribute that this effect targets
attr = "boosterTurretTrackingPenalty"
def handler(fit, booster, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"),
"trackingSpeed", booster.getModifiedItemAttr("boosterTurretTrackingPenalty"))
"trackingSpeed", booster.getModifiedItemAttr(attr))

View File

@@ -1,11 +1,9 @@
# capacitorCapacityAddPassive
#
# Used by:
# Subsystems from group: Engineering Systems (16 of 16)
# Subsystem: Tengu Offensive - Magnetic Infusion Basin
# Items from category: Subsystem (20 of 48)
type = "passive"
def handler(fit, module, context):
fit.ship.increaseItemAttr("capacitorCapacity",
module.getModifiedItemAttr("capacitorCapacity"))
fit.ship.increaseItemAttr("capacitorCapacity", module.getModifiedItemAttr("capacitorCapacity") or 0)

View File

@@ -1,9 +1,10 @@
# capacityAddPassive
#
# Used by:
# Subsystems from group: Defensive Systems (16 of 16)
# Subsystems named like: Defensive Covert Reconfiguration (4 of 4)
# Subsystem: Legion Defensive - Nanobot Injector
type = "passive"
def handler(fit, subsystem, context):
fit.ship.increaseItemAttr("capacity", subsystem.getModifiedItemAttr("capacity") or 0)
fit.ship.increaseItemAttr("capacity", subsystem.getModifiedItemAttr("cargoCapacityAdd") or 0)

View File

@@ -8,6 +8,5 @@ type = "passive"
def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Leadership"),
"maxRange",
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Leadership"), "maxRange",
src.getModifiedItemAttr("areaOfEffectBonus") * src.level)

View File

@@ -4,10 +4,10 @@
# Ships from group: Carrier (4 of 4)
# Ships from group: Combat Battlecruiser (13 of 13)
# Ships from group: Command Ship (8 of 8)
# Ships from group: Force Auxiliary (4 of 4)
# Ships from group: Force Auxiliary (6 of 6)
# Ships from group: Supercarrier (6 of 6)
# Ships from group: Titan (5 of 5)
# Subsystems named like: Defensive Warfare Processor (4 of 4)
# Ships from group: Titan (7 of 7)
# Subsystems named like: Offensive Support Processor (4 of 4)
# Ship: Orca
# Ship: Rorqual
type = "passive"

View File

@@ -0,0 +1,23 @@
# concordSecStatusTankBonus
#
# Used by:
# Ship: Enforcer
# Ship: Marshal
# Ship: Pacifier
type = "passive"
def handler(fit, src, context):
# Get pilot sec status bonus directly here, instead of going through the intermediary effects
# via https://forums.eveonline.com/default.aspx?g=posts&t=515826
try:
bonus = max(0, min(50.0, (src.parent.character.secStatus * 10)))
except:
bonus = None
if bonus is not None:
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Repair Systems"),
"armorDamageAmount", bonus, stackingPenalties=True)
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Operation"),
"shieldBonus", bonus, stackingPenalties=True)

View File

@@ -1,7 +1,7 @@
# covertCynoCpuPenalty
#
# Used by:
# Subsystems from group: Offensive Systems (12 of 16)
# Subsystems from group: Defensive Systems (8 of 12)
type = "passive"

View File

@@ -1,14 +1,14 @@
# covertOpsAndReconOpsCloakModuleDelayBonus
#
# Used by:
# Ships from group: Black Ops (4 of 4)
# Ships from group: Black Ops (5 of 5)
# Ships from group: Blockade Runner (4 of 4)
# Ships from group: Covert Ops (6 of 6)
# Ships from group: Covert Ops (7 of 7)
# Ships from group: Expedition Frigate (2 of 2)
# Ships from group: Force Recon Ship (6 of 6)
# Ships from group: Stealth Bomber (4 of 4)
# Ships from group: Force Recon Ship (7 of 8)
# Ships from group: Stealth Bomber (4 of 5)
# Ships named like: Stratios (2 of 2)
# Subsystems named like: Offensive Covert Reconfiguration (4 of 4)
# Subsystems named like: Defensive Covert Reconfiguration (4 of 4)
# Ship: Astero
# Ship: Rabisu
type = "passive"

View File

@@ -1,7 +1,7 @@
# covertOpsCloakCpuPenalty
#
# Used by:
# Subsystems from group: Offensive Systems (12 of 16)
# Subsystems from group: Defensive Systems (8 of 12)
type = "passive"

View File

@@ -1,7 +1,7 @@
# covertOpsCloakCpuPercentBonus1
#
# Used by:
# Ships from group: Covert Ops (5 of 6)
# Ships from group: Covert Ops (5 of 7)
type = "passive"
runTime = "early"

View File

@@ -1,8 +1,10 @@
# covertOpsCloakCPUPercentBonusPirateFaction
# covertOpsCloakCPUPercentRoleBonus
#
# Used by:
# Ships from group: Expedition Frigate (2 of 2)
# Ship: Astero
# Ship: Enforcer
# Ship: Pacifier
# Ship: Victorieux Luxury Yacht
type = "passive"
runTime = "early"
@@ -10,4 +12,4 @@ runTime = "early"
def handler(fit, ship, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Cloaking"),
"cpu", ship.getModifiedItemAttr("shipBonusPirateFaction"))
"cpu", ship.getModifiedItemAttr("shipBonusRole7"))

View File

@@ -1,8 +1,8 @@
# covertOpsCpuBonus1
#
# Used by:
# Ships from group: Stealth Bomber (4 of 4)
# Subsystems named like: Offensive Covert Reconfiguration (4 of 4)
# Ships from group: Stealth Bomber (4 of 5)
# Subsystems named like: Defensive Covert Reconfiguration (4 of 4)
type = "passive"

View File

@@ -1,7 +1,7 @@
# covertOpsStealthBomberSiegeMissileLauncerPowerNeedBonus
#
# Used by:
# Ships from group: Stealth Bomber (4 of 4)
# Ships from group: Stealth Bomber (4 of 5)
type = "passive"

View File

@@ -1,8 +1,8 @@
# covertOpsStealthBomberTargettingDelayBonus
#
# Used by:
# Ships from group: Black Ops (4 of 4)
# Ships from group: Stealth Bomber (4 of 4)
# Ships from group: Black Ops (5 of 5)
# Ships from group: Stealth Bomber (4 of 5)
# Ship: Caedes
# Ship: Chremoas
# Ship: Endurance

View File

@@ -1,7 +1,7 @@
# cpuOutputAddCpuOutputPassive
#
# Used by:
# Items from category: Subsystem (40 of 80)
# Subsystems from group: Offensive Systems (8 of 12)
type = "passive"

View File

@@ -1,7 +1,7 @@
# cynosuralDurationBonus
#
# Used by:
# Ships from group: Force Recon Ship (5 of 6)
# Ships from group: Force Recon Ship (6 of 8)
type = "passive"

View File

@@ -1,7 +1,7 @@
# cynosuralTheoryConsumptionBonus
#
# Used by:
# Ships from group: Force Recon Ship (5 of 6)
# Ships from group: Force Recon Ship (6 of 8)
# Skill: Cynosural Field Theory
type = "passive"

View File

@@ -1,7 +1,7 @@
# doHacking
#
# Used by:
# Modules from group: Data Miners (15 of 16)
# Modules from group: Data Miners (17 of 18)
type = "active"

View File

@@ -0,0 +1,18 @@
# doomsdayAOEECM
#
# Used by:
# Module: ECM Jammer Burst Projector
from eos.modifiedAttributeDict import ModifiedAttributeDict
type = "projected", "active"
def handler(fit, module, context, **kwargs):
if "projected" in context:
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
strModifier = 1 - module.getModifiedItemAttr("scan{0}StrengthBonus".format(fit.scanType)) / fit.scanStrength
if 'effect' in kwargs:
strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
fit.ecmProjectedStr *= strModifier

View File

@@ -1,8 +1,7 @@
# droneBandwidthAddPassive
#
# Used by:
# Subsystems from group: Engineering Systems (13 of 16)
# Subsystems from group: Offensive Systems (16 of 16)
# Subsystems from group: Offensive Systems (12 of 12)
type = "passive"

View File

@@ -1,7 +1,7 @@
# droneCapacityAdddroneCapacityPassive
#
# Used by:
# Items from category: Subsystem (42 of 80)
# Subsystems from group: Offensive Systems (12 of 12)
type = "passive"

View File

@@ -2,12 +2,17 @@
#
# Used by:
# Modules from group: Burst Jammer (11 of 11)
from eos.modifiedAttributeDict import ModifiedAttributeDict
type = "projected", "active"
def handler(fit, module, context):
def handler(fit, module, context, **kwargs):
if "projected" in context:
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
strModifier = 1 - module.getModifiedItemAttr("scan{0}StrengthBonus".format(fit.scanType)) / fit.scanStrength
if 'effect' in kwargs:
strModifier *= ModifiedAttributeDict.getResistance(fit, kwargs['effect'])
fit.ecmProjectedStr *= strModifier

View File

@@ -3,6 +3,7 @@
# Used by:
# Implants named like: Zainou 'Gypsy' CPU Management EE (6 of 6)
# Modules named like: Processor Overclocking Unit (8 of 8)
# Subsystems named like: Core Electronic Efficiency Gate (2 of 2)
# Implant: Genolution Core Augmentation CA-2
# Skill: CPU Management
type = "passive"

View File

@@ -1,7 +1,7 @@
# eliteBonusBlackOpsCloakVelocity2
#
# Used by:
# Ships from group: Black Ops (4 of 4)
# Ships from group: Black Ops (5 of 5)
type = "passive"

View File

@@ -0,0 +1,10 @@
# eliteBonusBlackOpsScramblerRange4
#
# Used by:
# Ship: Marshal
type = "passive"
def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Warp Scrambler", "maxRange",
src.getModifiedItemAttr("eliteBonusBlackOps4"), stackingPenalties=True, skill="Black Ops")

View File

@@ -0,0 +1,9 @@
# eliteBonusBlackOpsWarpVelocity1
#
# Used by:
# Ship: Marshal
type = "passive"
def handler(fit, src, context):
fit.ship.boostItemAttr("warpSpeedMultiplier", src.getModifiedItemAttr("eliteBonusBlackOps1"), stackingPenalties=True, skill="Black Ops")

View File

@@ -0,0 +1,10 @@
# eliteBonusBlackOpsWebRange3
#
# Used by:
# Ship: Marshal
type = "passive"
def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", "maxRange",
src.getModifiedItemAttr("eliteBonusBlackOps3"), stackingPenalties=True, skill="Black Ops")

View File

@@ -1,7 +1,7 @@
# eliteBonusCoverOpsScanProbeStrength2
#
# Used by:
# Ships from group: Covert Ops (6 of 6)
# Ships from group: Covert Ops (7 of 7)
type = "passive"

Some files were not shown because too many files have changed in this diff Show More