Compare commits

..

140 Commits

Author SHA1 Message Date
blitzman
e51ca85e26 Bump stable 2017-02-16 23:16:02 -05:00
blitzman
4ba11d832a Tox fixes, because it's a thing we do now 2017-02-16 23:12:25 -05:00
blitzman
66d78fed2c Add indication in character name of alpha status 2017-02-16 23:09:27 -05:00
blitzman
6f733394f7 Fix ICS / Mining Boost skill bonus (#892) 2017-02-16 00:26:11 -05:00
blitzman
b164b86eda Fix context menu order 2017-02-16 00:18:09 -05:00
blitzman
de50bbb16f Update effect files 2017-02-15 21:14:40 -05:00
blitzman
e835cb7f8c update database 2017-02-15 21:12:05 -05:00
blitzman
7fea0c9431 Add migration script for #728 2017-02-15 21:01:58 -05:00
blitzman
bcd045ae4e tweak 2017-02-15 21:01:36 -05:00
blitzman
3f46db55b6 Merge remote-tracking branch 'ebag/ActiveDroneStacking' 2017-02-15 21:01:28 -05:00
Ebag333
a865028420 Remove litter. 2017-02-15 15:42:46 -08:00
Ebag333
489637ec67 Handle this at a lower level. 2017-02-15 09:20:22 -08:00
Ebag333
71ca7d153e Check if we have active drones when merging, if we do make them all active to avoid getting weird scenarios (like deactivating stacks, or only activating parts of stacks). Fixes #728 2017-02-15 08:59:54 -08:00
blitzman
0a37834fd8 Disable the global module ammo picker for now 2017-02-14 23:20:23 -05:00
blitzman
0cc279b351 pass the damn tox 2017-02-14 23:06:33 -05:00
blitzman
06baa10cdc Fix for #991 2017-02-14 20:33:27 -05:00
blitzman
c406102995 remove redundant inits 2017-02-14 20:30:34 -05:00
blitzman
0dc3eda99f Merge branch 'development' of https://github.com/pyfa-org/Pyfa into development 2017-02-13 23:27:40 -05:00
blitzman
2dca9fc3f3 Fix stuff in system pricing feature 2017-02-13 22:27:03 -05:00
blitzman
97cdd751b8 Fix up the CREST server thread to make it a bit more robust, as well as fixing issue in which thread may never die 2017-02-13 21:56:12 -05:00
blitzman
c9c29da803 Avoid fit recalc when setting state has no effect 2017-02-11 23:55:19 -05:00
blitzman
2527fe2e1e Fix the fix for the crash in OS X 2017-02-11 22:20:32 -05:00
blitzman
a4de0f2b5b Fix crash in OS X 2017-02-11 22:10:53 -05:00
blitzman
401d0d58d5 Merge branch 'development' 2017-02-11 21:42:48 -05:00
Ryan Holmes
beed414429 Merge pull request #984 from Ebag333/FixToxIssues
Tox fixes, and catching a few things lost in the merge.
2017-02-11 13:01:33 -05:00
Ryan Holmes
99b2fdefcc Merge pull request #985 from Ebag333/Travis_Icon
Add Travis Icon
2017-02-11 12:59:21 -05:00
Ebag333
9ec6a829c2 Revert the revert of the revert.....or something. 2017-02-11 09:47:23 -08:00
Ebag333
913f70b24d Fix copy/pasta 2017-02-11 09:41:26 -08:00
Ebag333
5a4d68684e Add Travis Icon 2017-02-11 09:38:10 -08:00
Ebag333
096842de44 Tox fixes, and catching a few things lost in the merge. 2017-02-11 09:23:23 -08:00
blitzman
81e5b33bc9 Few tweaks for price system selection 2017-02-11 11:36:53 -05:00
blitzman
5c91f29efb Merge branch 'price-system-selection' of git://github.com/petosorus/Pyfa into petosorus-price-system-selection
Conflicts:
	gui/builtinPreferenceViews/pyfaGeneralPreferences.py
	gui/builtinStatsViews/priceViewFull.py
	service/fit.py
	service/price.py
2017-02-11 11:36:35 -05:00
blitzman
bfcb73f344 Fixes for #952 2017-02-11 11:12:10 -05:00
blitzman
a2ca5eb8a4 fix oops 2017-02-11 11:01:39 -05:00
blitzman
f34e564ccd Merge branch 'MatPlotLib' of https://github.com/Ebag333/Pyfa into Ebag333-MatPlotLib
Conflicts:
	gui/graphFrame.py
2017-02-11 10:53:24 -05:00
blitzman
0cba428c81 Merge branch 'master' of https://github.com/pyfa-org/Pyfa 2017-02-11 10:48:11 -05:00
blitzman
423a433e16 Merge branch 'SorryNotSorryBlitzmann' into development 2017-02-11 10:47:22 -05:00
blitzman
bdee8f662c Merge remote-tracking branch 'ebag/SorryNotSorryBlitzmann' into SorryNotSorryBlitzmann 2017-02-11 10:46:59 -05:00
blitzman
62bb550afd Add shortcut indication for fitting search tooltip 2017-02-11 10:15:01 -05:00
Ebag333
3562577521 Tox fix, and catch an extra shadowing 2017-02-10 12:06:23 -08:00
Ebag333
8c7682c6d4 Little more OCD on cleaning up imports. 2017-02-10 12:02:23 -08:00
Ebag333
2b45a16872 Refactor most of the shadowing from outer scopes. This is a super simple change, just changing the variable used inside (mostly) lambdas. 2017-02-10 11:50:04 -08:00
Ebag333
73cc17ce72 Clean up some more import statements 2017-02-10 11:29:52 -08:00
Ebag333
07a2020303 Don't try and import an old version and then fail back to the 2.7 version. Just do the 2.7 version. :) 2017-02-10 11:22:06 -08:00
Ebag333
0fc45ead6e Catch missing import 2017-02-10 11:16:51 -08:00
Ebag333
6b37e2c973 More clean handling of possibly missing attributes. Thanks @blitzmann! 2017-02-10 10:09:11 -08:00
Ebag333
cdabd83afe Remove old init 2017-02-10 07:19:33 -08:00
Ebag333
f610f525ba Use getattr directly, insead of doing a check then setting it (yay for defaults) 2017-02-10 06:44:40 -08:00
Ebag333
514f927a56 Revert removing call. This class likely needs to be callable. 2017-02-10 05:50:32 -08:00
Ebag333
3c641606da Revert until we actually get a Linux developer. 2017-02-10 05:41:06 -08:00
blitzman
af44d878d1 tweak 2017-02-10 00:57:53 -05:00
blitzman
72ebafe925 Remove redundant init 2017-02-10 00:37:45 -05:00
blitzman
134365c764 Reverts commit de87c9, and instead uses the mod variable to access the method needed.
Conflicts:
	service/fit.py
2017-02-10 00:29:40 -05:00
petosorus
b6871c72ca Merge remote-tracking branch 'origin/price-system-selection' into price-system-selection
# Conflicts:
#	gui/builtinStatsViews/priceViewFull.py
2017-02-09 23:33:14 +01:00
petosorus
aaece725aa Saving price system preference 2017-02-09 23:26:31 +01:00
Ryan Holmes
ef6da6a96b Merge pull request #981 from Ebag333/FixCommandBurstType
Fix command burst typo for target painters
2017-02-09 17:22:10 -05:00
Ebag333
df9daf9b4b Fix typo 2017-02-09 14:08:55 -08:00
Ebag333
228425fdb9 Cast to int so we can compare 2017-02-09 14:07:37 -08:00
Ebag333
9775d1064e Move import code down into class init 2017-02-09 13:27:54 -08:00
Ebag333
1a9591d411 pyCharm inspection and code style 2017-02-09 10:56:26 -08:00
Ebag333
64070a0798 Revert commit 7865219164 This causes too much grief as we are getting a lot of default values from the database. These *SHOULD* be defined, but will have to be done later. 2017-02-09 09:36:16 -08:00
petosorus
bfa772609a Transfer of the price dropbox in the preferences pane.
Moving of the modules list compiling from priceview to price service.
2017-02-09 18:27:26 +01:00
petosorus
d15acf89ba refresh modules price view 2017-02-09 18:27:26 +01:00
petosorus
d25673b8fe Price listing price panel 2017-02-09 18:27:26 +01:00
Ebag333
dd9924a7a7 Fix issues where we assume something can exist when it may not. 2017-02-09 07:22:09 -08:00
Ebag333
0f00b7237a Another classic class conversion 2017-02-09 01:02:55 -08:00
Ebag333
579a13da44 Tox fixes 2017-02-09 00:59:22 -08:00
Ebag333
7865219164 Add a ton of default values 2017-02-09 00:56:33 -08:00
Ebag333
f2c84692a9 Clean up a bunch of unused variables 2017-02-09 00:22:14 -08:00
Ebag333
f61aeb8285 Fix bug where the toggle button the compare pane didn't do anything. (Need to check toggleView because you can hit both first and second if otherwise.) 2017-02-09 00:18:19 -08:00
Ebag333
11d7f9d029 Make modules static if they do not use self. 2017-02-09 00:04:41 -08:00
Ebag333
72633825cf Formatting and layout changes 2017-02-08 23:32:51 -08:00
Ebag333
9a137bb158 Convert old style classes to new 2017-02-08 23:06:39 -08:00
Ebag333
32944f4c9c More import fixes 2017-02-08 22:47:02 -08:00
Ebag333
23c6f2add5 We have two of the exact same backported file. Get rid of one. Also, handle the except if we can't import so we don't get stacktraces. (Currently the three functions affected are not used.) 2017-02-08 22:42:19 -08:00
Ebag333
e535f050c1 Disable inspection of writing to some wx properties. These do seem to get written, so it is likely pyCharm doesn't understand wx 2017-02-08 22:32:12 -08:00
Ebag333
7a2feb9152 Fix a bunch of calls to functions that pass the wrong type of parameter, the wrong number, etc. 2017-02-08 22:20:56 -08:00
Ebag333
3b91ec8c06 Move check for module state being valid out of effectHandlerHelpers and into service\fit. We can't have it there because of cyclical imports. Plus we're already checking the module state here, so makes lots of sense to merge them. 2017-02-08 21:24:24 -08:00
Ebag333
636474610b More of: Disable import inspections for wxPython, because it's not installed traditionally and we can't include it in requirements.txt 2017-02-08 20:16:58 -08:00
Ebag333
6e524de320 Disable import inspections for wxPython, because it's not installed traditionally and we can't include it in requirements.txt 2017-02-08 20:15:24 -08:00
Ebag333
3e916e42f2 pyCharm inspection fixes. Mostly variable refernce issues 2017-02-08 17:55:20 -08:00
Ebag333
de87c992d7 Remove calling es_Module from effectHandlerHelpers, this causes a circular import. Instead pass in from fit. 2017-02-08 16:50:41 -08:00
Ebag333
e5fb90f017 Fix commit message. LOTS of fixes for flake8. 2017-02-08 14:22:56 -08:00
Ebag333
e18deb5eeb Roll up #967 and #974
Takes the import fixes and cleanup out of those and rolls it into this
one
2017-02-08 13:12:54 -08:00
Ebag333
a8fd7cf2e9 Matplotlib 2.0 support 2017-02-08 12:50:42 -08:00
Ryan Holmes
25182de365 Merge branch 'master' into development
Conflicts:
	gui/builtinViewColumns/baseName.py
2017-02-08 13:58:37 -05:00
Ryan Holmes
c90efb8d0a Fix emAmount > {type}Amount, some formatting tweaks 2017-02-08 09:41:59 -05:00
Ebag333
7a521c655f Wrap dlg.Destroy() in a Try/Except
Conflicts:
	gui/mainFrame.py
2017-02-08 00:15:02 -05:00
blitzman
8a9d2a032e Revert the try... except, see #960 2017-02-08 00:00:16 -05:00
Ryan Holmes
b1b3ff2637 Merge pull request #960 from Ebag333/Fueled_Booster_Misc_Column_Improvements
Add extra info for misc column for fueled boosters (cap, shield, and armor)
2017-02-07 23:59:07 -05:00
Ryan Holmes
752f9e77f5 Merge pull request #971 from Ebag333/ToxFixes2
Some additional Tox tweaks
2017-02-07 23:28:42 -05:00
blitzman
e52db0b2f5 Merge branch 'AncientDatabaseRepair' of https://github.com/Ebag333/Pyfa
Conflicts:
	service/prefetch.py
2017-02-07 23:26:06 -05:00
blitzman
ce9069af4a Fix projected fit view not showing projected fit count 2017-02-07 20:11:02 -05:00
blitzman
31d74730c5 Add matplotlib version to about window 2017-02-07 19:44:59 -05:00
blitzman
84867c6e67 fix oops 2017-02-07 19:22:31 -05:00
blitzman
f7d7b3fe5e Merge branch 'EosImportCleanup' of https://github.com/Ebag333/Pyfa into development
Conflicts:
	eos/db/gamedata/metaData.py
	eos/db/gamedata/queries.py
	eos/db/saveddata/queries.py
	eos/saveddata/fleet.py
	eos/types.py
	eve.db
	gui/builtinContextMenus/amount.py
	gui/builtinViewColumns/ammo.py
	gui/builtinViewColumns/ammoIcon.py
	gui/builtinViewColumns/capacitorUse.py
	service/port.py
2017-02-07 19:22:26 -05:00
blitzman
f957c42e26 Merge branch 'development' 2017-02-07 19:08:10 -05:00
blitzman
ca311e5dec Line endings again 2017-02-07 19:07:22 -05:00
blitzman
3ccd4ad2ca Revert "Convert remaining files to CRLF"
This reverts commit a8ab876053.
2017-02-07 19:05:45 -05:00
blitzman
867fb30286 Merge remote-tracking branch 'origin/development' 2017-02-07 19:00:10 -05:00
Ryan Holmes
a8ab876053 Convert remaining files to CRLF 2017-02-07 11:01:40 -05:00
Ryan Holmes
dfc5627031 Remove circular import mainFrame <> mainMenuBar 2017-02-07 09:37:20 -05:00
blitzman
542542f48d import changes to graphframe 2017-02-07 00:33:15 -05:00
blitzman
5fda29e651 Merge branch 'master' of https://github.com/pyfa-org/Pyfa into development 2017-02-07 00:32:52 -05:00
blitzman
c25a07c95b Stuff 2017-02-07 00:32:45 -05:00
Ebag333
aafc850dbd Adhere to standards 2017-02-05 20:09:00 -08:00
Ryan Holmes
41ae8de99b Merge pull request #970 from Ebag333/ToxFixes
Tox fixes
2017-02-05 22:24:55 -05:00
Ebag333
808f070df4 Redisable dynamic import test until eos.types is gone 2017-02-05 16:28:16 -08:00
Ebag333
e4cd66be5c Add root to python paths 2017-02-05 16:21:07 -08:00
Ebag333
a638e991af Disable test 2017-02-05 16:05:56 -08:00
Ebag333
d67dbaa0ae .gitattributes fixing line endings 2017-02-05 15:39:23 -08:00
Ebag333
be66ff1eec Tox fixes 2017-02-05 15:39:07 -08:00
Ryan Holmes
603a8acdfc Update ISSUE_TEMPLATE.md 2017-02-05 17:57:18 -05:00
blitzman
86393d728f I can't get these files out of "modified". Just commit them to get them out of the way. 2017-02-05 17:56:36 -05:00
blitzman
e564e051a3 tweaks to issue template 2017-02-05 17:55:54 -05:00
blitzman
2ade7dc632 Add issue template 2017-02-05 17:45:35 -05:00
blitzman
a938845aa2 Remove weird file... I have no idea what this is... 2017-02-05 17:16:23 -05:00
blitzman
ba2205867e Test line endings with pyfa.py (see #964) 2017-02-05 17:12:45 -05:00
blitzman
d7ec04f995 test change to .gitattributes to specifically tell pyfa.py to save with LF line endings 2017-02-05 17:08:11 -05:00
blitzman
91baabd1b3 update database 2017-02-05 17:00:10 -05:00
blitzman
c3fdabd3a2 Merge branch 'development' 2017-02-05 16:52:27 -05:00
Ebag333
32611e07c8 Fix syntax. Catch scenarios where none can be passed. 2017-01-29 10:12:16 -08:00
Ebag333
dd3316a1c2 Gets the multiplier bonus from the item rather than hard coding it to 3 2017-01-29 00:28:20 -08:00
Ebag333
1ebd54b282 Wrap getting attribute data in a try/except
Useful for when we try to get an sub-attribute on an object where the
attribute doesn't exist. Now returns the default value.
2017-01-29 00:27:45 -08:00
Ebag333
e524197a4d Revert "wrap getting attribute in at try/except"
This reverts commit f111c49cc6.
2017-01-29 00:25:55 -08:00
Ebag333
f111c49cc6 wrap getting attribute in at try/except
Catches if there's an attribute error.  Useful when we try and get an
attribute when the object doesn't even have it.
2017-01-29 00:25:42 -08:00
Ebag333
c567ee2c08 Clean up logic and generally make purdier 2017-01-29 00:16:32 -08:00
Ebag333
1a0ac7bb35 Allow default values to be passed in for modified attributes 2017-01-29 00:16:15 -08:00
Ebag333
34c69cf10f Some pep8 stuff 2017-01-28 21:56:03 -08:00
Ebag333
88125634d2 Add extra info for misc column for fueled boosters 2017-01-28 21:47:58 -08:00
Ebag333
200023234c Give modules the special snowflake experience
Modules can legitimately have a null item value.  So don't catch null or
'', only 0's (which would be an invalid item ID).
2017-01-27 14:49:30 -08:00
Ebag333
fc99d6f0a6 catch duplicate selected ammo 2017-01-27 13:46:20 -08:00
Ebag333
e6b4ecdaf7 Additional cleanup for orphaned records 2017-01-27 13:37:51 -08:00
Ebag333
3c31391ec9 Burn types with fire 2017-01-09 22:36:19 -08:00
petosorus
9df54238d9 refresh modules price view 2017-01-05 00:18:20 +01:00
petosorus
fcd934319d Price listing price panel 2017-01-05 00:18:20 +01:00
petosorus
48ccc7ff06 System list 2017-01-05 00:18:17 +01:00
petosorus
edc48f0017 beginnings of price system choice 2017-01-05 00:17:56 +01:00
tgraviou
2f2800c360 System list 2016-11-24 12:00:53 +01:00
tgraviou
7eb3ad98fa beginnings of price system choice 2016-11-21 17:38:28 +01:00
264 changed files with 2821 additions and 2388 deletions

2
.gitattributes vendored
View File

@@ -14,7 +14,7 @@
*.py3 text eol=crlf *.py3 text eol=crlf
*.pyw text eol=crlf *.pyw text eol=crlf
*.pyx text eol=crlf *.pyx text eol=crlf
pyfa.py text eol=lf
# Denote all files that are truly binary and should not be modified. # Denote all files that are truly binary and should not be modified.
# Binary files # Binary files

32
ISSUE_TEMPLATE.md Normal file
View File

@@ -0,0 +1,32 @@
# Submit a bug report bug report or feature request
Here you can inform pyfa developers of potential bugs or suggest features / improvements to the project. Please check
to make sure that the bug hasn't been reported or feature requested before submitting. If you have general questions
about the project and want to reach out to the developers personally, please check out out our [Slack]
(https://pyfainvite.azurewebsites.net/).
---
## Bug Report
### Expected behavior:
### Actual behavior:
### Detailed steps to reproduce:
### Fits involved in EFT format (Edit > To Clipboard > EFT):
### Release or development git branch? Please note the release version or commit hash:
### Operating system and version (eg: Windows 10, OS X 10.9, OS X 10.11, Ubuntu 16.10):
### Other relevant information:

View File

@@ -1,6 +1,6 @@
# pyfa # pyfa
[![Join us on Slack!](https://pyfainvite.azurewebsites.net/badge.svg)](https://pyfainvite.azurewebsites.net/) [![Join us on Slack!](https://pyfainvite.azurewebsites.net/badge.svg)](https://pyfainvite.azurewebsites.net/) [![Build Status](https://travis-ci.org/pyfa-org/Pyfa.svg?branch=master)](https://travis-ci.org/pyfa-org/Pyfa)
![pyfa](https://cloud.githubusercontent.com/assets/3904767/10271512/af385ef2-6ade-11e5-8f67-52b8b1e4c797.PNG) ![pyfa](https://cloud.githubusercontent.com/assets/3904767/10271512/af385ef2-6ade-11e5-8f67-52b8b1e4c797.PNG)

View File

@@ -0,0 +1,13 @@
<code_scheme name="Pyfa">
<option name="LINE_SEPARATOR" value="&#xD;&#xA;" />
<option name="RIGHT_MARGIN" value="165" />
<Python>
<option name="NEW_LINE_AFTER_COLON" value="true" />
<option name="DICT_ALIGNMENT" value="2" />
<option name="DICT_NEW_LINE_AFTER_LEFT_BRACE" value="true" />
<option name="DICT_NEW_LINE_BEFORE_RIGHT_BRACE" value="true" />
<option name="USE_CONTINUATION_INDENT_FOR_ARGUMENTS" value="true" />
<option name="OPTIMIZE_IMPORTS_SORT_NAMES_IN_FROM_IMPORTS" value="true" />
<option name="OPTIMIZE_IMPORTS_JOIN_FROM_IMPORTS_WITH_SAME_SOURCE" value="true" />
</Python>
</code_scheme>

View File

@@ -0,0 +1,54 @@
<profile version="1.0">
<option name="myName" value="Pyfa" />
<inspection_tool class="IgnoreUnusedEntry" enabled="false" level="UNUSED ENTRY" enabled_by_default="false" />
<inspection_tool class="InconsistentLineSeparators" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ProblematicWhitespace" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyBehaveInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyClassicStyleClassInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ourVersions">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="2.7" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyMissingTypeHintsInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="wxPython" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyPep8Inspection" enabled="true" level="TYPO" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="E203" />
<option value="E127" />
<option value="E128" />
<option value="E126" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="TYPO" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N802" />
<option value="N806" />
<option value="N803" />
<option value="N814" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyShadowingBuiltinsInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyShadowingNamesInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
</profile>

View File

@@ -18,9 +18,9 @@ debug = False
saveInRoot = False saveInRoot = False
# Version data # Version data
version = "1.26.1" version = "1.27.0"
tag = "git" tag = "Stable"
expansionName = "YC118.10" expansionName = "YC119.2"
expansionVersion = "1.2" expansionVersion = "1.2"
evemonMinVersion = "4081" evemonMinVersion = "4081"

View File

@@ -1,8 +1,2 @@
version = "0.2.3" version = "0.2.3"
tag = "git" tag = "git"
def test():
import tests.runTests
import unittest
unittest.main(defaultTest="discover", testLoader=tests.runTests.loader)

View File

@@ -20,10 +20,7 @@
import threading import threading
from sqlalchemy import MetaData, create_engine from sqlalchemy import MetaData, create_engine
from sqlalchemy.orm import sessionmaker, scoped_session from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import pool
import migration import migration
from eos import config from eos import config
@@ -62,16 +59,22 @@ if saveddata_connectionstring is not None:
saveddata_meta = MetaData() saveddata_meta = MetaData()
saveddata_meta.bind = saveddata_engine saveddata_meta.bind = saveddata_engine
saveddata_session = sessionmaker(bind=saveddata_engine, autoflush=False, expire_on_commit=False)() saveddata_session = sessionmaker(bind=saveddata_engine, autoflush=False, expire_on_commit=False)()
else:
saveddata_meta = None
# Lock controlling any changes introduced to session # Lock controlling any changes introduced to session
sd_lock = threading.Lock() sd_lock = threading.Lock()
# Import all the definitions for all our database stuff # Import all the definitions for all our database stuff
from eos.db.gamedata import * # noinspection PyPep8
from eos.db.saveddata import * from eos.db.gamedata import alphaClones, attribute, category, effect, group, icon, item, marketGroup, metaData, metaGroup, queries, traits, unit
# noinspection PyPep8
from eos.db.saveddata import booster, cargo, character, crest, damagePattern, databaseRepair, drone, fighter, fit, implant, implantSet, loadDefaultDatabaseValues, miscData, module, override, price, queries, skill, targetResists, user
# Import queries # Import queries
# noinspection PyPep8
from eos.db.gamedata.queries import * from eos.db.gamedata.queries import *
# noinspection PyPep8
from eos.db.saveddata.queries import * from eos.db.saveddata.queries import *
# If using in memory saveddata, you'll want to reflect it so the data structure is good. # If using in memory saveddata, you'll want to reflect it so the data structure is good.

View File

@@ -21,18 +21,22 @@ from sqlalchemy import Column, String, Integer, Table, ForeignKey
from sqlalchemy.orm import relation, mapper, synonym from sqlalchemy.orm import relation, mapper, synonym
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import AlphaClone, AlphaCloneSkill from eos.gamedata import AlphaClone, AlphaCloneSkill
alphaclones_table = Table("alphaClones", gamedata_meta, alphaclones_table = Table(
Column("alphaCloneID", Integer, primary_key=True), "alphaClones",
Column("alphaCloneName", String), gamedata_meta,
) Column("alphaCloneID", Integer, primary_key=True),
Column("alphaCloneName", String),
)
alphacloneskskills_table = Table("alphaCloneSkills", gamedata_meta, alphacloneskskills_table = Table(
Column("alphaCloneID", Integer, ForeignKey("alphaClones.alphaCloneID"), primary_key=True), "alphaCloneSkills",
Column("typeID", Integer, primary_key=True), gamedata_meta,
Column("level", Integer), Column("alphaCloneID", Integer, ForeignKey("alphaClones.alphaCloneID"), primary_key=True),
) Column("typeID", Integer, primary_key=True),
Column("level", Integer),
)
mapper(AlphaClone, alphaclones_table, mapper(AlphaClone, alphaclones_table,
properties={ properties={

View File

@@ -22,7 +22,7 @@ from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import relation, mapper, synonym, deferred from sqlalchemy.orm import relation, mapper, synonym, deferred
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import Attribute, Icon, AttributeInfo, Unit from eos.gamedata import Attribute, AttributeInfo, Unit, Icon
typeattributes_table = Table("dgmtypeattribs", gamedata_meta, typeattributes_table = Table("dgmtypeattribs", gamedata_meta,
Column("value", Float), Column("value", Float),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Column, String, Integer, ForeignKey, Boolean, Table
from sqlalchemy.orm import relation, mapper, synonym, deferred from sqlalchemy.orm import relation, mapper, synonym, deferred
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import Category, Icon from eos.gamedata import Category, Icon
categories_table = Table("invcategories", gamedata_meta, categories_table = Table("invcategories", gamedata_meta,
Column("categoryID", Integer, primary_key=True), Column("categoryID", Integer, primary_key=True),

View File

@@ -22,7 +22,7 @@ from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import mapper, synonym, relation, deferred from sqlalchemy.orm import mapper, synonym, relation, deferred
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import Effect, EffectInfo from eos.gamedata import Effect, EffectInfo
typeeffects_table = Table("dgmtypeeffects", gamedata_meta, typeeffects_table = Table("dgmtypeeffects", gamedata_meta,
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True, index=True), Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True, index=True),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Column, String, Integer, Boolean, ForeignKey, Table
from sqlalchemy.orm import relation, mapper, synonym, deferred from sqlalchemy.orm import relation, mapper, synonym, deferred
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import Group, Icon, Category from eos.gamedata import Category, Group, Icon
groups_table = Table("invgroups", gamedata_meta, groups_table = Table("invgroups", gamedata_meta,
Column("groupID", Integer, primary_key=True), Column("groupID", Integer, primary_key=True),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Column, String, Integer, Table
from sqlalchemy.orm import mapper, synonym, deferred from sqlalchemy.orm import mapper, synonym, deferred
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import Icon from eos.gamedata import Icon
icons_table = Table("icons", gamedata_meta, icons_table = Table("icons", gamedata_meta,
Column("iconID", Integer, primary_key=True), Column("iconID", Integer, primary_key=True),

View File

@@ -23,7 +23,7 @@ from sqlalchemy.orm import relation, mapper, synonym, deferred
from sqlalchemy.orm.collections import attribute_mapped_collection from sqlalchemy.orm.collections import attribute_mapped_collection
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import Icon, Attribute, Item, Effect, MetaType, Group, Traits from eos.gamedata import Attribute, Effect, Group, Icon, Item, MetaType, Traits
items_table = Table("invtypes", gamedata_meta, items_table = Table("invtypes", gamedata_meta,
Column("typeID", Integer, primary_key=True), Column("typeID", Integer, primary_key=True),
@@ -39,8 +39,8 @@ items_table = Table("invtypes", gamedata_meta,
Column("iconID", Integer, ForeignKey("icons.iconID")), Column("iconID", Integer, ForeignKey("icons.iconID")),
Column("groupID", Integer, ForeignKey("invgroups.groupID"), index=True)) Column("groupID", Integer, ForeignKey("invgroups.groupID"), index=True))
from .metaGroup import metatypes_table # noqa from .metaGroup import metatypes_table # noqa
from .traits import traits_table # noqa from .traits import traits_table # noqa
mapper(Item, items_table, mapper(Item, items_table,
properties={"group": relation(Group, backref="items"), properties={"group": relation(Group, backref="items"),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Column, String, Integer, Boolean, ForeignKey, Table
from sqlalchemy.orm import relation, mapper, synonym, deferred from sqlalchemy.orm import relation, mapper, synonym, deferred
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import Item, MarketGroup, Icon from eos.gamedata import Icon, Item, MarketGroup
marketgroups_table = Table("invmarketgroups", gamedata_meta, marketgroups_table = Table("invmarketgroups", gamedata_meta,
Column("marketGroupID", Integer, primary_key=True), Column("marketGroupID", Integer, primary_key=True),

View File

@@ -1,30 +1,30 @@
# =============================================================================== # ===============================================================================
# Copyright (C) 2010 Diego Duclos # Copyright (C) 2010 Diego Duclos
# #
# This file is part of eos. # This file is part of eos.
# #
# eos is free software: you can redistribute it and/or modify # eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by # it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 2 of the License, or # the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# eos is distributed in the hope that it will be useful, # eos is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details. # GNU Lesser General Public License for more details.
# #
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with eos. If not, see <http://www.gnu.org/licenses/>. # along with eos. If not, see <http://www.gnu.org/licenses/>.
# =============================================================================== # ===============================================================================
from sqlalchemy import Column, Table, String from sqlalchemy import Column, Table, String
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import MetaData from eos.gamedata import MetaData
metadata_table = Table("metadata", gamedata_meta, metadata_table = Table("metadata", gamedata_meta,
Column("field_name", String, primary_key=True), Column("field_name", String, primary_key=True),
Column("field_value", String)) Column("field_value", String))
mapper(MetaData, metadata_table) mapper(MetaData, metadata_table)

View File

@@ -23,7 +23,7 @@ from sqlalchemy.orm import relation, mapper, synonym
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.db.gamedata.item import items_table from eos.db.gamedata.item import items_table
from eos.types import MetaGroup, Item, MetaType from eos.gamedata import Item, MetaGroup, MetaType
metagroups_table = Table("invmetagroups", gamedata_meta, metagroups_table = Table("invmetagroups", gamedata_meta,
Column("metaGroupID", Integer, primary_key=True), Column("metaGroupID", Integer, primary_key=True),

View File

@@ -21,13 +21,10 @@ from sqlalchemy.orm import join, exc
from sqlalchemy.sql import and_, or_, select from sqlalchemy.sql import and_, or_, select
import eos.config import eos.config
# TODO: Unsure which item the code below needs :(
# from eos.gamedata import Item
from eos.gamedata import Attribute
from eos.db import gamedata_session from eos.db import gamedata_session
from eos.db.gamedata.metaGroup import metatypes_table, items_table from eos.db.gamedata.metaGroup import metatypes_table, items_table
from eos.db.util import processEager, processWhere from eos.db.util import processEager, processWhere
from eos.types import Item, Category, Group, MarketGroup, AttributeInfo, MetaData, MetaGroup, AlphaClone from eos.gamedata import AlphaClone, Attribute, Category, Group, Item, MarketGroup, MetaGroup, AttributeInfo, MetaData
configVal = getattr(eos.config, "gamedataCache", None) configVal = getattr(eos.config, "gamedataCache", None)
if configVal is True: if configVal is True:

View File

@@ -2,7 +2,7 @@ from sqlalchemy import Column, Table, Integer, String, ForeignKey
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import Traits from eos.gamedata import Traits
traits_table = Table("invtraits", gamedata_meta, traits_table = Table("invtraits", gamedata_meta,
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True), Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Column, Table, Integer, String
from sqlalchemy.orm import mapper, synonym from sqlalchemy.orm import mapper, synonym
from eos.db import gamedata_meta from eos.db import gamedata_meta
from eos.types import Unit from eos.gamedata import Unit
groups_table = Table("dgmunits", gamedata_meta, groups_table = Table("dgmunits", gamedata_meta,
Column("unitID", Integer, primary_key=True), Column("unitID", Integer, primary_key=True),

View File

@@ -4,8 +4,6 @@ Migration 15
- Delete projected modules on citadels - Delete projected modules on citadels
""" """
import sqlalchemy
def upgrade(saveddata_engine): def upgrade(saveddata_engine):
sql = """ sql = """

View File

@@ -4,8 +4,6 @@ Migration 17
- Moves all fleet boosters to the new schema - Moves all fleet boosters to the new schema
""" """
import sqlalchemy
def upgrade(saveddata_engine): def upgrade(saveddata_engine):
from eos.db import saveddata_session from eos.db import saveddata_session

View File

@@ -4,8 +4,6 @@ Migration 19
- Deletes broken references to fits from the commandFits table (see GH issue #844) - Deletes broken references to fits from the commandFits table (see GH issue #844)
""" """
import sqlalchemy
def upgrade(saveddata_engine): def upgrade(saveddata_engine):
from eos.db import saveddata_session from eos.db import saveddata_session

View File

@@ -0,0 +1,10 @@
"""
Migration 21
- Fixes discrepancy in drone table where we may have an amount active that is not equal to the amount in the stack
(we don't support activating only 2/5 drones). See GH issue #728
"""
def upgrade(saveddata_engine):
saveddata_engine.execute("UPDATE drones SET amountActive = amount where amountActive > 0 AND amountActive <> amount;")

View File

@@ -22,7 +22,7 @@ from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import mapper, relation from sqlalchemy.orm import mapper, relation
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import Booster from eos.saveddata.booster import Booster
boosters_table = Table("boosters", saveddata_meta, boosters_table = Table("boosters", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Table, Column, Integer, ForeignKey
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import Cargo from eos.saveddata.cargo import Cargo
cargo_table = Table("cargo", saveddata_meta, cargo_table = Table("cargo", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),

View File

@@ -23,7 +23,9 @@ from sqlalchemy.orm import relation, mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.db.saveddata.implant import charImplants_table from eos.db.saveddata.implant import charImplants_table
from eos.effectHandlerHelpers import HandledImplantBoosterList from eos.effectHandlerHelpers import HandledImplantBoosterList
from eos.types import Character, User, Skill, Implant from eos.saveddata.implant import Implant
from eos.saveddata.user import User
from eos.saveddata.character import Character, Skill
characters_table = Table("characters", saveddata_meta, characters_table = Table("characters", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Table, Column, Integer, String
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import CrestChar from eos.saveddata.crestchar import CrestChar
crest_table = Table("crest", saveddata_meta, crest_table = Table("crest", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Table, Column, Integer, ForeignKey, String
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import DamagePattern from eos.saveddata.damagePattern import DamagePattern
damagePatterns_table = Table("damagePatterns", saveddata_meta, damagePatterns_table = Table("damagePatterns", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),

View File

@@ -17,13 +17,13 @@
# along with pyfa. If not, see <http://www.gnu.org/licenses/>. # along with pyfa. If not, see <http://www.gnu.org/licenses/>.
# =============================================================================== # ===============================================================================
import sqlalchemy from sqlalchemy.exc import DatabaseError
import logging import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class DatabaseCleanup: class DatabaseCleanup(object):
def __init__(self): def __init__(self):
pass pass
@@ -32,8 +32,8 @@ class DatabaseCleanup:
try: try:
results = saveddata_engine.execute(query) results = saveddata_engine.execute(query)
return results return results
except sqlalchemy.exc.DatabaseError: except DatabaseError:
logger.error("Failed to connect to database or error executing query:\n%s",query) logger.error("Failed to connect to database or error executing query:\n%s", query)
return None return None
@staticmethod @staticmethod
@@ -85,8 +85,8 @@ class DatabaseCleanup:
logger.error("More than one uniform damage pattern found.") logger.error("More than one uniform damage pattern found.")
else: else:
uniform_damage_pattern_id = rows[0]['ID'] uniform_damage_pattern_id = rows[0]['ID']
update_query = "UPDATE 'fits' SET 'damagePatternID' = " + str(uniform_damage_pattern_id) + \ update_query = "UPDATE 'fits' SET 'damagePatternID' = {} " \
" WHERE damagePatternID NOT IN (SELECT ID FROM damagePatterns) OR damagePatternID IS NULL" "WHERE damagePatternID NOT IN (SELECT ID FROM damagePatterns) OR damagePatternID IS NULL".format(uniform_damage_pattern_id)
update_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, update_query) update_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, update_query)
logger.error("Database corruption found. Cleaning up %d records.", update_results.rowcount) logger.error("Database corruption found. Cleaning up %d records.", update_results.rowcount)
@@ -118,7 +118,7 @@ class DatabaseCleanup:
logger.error("More than one 'All 5' character found.") logger.error("More than one 'All 5' character found.")
else: else:
all5_id = rows[0]['ID'] all5_id = rows[0]['ID']
update_query = "UPDATE 'fits' SET 'characterID' = " + str(all5_id) + \ update_query = "UPDATE 'fits' SET 'characterID' = " + str(all5_id) + \
" WHERE characterID not in (select ID from characters) OR characterID IS NULL" " WHERE characterID not in (select ID from characters) OR characterID IS NULL"
update_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, update_query) update_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, update_query)
logger.error("Database corruption found. Cleaning up %d records.", update_results.rowcount) logger.error("Database corruption found. Cleaning up %d records.", update_results.rowcount)
@@ -160,3 +160,80 @@ class DatabaseCleanup:
query = "DELETE FROM targetResists WHERE name IS NULL OR name = ''" query = "DELETE FROM targetResists WHERE name IS NULL OR name = ''"
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query) delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
logger.error("Database corruption found. Cleaning up %d records.", delete.rowcount) logger.error("Database corruption found. Cleaning up %d records.", delete.rowcount)
@staticmethod
def OrphanedFitIDItemID(saveddata_engine):
# Orphaned items that are missing the fit ID or item ID.
# See issue #954
for table in ['drones', 'cargo', 'fighters']:
logger.debug("Running database cleanup for orphaned %s items.", table)
query = "SELECT COUNT(*) AS num FROM {} WHERE itemID IS NULL OR itemID = '' or itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(
table)
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
if results is None:
return
row = results.first()
if row and row['num']:
query = "DELETE FROM {} WHERE itemID IS NULL OR itemID = '' or itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(
table)
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
logger.error("Database corruption found. Cleaning up %d records.", delete.rowcount)
for table in ['modules']:
logger.debug("Running database cleanup for orphaned %s items.", table)
query = "SELECT COUNT(*) AS num FROM {} WHERE itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(
table)
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
if results is None:
return
row = results.first()
if row and row['num']:
query = "DELETE FROM {} WHERE itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(table)
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
logger.error("Database corruption found. Cleaning up %d records.", delete.rowcount)
@staticmethod
def NullDamageTargetPatternValues(saveddata_engine):
# Find patterns that have null values
# See issue #954
for profileType in ['damagePatterns', 'targetResists']:
for damageType in ['em', 'thermal', 'kinetic', 'explosive']:
logger.debug("Running database cleanup for null %s values. (%s)", profileType, damageType)
query = "SELECT COUNT(*) AS num FROM {0} WHERE {1}Amount IS NULL OR {1}Amount = ''".format(profileType,
damageType)
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
if results is None:
return
row = results.first()
if row and row['num']:
query = "UPDATE '{0}' SET '{1}Amount' = '0' WHERE {1}Amount IS NULL OR Amount = ''".format(profileType,
damageType)
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
logger.error("Database corruption found. Cleaning up %d records.", delete.rowcount)
@staticmethod
def DuplicateSelectedAmmoName(saveddata_engine):
# Orphaned items that are missing the fit ID or item ID.
# See issue #954
logger.debug("Running database cleanup for duplicated selected ammo profiles.")
query = "SELECT COUNT(*) AS num FROM damagePatterns WHERE name = 'Selected Ammo'"
results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
if results is None:
return
row = results.first()
if row and row['num'] > 1:
query = "DELETE FROM damagePatterns WHERE name = 'Selected Ammo'"
delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
logger.error("Database corruption found. Cleaning up %d records.", delete.rowcount)

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import Drone from eos.saveddata.drone import Drone
drones_table = Table("drones", saveddata_meta, drones_table = Table("drones", saveddata_meta,
Column("groupID", Integer, primary_key=True), Column("groupID", Integer, primary_key=True),

View File

@@ -21,8 +21,9 @@ from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean
from sqlalchemy.orm import mapper, relation from sqlalchemy.orm import mapper, relation
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import Fighter, Fit from eos.saveddata.fighterAbility import FighterAbility
from eos.types import FighterAbility from eos.saveddata.fighter import Fighter
from eos.saveddata.fit import Fit
fighters_table = Table("fighters", saveddata_meta, fighters_table = Table("fighters", saveddata_meta,
Column("groupID", Integer, primary_key=True), Column("groupID", Integer, primary_key=True),

View File

@@ -32,8 +32,17 @@ from eos.db.saveddata.implant import fitImplants_table
from eos.db.saveddata.module import modules_table from eos.db.saveddata.module import modules_table
from eos.effectHandlerHelpers import HandledModuleList, HandledImplantBoosterList, HandledProjectedModList, \ from eos.effectHandlerHelpers import HandledModuleList, HandledImplantBoosterList, HandledProjectedModList, \
HandledDroneCargoList, HandledProjectedDroneList HandledDroneCargoList, HandledProjectedDroneList
from eos.types import Fit as es_Fit, Module, User, Booster, Drone, Fighter, Cargo, Implant, Character, DamagePattern, \ from eos.saveddata.implant import Implant
TargetResists, ImplantLocation from eos.saveddata.character import Character
from eos.saveddata.user import User
from eos.saveddata.fighter import Fighter
from eos.saveddata.fit import Fit as es_Fit, ImplantLocation
from eos.saveddata.drone import Drone
from eos.saveddata.booster import Booster
from eos.saveddata.module import Module
from eos.saveddata.cargo import Cargo
from eos.saveddata.damagePattern import DamagePattern
from eos.saveddata.targetResists import TargetResists
fits_table = Table("fits", saveddata_meta, fits_table = Table("fits", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),
@@ -131,7 +140,7 @@ mapper(es_Fit, fits_table,
"_Fit__modules": relation( "_Fit__modules": relation(
Module, Module,
collection_class=HandledModuleList, collection_class=HandledModuleList,
primaryjoin=and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == False), # noqa primaryjoin=and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == False), # noqa
order_by=modules_table.c.position, order_by=modules_table.c.position,
cascade='all, delete, delete-orphan'), cascade='all, delete, delete-orphan'),
"_Fit__projectedModules": relation( "_Fit__projectedModules": relation(
@@ -139,7 +148,7 @@ mapper(es_Fit, fits_table,
collection_class=HandledProjectedModList, collection_class=HandledProjectedModList,
cascade='all, delete, delete-orphan', cascade='all, delete, delete-orphan',
single_parent=True, single_parent=True,
primaryjoin=and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == True)), # noqa primaryjoin=and_(modules_table.c.fitID == fits_table.c.ID, modules_table.c.projected == True)), # noqa
"owner": relation( "owner": relation(
User, User,
backref="fits"), backref="fits"),
@@ -155,13 +164,13 @@ mapper(es_Fit, fits_table,
collection_class=HandledDroneCargoList, collection_class=HandledDroneCargoList,
cascade='all, delete, delete-orphan', cascade='all, delete, delete-orphan',
single_parent=True, single_parent=True,
primaryjoin=and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == False)), # noqa primaryjoin=and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == False)), # noqa
"_Fit__fighters": relation( "_Fit__fighters": relation(
Fighter, Fighter,
collection_class=HandledDroneCargoList, collection_class=HandledDroneCargoList,
cascade='all, delete, delete-orphan', cascade='all, delete, delete-orphan',
single_parent=True, single_parent=True,
primaryjoin=and_(fighters_table.c.fitID == fits_table.c.ID, fighters_table.c.projected == False)), # noqa primaryjoin=and_(fighters_table.c.fitID == fits_table.c.ID, fighters_table.c.projected == False)), # noqa
"_Fit__cargo": relation( "_Fit__cargo": relation(
Cargo, Cargo,
collection_class=HandledDroneCargoList, collection_class=HandledDroneCargoList,
@@ -173,13 +182,13 @@ mapper(es_Fit, fits_table,
collection_class=HandledProjectedDroneList, collection_class=HandledProjectedDroneList,
cascade='all, delete, delete-orphan', cascade='all, delete, delete-orphan',
single_parent=True, single_parent=True,
primaryjoin=and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == True)), # noqa primaryjoin=and_(drones_table.c.fitID == fits_table.c.ID, drones_table.c.projected == True)), # noqa
"_Fit__projectedFighters": relation( "_Fit__projectedFighters": relation(
Fighter, Fighter,
collection_class=HandledProjectedDroneList, collection_class=HandledProjectedDroneList,
cascade='all, delete, delete-orphan', cascade='all, delete, delete-orphan',
single_parent=True, single_parent=True,
primaryjoin=and_(fighters_table.c.fitID == fits_table.c.ID, fighters_table.c.projected == True)), # noqa primaryjoin=and_(fighters_table.c.fitID == fits_table.c.ID, fighters_table.c.projected == True)), # noqa
"_Fit__implants": relation( "_Fit__implants": relation(
Implant, Implant,
collection_class=HandledImplantBoosterList, collection_class=HandledImplantBoosterList,

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import Implant from eos.saveddata.implant import Implant
implants_table = Table("implants", saveddata_meta, implants_table = Table("implants", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),

View File

@@ -23,7 +23,8 @@ from sqlalchemy.orm import relation, mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.db.saveddata.implant import implantsSetMap_table from eos.db.saveddata.implant import implantsSetMap_table
from eos.effectHandlerHelpers import HandledImplantBoosterList from eos.effectHandlerHelpers import HandledImplantBoosterList
from eos.types import Implant, ImplantSet from eos.saveddata.implant import Implant
from eos.saveddata.implantSet import ImplantSet
implant_set_table = Table("implantSets", saveddata_meta, implant_set_table = Table("implantSets", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),

View File

@@ -26,7 +26,7 @@ class ImportError(Exception):
pass pass
class DefaultDatabaseValues(): class DefaultDatabaseValues(object):
def __init__(self): def __init__(self):
pass pass

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Column, Table, String
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import MiscData from eos.saveddata.miscData import MiscData
miscdata_table = Table("miscdata", saveddata_meta, miscdata_table = Table("miscdata", saveddata_meta,
Column("fieldName", String, primary_key=True), Column("fieldName", String, primary_key=True),

View File

@@ -21,7 +21,8 @@ from sqlalchemy import Table, Column, Integer, ForeignKey, CheckConstraint, Bool
from sqlalchemy.orm import relation, mapper from sqlalchemy.orm import relation, mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import Module, Fit from eos.saveddata.module import Module
from eos.saveddata.fit import Fit
modules_table = Table("modules", saveddata_meta, modules_table = Table("modules", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Table, Column, Integer, Float
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import Override from eos.saveddata.override import Override
overrides_table = Table("overrides", saveddata_meta, overrides_table = Table("overrides", saveddata_meta,
Column("itemID", Integer, primary_key=True, index=True), Column("itemID", Integer, primary_key=True, index=True),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Table, Column, Float, Integer
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import Price from eos.saveddata.price import Price
prices_table = Table("prices", saveddata_meta, prices_table = Table("prices", saveddata_meta,
Column("typeID", Integer, primary_key=True), Column("typeID", Integer, primary_key=True),

View File

@@ -22,11 +22,17 @@ from sqlalchemy.sql import and_
from eos.db import saveddata_session, sd_lock from eos.db import saveddata_session, sd_lock
from eos.db.saveddata.fit import projectedFits_table from eos.db.saveddata.fit import projectedFits_table
from eos.db.util import processEager, processWhere from eos.db.util import processEager, processWhere
from eos.db import saveddata_session, sd_lock from eos.saveddata.price import Price
from eos.saveddata.user import User
from eos.saveddata.crestchar import CrestChar
from eos.saveddata.damagePattern import DamagePattern
from eos.saveddata.targetResists import TargetResists
from eos.saveddata.character import Character
from eos.saveddata.implantSet import ImplantSet
from eos.saveddata.fit import Fit
from eos.saveddata.miscData import MiscData
from eos.saveddata.override import Override
from eos.types import *
from eos.db.saveddata.fit import projectedFits_table
from sqlalchemy.sql import and_
import eos.config import eos.config
configVal = getattr(eos.config, "saveddataCache", None) configVal = getattr(eos.config, "saveddataCache", None)
@@ -62,6 +68,7 @@ if configVal is True:
def checkAndReturn(*args, **kwargs): def checkAndReturn(*args, **kwargs):
useCache = kwargs.pop("useCache", True) useCache = kwargs.pop("useCache", True)
cacheKey = [] cacheKey = []
items = None
cacheKey.extend(args) cacheKey.extend(args)
for keyword in keywords: for keyword in keywords:
cacheKey.append(kwargs.get(keyword)) cacheKey.append(kwargs.get(keyword))

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Table, Column, Integer, ForeignKey
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import Skill from eos.saveddata.character import Skill
skills_table = Table("characterSkills", saveddata_meta, skills_table = Table("characterSkills", saveddata_meta,
Column("characterID", ForeignKey("characters.ID"), primary_key=True, index=True), Column("characterID", ForeignKey("characters.ID"), primary_key=True, index=True),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Table, Column, Integer, Float, ForeignKey, String
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import TargetResists from eos.saveddata.targetResists import TargetResists
targetResists_table = Table("targetResists", saveddata_meta, targetResists_table = Table("targetResists", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),

View File

@@ -21,7 +21,7 @@ from sqlalchemy import Table, Column, Integer, String, Boolean
from sqlalchemy.orm import mapper from sqlalchemy.orm import mapper
from eos.db import saveddata_meta from eos.db import saveddata_meta
from eos.types import User from eos.saveddata.user import User
users_table = Table("users", saveddata_meta, users_table = Table("users", saveddata_meta,
Column("ID", Integer, primary_key=True), Column("ID", Integer, primary_key=True),

View File

@@ -17,11 +17,8 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>. # along with eos. If not, see <http://www.gnu.org/licenses/>.
# =============================================================================== # ===============================================================================
# from sqlalchemy.orm.attributes import flag_modified
import logging import logging
import eos.db
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@@ -139,10 +136,6 @@ class HandledModuleList(HandledList):
self.remove(mod) self.remove(mod)
return return
# fix for #529, where a module may be in incorrect state after CCP changes mechanics of module
if not mod.isValidState(mod.state):
mod.state = eos.types.State.ONLINE
def insert(self, index, mod): def insert(self, index, mod):
mod.position = index mod.position = index
i = index i = index
@@ -162,7 +155,7 @@ class HandledModuleList(HandledList):
def toDummy(self, index): def toDummy(self, index):
mod = self[index] mod = self[index]
if not mod.isEmpty: if not mod.isEmpty:
dummy = eos.types.Module.buildEmpty(mod.slot) dummy = mod.buildEmpty(mod.slot)
dummy.position = index dummy.position = index
self[index] = dummy self[index] = dummy

View File

@@ -15,8 +15,6 @@ def handler(fit, module, context):
# Skip if there is no damage pattern. Example: projected ships or fleet boosters # Skip if there is no damage pattern. Example: projected ships or fleet boosters
if damagePattern: if damagePattern:
# logger.debug("Damage Pattern: %f/%f/%f/%f", damagePattern.emAmount, damagePattern.thermalAmount, damagePattern.kineticAmount, damagePattern.explosiveAmount)
# logger.debug("Original Armor Resists: %f/%f/%f/%f", fit.ship.getModifiedItemAttr('armorEmDamageResonance'), fit.ship.getModifiedItemAttr('armorThermalDamageResonance'), fit.ship.getModifiedItemAttr('armorKineticDamageResonance'), fit.ship.getModifiedItemAttr('armorExplosiveDamageResonance'))
# Populate a tuple with the damage profile modified by current armor resists. # Populate a tuple with the damage profile modified by current armor resists.
baseDamageTaken = ( baseDamageTaken = (
@@ -50,7 +48,6 @@ def handler(fit, module, context):
(2, baseDamageTaken[2] * RAHResistance[2], RAHResistance[2]), (2, baseDamageTaken[2] * RAHResistance[2], RAHResistance[2]),
(1, baseDamageTaken[1] * RAHResistance[1], RAHResistance[1]), (1, baseDamageTaken[1] * RAHResistance[1], RAHResistance[1]),
] ]
# logger.debug("Damage taken this cycle: %f/%f/%f/%f", damagePattern_tuples[0][1], damagePattern_tuples[3][1], damagePattern_tuples[2][1], damagePattern_tuples[1][1])
# Sort the tuple to drop the highest damage value to the bottom # Sort the tuple to drop the highest damage value to the bottom
sortedDamagePattern_tuples = sorted(damagePattern_tuples, key=lambda damagePattern: damagePattern[1]) sortedDamagePattern_tuples = sorted(damagePattern_tuples, key=lambda damagePattern: damagePattern[1])

View File

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

View File

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

View File

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

View File

@@ -3,7 +3,6 @@
# Used by: # Used by:
# Modules from group: Armor Coating (202 of 202) # Modules from group: Armor Coating (202 of 202)
# Modules from group: Armor Plating Energized (187 of 187) # Modules from group: Armor Plating Energized (187 of 187)
# Modules named like: QA Multiship Module Players (4 of 4)
type = "passive" type = "passive"

View File

@@ -1,7 +1,7 @@
# armorRepairAmountBonusSubcap # armorRepairAmountBonusSubcap
# #
# Used by: # Used by:
# Implants named like: Grade Asklepian (15 of 16) # Implants named like: grade Asklepian (15 of 18)
type = "passive" type = "passive"

View File

@@ -4,7 +4,8 @@
# Items from market group: Ammunition & Charges > Command Burst Charges (15 of 15) # Items from market group: Ammunition & Charges > Command Burst Charges (15 of 15)
type = "active" type = "active"
def handler(fit, module, context): def handler(fit, module, context):
for x in xrange(1, 4): for x in xrange(1, 4):
value = module.getModifiedChargeAttr("warfareBuff{}Multiplier".format(x)) value = module.getModifiedChargeAttr("warfareBuff{}Multiplier".format(x))
module.multiplyItemAttr("warfareBuff{}Value".format(x), value) module.multiplyItemAttr("warfareBuff{}Value".format(x), value)

View File

@@ -2,7 +2,6 @@
# #
# Used by: # Used by:
# Modules from group: Data Miners (15 of 16) # Modules from group: Data Miners (15 of 16)
# Module: QA Cross Protocol Analyzer
type = "active" type = "active"

View File

@@ -2,7 +2,6 @@
# #
# Used by: # Used by:
# Modules from group: Automated Targeting System (6 of 6) # Modules from group: Automated Targeting System (6 of 6)
# Module: QA Damage Module
type = "passive" type = "passive"

View File

@@ -3,4 +3,7 @@ type = "passive"
def handler(fit, src, context): def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Information Command Specialist"), "commandBonusHidden", src.getModifiedItemAttr("eliteBonusCommandDestroyer1"), skill="Command Destroyers") fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Information Command Specialist"),
"commandBonusHidden",
src.getModifiedItemAttr("eliteBonusCommandDestroyer1"),
skill="Command Destroyers")

View File

@@ -1,5 +1,7 @@
# Not used by any item # Not used by any item
type = "passive" type = "passive"
def handler(fit, module, context): def handler(fit, module, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Information Command Specialist"), fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Information Command Specialist"),
"commandBonusHidden", module.getModifiedItemAttr("eliteBonusCommandShips3"), skill="Command Ships") "commandBonusHidden", module.getModifiedItemAttr("eliteBonusCommandShips3"), skill="Command Ships")

View File

@@ -3,6 +3,14 @@
# Used by: # Used by:
# Ship: Rabisu # Ship: Rabisu
type = "passive" type = "passive"
def handler(fit, src, context): def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "falloffEffectiveness", src.getModifiedItemAttr("eliteBonusLogistics1"), skill="Logistics Cruisers") fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"),
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "maxRange", src.getModifiedItemAttr("eliteBonusLogistics1"), skill="Logistics Cruisers") "falloffEffectiveness",
src.getModifiedItemAttr("eliteBonusLogistics1"),
skill="Logistics Cruisers")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"),
"maxRange",
src.getModifiedItemAttr("eliteBonusLogistics1"),
skill="Logistics Cruisers")

View File

@@ -1,12 +1,11 @@
# Not used by any item # Not used by any item
from eos.types import State from eos.saveddata.module import State
type = "active", "projected" type = "active", "projected"
def handler(fit, src, context): def handler(fit, src, context):
if "projected" in context and ( if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or hasattr(src, "amountActive")):
(hasattr(src, "state") and src.state >= State.ACTIVE) or hasattr(src, "amountActive")):
multiplier = src.amountActive if hasattr(src, "amountActive") else 1 multiplier = src.amountActive if hasattr(src, "amountActive") else 1
amount = src.getModifiedItemAttr("energyNeutralizerAmount") amount = src.getModifiedItemAttr("energyNeutralizerAmount")
time = src.getModifiedItemAttr("duration") time = src.getModifiedItemAttr("duration")

View File

@@ -2,7 +2,7 @@
# #
# Used by: # Used by:
# Modules from group: Energy Neutralizer (51 of 51) # Modules from group: Energy Neutralizer (51 of 51)
from eos.types import State from eos.saveddata.module import State
type = "active", "projected" type = "active", "projected"

View File

@@ -2,8 +2,6 @@
# #
# Used by: # Used by:
# Modules from group: Heat Sink (18 of 18) # Modules from group: Heat Sink (18 of 18)
# Modules named like: QA Multiship Module Players (4 of 4)
# Module: QA Damage Module
type = "passive" type = "passive"

View File

@@ -2,7 +2,7 @@
# #
# Used by: # Used by:
# Drones from group: Energy Neutralizer Drone (3 of 3) # Drones from group: Energy Neutralizer Drone (3 of 3)
from eos.types import State from eos.saveddata.module import State
type = "active", "projected" type = "active", "projected"

View File

@@ -2,7 +2,6 @@
# #
# Used by: # Used by:
# Modules from group: Tracking Enhancer (10 of 10) # Modules from group: Tracking Enhancer (10 of 10)
# Module: QA Damage Module
type = "passive" type = "passive"

View File

@@ -2,7 +2,6 @@
# #
# Used by: # Used by:
# Modules from group: Tracking Enhancer (10 of 10) # Modules from group: Tracking Enhancer (10 of 10)
# Module: QA Damage Module
type = "passive" type = "passive"

View File

@@ -2,7 +2,6 @@
# #
# Used by: # Used by:
# Modules from group: Tracking Enhancer (10 of 10) # Modules from group: Tracking Enhancer (10 of 10)
# Module: QA Damage Module
type = "passive" type = "passive"

View File

@@ -2,8 +2,6 @@
# #
# Used by: # Used by:
# Modules from group: Magnetic Field Stabilizer (14 of 14) # Modules from group: Magnetic Field Stabilizer (14 of 14)
# Modules named like: QA Multiship Module Players (4 of 4)
# Module: QA Damage Module
type = "passive" type = "passive"

View File

@@ -4,6 +4,8 @@
# Modules named like: Drone Mining Augmentor (8 of 8) # Modules named like: Drone Mining Augmentor (8 of 8)
# Skill: Ice Harvesting Drone Operation # Skill: Ice Harvesting Drone Operation
type = "passive" type = "passive"
def handler(fit, src, context): def handler(fit, src, context):
lvl = src.level if "skill" in context else 1 lvl = src.level if "skill" in context else 1
fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Ice Harvesting Drone Operation"), "duration", src.getModifiedItemAttr("rofBonus") * lvl) fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Ice Harvesting Drone Operation"), "duration", src.getModifiedItemAttr("rofBonus") * lvl)

View File

@@ -6,13 +6,13 @@ type = "passive"
def handler(fit, src, context): def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff4Multiplier", fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff4Value",
src.getModifiedItemAttr("shipBonusICS2"), skill="Industrial Command Ships") src.getModifiedItemAttr("shipBonusICS2"), skill="Industrial Command Ships")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff1Multiplier", fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff1Value",
src.getModifiedItemAttr("shipBonusICS2"), skill="Industrial Command Ships") src.getModifiedItemAttr("shipBonusICS2"), skill="Industrial Command Ships")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "buffDuration", fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "buffDuration",
src.getModifiedItemAttr("shipBonusICS2"), skill="Industrial Command Ships") src.getModifiedItemAttr("shipBonusICS2"), skill="Industrial Command Ships")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff3Multiplier", fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff3Value",
src.getModifiedItemAttr("shipBonusICS2"), skill="Industrial Command Ships") src.getModifiedItemAttr("shipBonusICS2"), skill="Industrial Command Ships")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff2Multiplier", fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff2Value",
src.getModifiedItemAttr("shipBonusICS2"), skill="Industrial Command Ships") src.getModifiedItemAttr("shipBonusICS2"), skill="Industrial Command Ships")

View File

@@ -3,9 +3,11 @@
# Used by: # Used by:
# Skill: Mining Director # Skill: Mining Director
type = "passive" type = "passive"
def handler(fit, src, context): def handler(fit, src, context):
lvl = src.level lvl = src.level
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff4Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff4Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff3Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff3Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff2Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff2Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff1Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff1Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)

View File

@@ -2,7 +2,6 @@
# #
# Used by: # Used by:
# Modules from group: Ballistic Control system (17 of 17) # Modules from group: Ballistic Control system (17 of 17)
# Modules named like: QA Multiship Module Players (4 of 4)
type = "passive" type = "passive"

View File

@@ -1,13 +1,13 @@
# modifyActiveArmorResonancePostPercent # modifyActiveArmorResonancePostPercent
# #
# Used by: # Used by:
# Modules from group: Armor Hardener (156 of 156) # Modules from group: Armor Hardener (156 of 156)
# Modules from group: Flex Armor Hardener (4 of 4) # Modules from group: Flex Armor Hardener (4 of 4)
type = "active" type = "active"
def handler(fit, module, context): def handler(fit, module, context):
for damageType in ("kinetic", "thermal", "explosive", "em"): for damageType in ("kinetic", "thermal", "explosive", "em"):
fit.ship.boostItemAttr("armor%sDamageResonance" % damageType.capitalize(), fit.ship.boostItemAttr("armor%sDamageResonance" % damageType.capitalize(),
module.getModifiedItemAttr("%sDamageResistanceBonus" % damageType), module.getModifiedItemAttr("%sDamageResistanceBonus" % damageType),
stackingPenalties=True) stackingPenalties=True)

View File

@@ -1,13 +1,13 @@
# modifyActiveShieldResonancePostPercent # modifyActiveShieldResonancePostPercent
# #
# Used by: # Used by:
# Modules from group: Flex Shield Hardener (5 of 5) # Modules from group: Flex Shield Hardener (5 of 5)
# Modules from group: Shield Hardener (97 of 97) # Modules from group: Shield Hardener (97 of 97)
type = "active" type = "active"
def handler(fit, module, context): def handler(fit, module, context):
for damageType in ("kinetic", "thermal", "explosive", "em"): for damageType in ("kinetic", "thermal", "explosive", "em"):
fit.ship.boostItemAttr("shield" + damageType.capitalize() + "DamageResonance", fit.ship.boostItemAttr("shield" + damageType.capitalize() + "DamageResonance",
module.getModifiedItemAttr(damageType + "DamageResistanceBonus"), module.getModifiedItemAttr(damageType + "DamageResistanceBonus"),
stackingPenalties=True) stackingPenalties=True)

View File

@@ -6,7 +6,6 @@
# Modules from group: Reactor Control Unit (22 of 22) # Modules from group: Reactor Control Unit (22 of 22)
# Modules from group: Shield Recharger (4 of 4) # Modules from group: Shield Recharger (4 of 4)
# Modules named like: Flux Coil (12 of 12) # Modules named like: Flux Coil (12 of 12)
# Modules named like: QA Multiship Module Players (4 of 4)
type = "passive" type = "passive"

View File

@@ -13,6 +13,8 @@ which warfareBuffID to run (shouldn't need this right now, but better safe than
''' '''
type = "active", "gang" type = "active", "gang"
def handler(fit, module, context, **kwargs): def handler(fit, module, context, **kwargs):
for x in xrange(1, 5): for x in xrange(1, 5):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)): if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
@@ -21,5 +23,3 @@ def handler(fit, module, context, **kwargs):
if id: if id:
fit.addCommandBonus(id, value, module, kwargs['effect']) fit.addCommandBonus(id, value, module, kwargs['effect'])

View File

@@ -4,6 +4,8 @@
# Variations of module: Information Command Burst I (2 of 2) # Variations of module: Information Command Burst I (2 of 2)
type = "active", "gang" type = "active", "gang"
def handler(fit, module, context, **kwargs): def handler(fit, module, context, **kwargs):
for x in xrange(1, 5): for x in xrange(1, 5):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)): if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
@@ -11,4 +13,4 @@ def handler(fit, module, context, **kwargs):
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x)) id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
if id: if id:
fit.addCommandBonus(id, value, module, kwargs['effect']) fit.addCommandBonus(id, value, module, kwargs['effect'])

View File

@@ -4,6 +4,8 @@
# Variations of module: Mining Foreman Burst I (2 of 2) # Variations of module: Mining Foreman Burst I (2 of 2)
type = "active", "gang" type = "active", "gang"
def handler(fit, module, context, **kwargs): def handler(fit, module, context, **kwargs):
for x in xrange(1, 5): for x in xrange(1, 5):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)): if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
@@ -11,4 +13,4 @@ def handler(fit, module, context, **kwargs):
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x)) id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
if id: if id:
fit.addCommandBonus(id, value, module, kwargs['effect']) fit.addCommandBonus(id, value, module, kwargs['effect'])

View File

@@ -4,6 +4,8 @@
# Variations of module: Shield Command Burst I (2 of 2) # Variations of module: Shield Command Burst I (2 of 2)
type = "active", "gang" type = "active", "gang"
def handler(fit, module, context, **kwargs): def handler(fit, module, context, **kwargs):
for x in xrange(1, 5): for x in xrange(1, 5):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)): if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
@@ -11,4 +13,4 @@ def handler(fit, module, context, **kwargs):
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x)) id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
if id: if id:
fit.addCommandBonus(id, value, module, kwargs['effect']) fit.addCommandBonus(id, value, module, kwargs['effect'])

View File

@@ -4,6 +4,8 @@
# Variations of module: Skirmish Command Burst I (2 of 2) # Variations of module: Skirmish Command Burst I (2 of 2)
type = "active", "gang" type = "active", "gang"
def handler(fit, module, context, **kwargs): def handler(fit, module, context, **kwargs):
for x in xrange(1, 5): for x in xrange(1, 5):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)): if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
@@ -11,4 +13,4 @@ def handler(fit, module, context, **kwargs):
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x)) id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))
if id: if id:
fit.addCommandBonus(id, value, module, kwargs['effect']) fit.addCommandBonus(id, value, module, kwargs['effect'])

View File

@@ -3,6 +3,8 @@
# Used by: # Used by:
# Modules from group: Titan Phenomena Generator (4 of 4) # Modules from group: Titan Phenomena Generator (4 of 4)
type = "active", "gang" type = "active", "gang"
def handler(fit, module, context, **kwargs): def handler(fit, module, context, **kwargs):
for x in xrange(1, 5): for x in xrange(1, 5):
if module.getModifiedItemAttr("warfareBuff{}ID".format(x)): if module.getModifiedItemAttr("warfareBuff{}ID".format(x)):
@@ -11,7 +13,3 @@ def handler(fit, module, context, **kwargs):
if id: if id:
fit.addCommandBonus(id, value, module, kwargs['effect']) fit.addCommandBonus(id, value, module, kwargs['effect'])

View File

@@ -1,4 +1,4 @@
# remoteWeaponDisruptEntity # npcEntityWeaponDisruptor
# #
# Used by: # Used by:
# Drones named like: TD (3 of 3) # Drones named like: TD (3 of 3)

View File

@@ -11,8 +11,6 @@
# Modules from group: Smart Bomb (118 of 118) # Modules from group: Smart Bomb (118 of 118)
# Modules from group: Warp Disrupt Field Generator (7 of 7) # Modules from group: Warp Disrupt Field Generator (7 of 7)
# Modules named like: Ancillary Remote (8 of 8) # Modules named like: Ancillary Remote (8 of 8)
# Module: QA Remote Armor Repair System - 5 Players
# Module: QA Shield Transporter - 5 Players
# Module: Reactive Armor Hardener # Module: Reactive Armor Hardener
# Module: Target Spectrum Breaker # Module: Target Spectrum Breaker
type = "overheat" type = "overheat"

View File

@@ -2,8 +2,6 @@
# #
# Used by: # Used by:
# Modules from group: Gyrostabilizer (13 of 13) # Modules from group: Gyrostabilizer (13 of 13)
# Modules named like: QA Multiship Module Players (4 of 4)
# Module: QA Damage Module
type = "passive" type = "passive"

View File

@@ -4,7 +4,8 @@ runTime = "late"
def handler(fit, module, context): def handler(fit, module, context):
if "projected" not in context: return if "projected" not in context:
return
bonus = module.getModifiedItemAttr("structureDamageAmount") bonus = module.getModifiedItemAttr("structureDamageAmount")
duration = module.getModifiedItemAttr("duration") / 1000.0 duration = module.getModifiedItemAttr("duration") / 1000.0
fit.extraAttributes.increase("hullRepair", bonus / duration) fit.extraAttributes.increase("hullRepair", bonus / duration)

View File

@@ -3,6 +3,12 @@
# Used by: # Used by:
# Ship: Rabisu # Ship: Rabisu
type = "passive" type = "passive"
def handler(fit, src, context): def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "falloffEffectiveness", src.getModifiedItemAttr("roleBonusRepairRange")) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"),
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "maxRange", src.getModifiedItemAttr("roleBonusRepairRange")) "falloffEffectiveness",
src.getModifiedItemAttr("roleBonusRepairRange"))
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"),
"maxRange",
src.getModifiedItemAttr("roleBonusRepairRange"))

View File

@@ -1,7 +1,4 @@
# scanStrengthBonusPercentActivate # Not used by any item
#
# Used by:
# Module: QA ECCM
type = "active" type = "active"

View File

@@ -1,7 +1,7 @@
# scanStrengthBonusPercentPassive # scanStrengthBonusPercentPassive
# #
# Used by: # Used by:
# Implants named like: High grade (20 of 61) # Implants named like: High grade (20 of 66)
type = "passive" type = "passive"

View File

@@ -1,8 +1,7 @@
# setBonusAsklepian # setBonusAsklepian
# #
# Used by: # Used by:
# Implants named like: Grade Asklepian (16 of 16) # Implants named like: grade Asklepian (18 of 18)
# Implants named like: grade Asklepian Omega (2 of 2)
runTime = "early" runTime = "early"
type = "passive" type = "passive"

View File

@@ -1,7 +1,4 @@
# shieldTransfer # Not used by any item
#
# Used by:
# Module: QA Shield Transporter - 5 Players
type = "projected", "active" type = "projected", "active"

View File

@@ -3,9 +3,21 @@
# Used by: # Used by:
# Ship: Apostle # Ship: Apostle
type = "passive" type = "passive"
def handler(fit, src, context): def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or mod.item.requiresSkill("Information Command"), "warfareBuff4Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier") fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or mod.item.requiresSkill("Information Command"), "warfareBuff3Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier") mod.item.requiresSkill("Information Command"),
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or mod.item.requiresSkill("Information Command"), "warfareBuff1Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier") "warfareBuff4Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or mod.item.requiresSkill("Information Command"), "buffDuration", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier") fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or mod.item.requiresSkill("Information Command"), "warfareBuff2Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier") mod.item.requiresSkill("Information Command"),
"warfareBuff3Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or
mod.item.requiresSkill("Information Command"),
"warfareBuff1Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or
mod.item.requiresSkill("Information Command"),
"buffDuration", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or
mod.item.requiresSkill("Information Command"),
"warfareBuff2Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier")

View File

@@ -1,10 +1,10 @@
# shipBonusRepairSystemsBonusATC2 # shipBonusRepairSystemsBonusATC2
# #
# Used by: # Used by:
# Ship: Vangel # Ship: Vangel
type = "passive" type = "passive"
def handler(fit, ship, context): def handler(fit, ship, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Repair Systems"), fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Repair Systems"),
"armorDamageAmount", ship.getModifiedItemAttr("shipBonusATC2")) "armorDamageAmount", ship.getModifiedItemAttr("shipBonusATC2"))

View File

@@ -1,11 +1,11 @@
# shipEnergyNeutralizerTransferAmountBonusAB # shipEnergyNeutralizerTransferAmountBonusAB
# #
# Used by: # Used by:
# Ship: Bhaalgorn # Ship: Bhaalgorn
type = "passive" type = "passive"
def handler(fit, ship, context): def handler(fit, ship, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer",
"energyNeutralizerAmount", ship.getModifiedItemAttr("shipBonusAB"), "energyNeutralizerAmount", ship.getModifiedItemAttr("shipBonusAB"),
skill="Amarr Battleship") skill="Amarr Battleship")

View File

@@ -11,5 +11,5 @@ def handler(fit, module, context):
fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Rockets") or mod.charge.requiresSkill("Light Missiles"), fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Rockets") or mod.charge.requiresSkill("Light Missiles"),
"{}Damage".format(type), "{}Damage".format(type),
1 / module.getModifiedItemAttr("modeDamageBonusPostDiv"), 1 / module.getModifiedItemAttr("modeDamageBonusPostDiv"),
stackingPenalties = True, stackingPenalties=True,
penaltyGroup="postDiv") penaltyGroup="postDiv")

View File

@@ -1,4 +1,4 @@
# remoteGuidanceDisruptFalloff # shipModuleGuidanceDisruptor
# #
# Used by: # Used by:
# Variations of module: Guidance Disruptor I (6 of 6) # Variations of module: Guidance Disruptor I (6 of 6)

View File

@@ -1,4 +1,4 @@
# remoteTrackingAssistFalloff # shipModuleRemoteTrackingComputer
# #
# Used by: # Used by:
# Modules from group: Remote Tracking Computer (8 of 8) # Modules from group: Remote Tracking Computer (8 of 8)

View File

@@ -1,4 +1,4 @@
# remoteTrackingDisruptFalloff # shipModuleTrackingDisruptor
# #
# Used by: # Used by:
# Variations of module: Tracking Disruptor I (6 of 6) # Variations of module: Tracking Disruptor I (6 of 6)

View File

@@ -2,7 +2,6 @@
# #
# Used by: # Used by:
# Modules from group: Signal Amplifier (7 of 7) # Modules from group: Signal Amplifier (7 of 7)
# Module: QA Damage Module
type = "passive" type = "passive"

View File

@@ -1,13 +1,13 @@
# skillReactiveArmorHardenerCapNeedBonus # skillReactiveArmorHardenerCapNeedBonus
# #
# Used by: # Used by:
# Skill: Resistance Phasing # Skill: Resistance Phasing
type = "passive" type = "passive"
def handler(fit, src, context): def handler(fit, src, context):
lvl = src.level lvl = src.level
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Armor Resistance Shift Hardener", "capacitorNeed", fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Armor Resistance Shift Hardener", "capacitorNeed",
src.getModifiedItemAttr("capNeedBonus") * lvl) src.getModifiedItemAttr("capNeedBonus") * lvl)
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Resistance Phasing"), "capacitorNeed", fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Resistance Phasing"), "capacitorNeed",
src.getModifiedItemAttr("capNeedBonus") * lvl) src.getModifiedItemAttr("capNeedBonus") * lvl)

View File

@@ -1,13 +1,13 @@
# skillReactiveArmorHardenerDurationBonus # skillReactiveArmorHardenerDurationBonus
# #
# Used by: # Used by:
# Skill: Resistance Phasing # Skill: Resistance Phasing
type = "passive" type = "passive"
def handler(fit, src, context): def handler(fit, src, context):
lvl = src.level lvl = src.level
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Armor Resistance Shift Hardener", "duration", fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Armor Resistance Shift Hardener", "duration",
src.getModifiedItemAttr("durationBonus") * lvl) src.getModifiedItemAttr("durationBonus") * lvl)
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Resistance Phasing"), "duration", fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Resistance Phasing"), "duration",
src.getModifiedItemAttr("durationBonus") * lvl) src.getModifiedItemAttr("durationBonus") * lvl)

View File

@@ -1,10 +0,0 @@
# standardMissilesSkillBoostMissileVelocityBonus
#
# Used by:
# Skill: Defender Missiles
type = "passive"
def handler(fit, skill, context):
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Defender Missiles"),
"maxVelocity", skill.getModifiedItemAttr("missileVelocityBonus") * skill.level)

View File

@@ -3,7 +3,6 @@
# Used by: # Used by:
# Implants named like: Inherent Implants 'Noble' Repair Proficiency RP (6 of 6) # Implants named like: Inherent Implants 'Noble' Repair Proficiency RP (6 of 6)
# Modules named like: Auxiliary Nano Pump (8 of 8) # Modules named like: Auxiliary Nano Pump (8 of 8)
# Modules named like: QA Multiship Module Players (4 of 4)
# Implant: Imperial Navy Modified 'Noble' Implant # Implant: Imperial Navy Modified 'Noble' Implant
type = "passive" type = "passive"

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