aa-intel-tool 1.2.0__py3-none-any.whl → 2.0.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aa_intel_tool/__init__.py +1 -6
- aa_intel_tool/app_settings.py +32 -1
- aa_intel_tool/auth_hooks.py +1 -1
- aa_intel_tool/constants.py +0 -13
- aa_intel_tool/locale/es/LC_MESSAGES/django.mo +0 -0
- aa_intel_tool/locale/es/LC_MESSAGES/django.po +6 -4
- aa_intel_tool/locale/fr_FR/LC_MESSAGES/django.mo +0 -0
- aa_intel_tool/locale/fr_FR/LC_MESSAGES/django.po +8 -6
- aa_intel_tool/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
- aa_intel_tool/locale/zh_Hans/LC_MESSAGES/django.po +8 -8
- aa_intel_tool/management/commands/aa_intel_tool_load_eve_types.py +1 -1
- aa_intel_tool/parser/module/chatlist.py +17 -7
- aa_intel_tool/parser/module/dscan.py +36 -33
- aa_intel_tool/parser/module/fleetcomp.py +11 -5
- aa_intel_tool/static/aa_intel_tool/css/aa-intel-tool.css +7 -147
- aa_intel_tool/static/aa_intel_tool/css/aa-intel-tool.min.css +1 -1
- aa_intel_tool/static/aa_intel_tool/css/aa-intel-tool.min.css.map +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.js +12 -12
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.min.js.map +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.js +33 -33
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.min.js.map +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-fleetcomposition.js +13 -13
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-fleetcomposition.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-fleetcomposition.min.js.map +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-scan-result-common.js +17 -19
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-scan-result-common.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-scan-result-common.min.js.map +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool.min.js.map +1 -1
- aa_intel_tool/templates/aa_intel_tool/base.html +9 -4
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-chatscan-js.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-css.html +1 -2
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-dscan-js.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-fleetcomp-js.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-js.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/body/scan-retention-note.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/footer/app-translation-footer.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/index/form.html +21 -22
- aa_intel_tool/templates/aa_intel_tool/partials/scan/buttons.html +6 -5
- aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/alliances.html +7 -7
- aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/corporations.html +7 -7
- aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/pilots.html +7 -7
- aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/interesting-on-grid/items.html +7 -7
- aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/interesting-on-grid.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ships-breakdown/ship-classes.html +7 -7
- aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ships-breakdown/ship-types.html +7 -7
- aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ships-breakdown.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/system-information.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/partials/scan/evetime.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/scan/fleetcomp/fleet-details/pilots.html +6 -6
- aa_intel_tool/templates/aa_intel_tool/partials/scan/fleetcomp/fleet-details.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/scan/fleetcomp/participation.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/views/index.html +4 -9
- aa_intel_tool/templates/aa_intel_tool/views/scan/chatlist.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/views/scan/dscan.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/views/scan/fleetcomp.html +2 -2
- aa_intel_tool/tests/test_access.py +24 -13
- aa_intel_tool/tests/test_auth_hooks.py +18 -12
- aa_intel_tool/tests/test_templatetags.py +2 -3
- aa_intel_tool/tests/utils.py +14 -0
- aa_intel_tool/views/general.py +3 -1
- {aa_intel_tool-1.2.0.dist-info → aa_intel_tool-2.0.0b1.dist-info}/METADATA +31 -36
- {aa_intel_tool-1.2.0.dist-info → aa_intel_tool-2.0.0b1.dist-info}/RECORD +69 -72
- {aa_intel_tool-1.2.0.dist-info → aa_intel_tool-2.0.0b1.dist-info}/WHEEL +1 -1
- aa_intel_tool/static/aa_intel_tool/css/aa-bootstrap-fix.css +0 -13
- aa_intel_tool/static/aa_intel_tool/css/aa-bootstrap-fix.min.css +0 -2
- aa_intel_tool/static/aa_intel_tool/css/aa-bootstrap-fix.min.css.map +0 -1
- /aa_intel_tool/templatetags/{inteltool_versioned_static.py → aa_intel_tool.py} +0 -0
- {aa_intel_tool-1.2.0.dist-info → aa_intel_tool-2.0.0b1.dist-info}/licenses/LICENSE +0 -0
aa_intel_tool/__init__.py
CHANGED
|
@@ -2,13 +2,8 @@
|
|
|
2
2
|
App init
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
# Standard Library
|
|
6
|
-
from importlib import metadata
|
|
7
|
-
|
|
8
5
|
# Django
|
|
9
6
|
from django.utils.translation import gettext_lazy as _
|
|
10
7
|
|
|
11
|
-
__version__ =
|
|
8
|
+
__version__ = "2.0.0-beta.1"
|
|
12
9
|
__title__ = _("Intel Parser")
|
|
13
|
-
|
|
14
|
-
del metadata
|
aa_intel_tool/app_settings.py
CHANGED
|
@@ -2,11 +2,23 @@
|
|
|
2
2
|
App settings
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
# Standard Library
|
|
6
|
+
from enum import IntEnum
|
|
7
|
+
|
|
8
|
+
# Alliance Auth
|
|
9
|
+
from allianceauth.services.hooks import get_extension_logger
|
|
10
|
+
|
|
5
11
|
# Alliance Auth (External Libs)
|
|
6
12
|
from app_utils.app_settings import clean_setting
|
|
13
|
+
from app_utils.logging import LoggerAddTag
|
|
14
|
+
|
|
15
|
+
# AA Intel Tool
|
|
16
|
+
from aa_intel_tool import __title__
|
|
17
|
+
|
|
18
|
+
logger = LoggerAddTag(my_logger=get_extension_logger(name=__name__), prefix=__title__)
|
|
7
19
|
|
|
8
20
|
|
|
9
|
-
class AppSettings:
|
|
21
|
+
class AppSettings:
|
|
10
22
|
"""
|
|
11
23
|
App settings from local.py
|
|
12
24
|
"""
|
|
@@ -50,3 +62,22 @@ class AppSettings: # pylint: disable=too-few-public-methods
|
|
|
50
62
|
INTELTOOL_DSCAN_GRID_SIZE = clean_setting(
|
|
51
63
|
name="INTELTOOL_DSCAN_GRID_SIZE", default_value=10000, required_type=int
|
|
52
64
|
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class AdditionalEveCategoryId(IntEnum):
|
|
68
|
+
"""
|
|
69
|
+
Eve category IDs which are not covered by Eve Universe
|
|
70
|
+
Unfortunately Python doesn't allow to extend eveuniverse.constants.EveCategoryId
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
DEPLOYABLE = 22
|
|
74
|
+
STARBASE = 23
|
|
75
|
+
SCANNER_PROBE = 479
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class UpwellStructureId(IntEnum):
|
|
79
|
+
"""
|
|
80
|
+
Upwell Structure IDs
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
ANSIBLEX_JUMP_GATE = 35841
|
aa_intel_tool/auth_hooks.py
CHANGED
|
@@ -20,7 +20,7 @@ class AaIntelToolMenuItem(MenuItemHook): # pylint: disable=too-few-public-metho
|
|
|
20
20
|
MenuItemHook.__init__(
|
|
21
21
|
self,
|
|
22
22
|
text=__title__,
|
|
23
|
-
classes="
|
|
23
|
+
classes="fa-solid fa-clipboard-list",
|
|
24
24
|
url_name="aa_intel_tool:intel_tool_index",
|
|
25
25
|
navactive=["aa_intel_tool:"],
|
|
26
26
|
)
|
aa_intel_tool/constants.py
CHANGED
|
@@ -4,7 +4,6 @@ App constants
|
|
|
4
4
|
|
|
5
5
|
# Standard Library
|
|
6
6
|
import re
|
|
7
|
-
from enum import IntEnum
|
|
8
7
|
|
|
9
8
|
# Django
|
|
10
9
|
from django.utils.text import slugify
|
|
@@ -35,17 +34,6 @@ distance_units_off_grid: str = """
|
|
|
35
34
|
distance_units = f"{distance_units_on_grid}|{distance_units_off_grid}"
|
|
36
35
|
|
|
37
36
|
|
|
38
|
-
class AdditionalEveCategoryId(IntEnum):
|
|
39
|
-
"""
|
|
40
|
-
Eve category IDs which are not covered by Eve Universe
|
|
41
|
-
Unfortunately Python doesn't allow to extend eveuniverse.constants.EveCategoryId
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
DEPLOYABLE = 22
|
|
45
|
-
STARBASE = 23
|
|
46
|
-
SCANNER_PROBE = 479
|
|
47
|
-
|
|
48
|
-
|
|
49
37
|
# Pre-compiled regex patterns used throughout the app
|
|
50
38
|
REGEX_PATTERN = {
|
|
51
39
|
"chatlist": re.compile(pattern=r"(?im)^[a-zA-Z0-9\u0080-\uFFFF -_]{3,37}$"),
|
|
@@ -64,7 +52,6 @@ REGEX_PATTERN = {
|
|
|
64
52
|
),
|
|
65
53
|
}
|
|
66
54
|
|
|
67
|
-
|
|
68
55
|
# Supported intel types and their parameters
|
|
69
56
|
SUPPORTED_INTEL_TYPES = {
|
|
70
57
|
"chatlist": {
|
|
Binary file
|
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
# This file is distributed under the same license as the PACKAGE package.
|
|
4
4
|
# Zigor Fernandez Moreno <sietehierros@gmail.com>, 2023.
|
|
5
5
|
# Peter Pfeufer <info@ppfeufer.de>, 2023.
|
|
6
|
+
# Geovanny David Morales De la cruz <moralesgeovanny1996@gmail.com>, 2023.
|
|
6
7
|
msgid ""
|
|
7
8
|
msgstr ""
|
|
8
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
9
10
|
"Report-Msgid-Bugs-To: \n"
|
|
10
11
|
"POT-Creation-Date: 2023-10-04 17:44+0200\n"
|
|
11
|
-
"PO-Revision-Date: 2023-10-
|
|
12
|
-
"Last-Translator:
|
|
12
|
+
"PO-Revision-Date: 2023-10-25 07:04+0000\n"
|
|
13
|
+
"Last-Translator: Geovanny David Morales De la cruz <moralesgeovanny1996@gmail"
|
|
14
|
+
".com>\n"
|
|
13
15
|
"Language-Team: Spanish <https://weblate.ppfeufer.de/projects/"
|
|
14
16
|
"alliance-auth-apps/aa-intel-tool/es/>\n"
|
|
15
17
|
"Language: es\n"
|
|
@@ -17,7 +19,7 @@ msgstr ""
|
|
|
17
19
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
20
|
"Content-Transfer-Encoding: 8bit\n"
|
|
19
21
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
|
20
|
-
"X-Generator: Weblate 5.
|
|
22
|
+
"X-Generator: Weblate 5.1\n"
|
|
21
23
|
|
|
22
24
|
#: aa_intel_tool/__init__.py:12
|
|
23
25
|
#: aa_intel_tool/templates/aa_intel_tool/base.html:6
|
|
@@ -234,7 +236,7 @@ msgstr ""
|
|
|
234
236
|
#: aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-js-l10n.html:19
|
|
235
237
|
msgctxt "Decimal separator"
|
|
236
238
|
msgid "."
|
|
237
|
-
msgstr ""
|
|
239
|
+
msgstr "."
|
|
238
240
|
|
|
239
241
|
#: aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-js-l10n.html:20
|
|
240
242
|
msgctxt "Thousands separator"
|
|
Binary file
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
3
|
# This file is distributed under the same license as the PACKAGE package.
|
|
4
|
-
#
|
|
5
|
-
#
|
|
4
|
+
# erka Ekanon <M6musicT@hotmail.fr>, 2024.
|
|
5
|
+
# Peter Pfeufer <info@ppfeufer.de>, 2024.
|
|
6
6
|
msgid ""
|
|
7
7
|
msgstr ""
|
|
8
8
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
9
9
|
"Report-Msgid-Bugs-To: \n"
|
|
10
10
|
"POT-Creation-Date: 2023-10-04 17:44+0200\n"
|
|
11
|
-
"PO-Revision-Date:
|
|
12
|
-
"Last-Translator:
|
|
11
|
+
"PO-Revision-Date: 2024-01-12 19:05+0000\n"
|
|
12
|
+
"Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
|
|
13
13
|
"Language-Team: French <https://weblate.ppfeufer.de/projects/"
|
|
14
14
|
"alliance-auth-apps/aa-intel-tool/fr/>\n"
|
|
15
15
|
"Language: fr_FR\n"
|
|
@@ -17,7 +17,7 @@ msgstr ""
|
|
|
17
17
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
18
|
"Content-Transfer-Encoding: 8bit\n"
|
|
19
19
|
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
|
20
|
-
"X-Generator: Weblate 5.
|
|
20
|
+
"X-Generator: Weblate 5.3.1\n"
|
|
21
21
|
|
|
22
22
|
#: aa_intel_tool/__init__.py:12
|
|
23
23
|
#: aa_intel_tool/templates/aa_intel_tool/base.html:6
|
|
@@ -303,10 +303,12 @@ msgid ""
|
|
|
303
303
|
"Do you want to help translate this app into your language or improve the "
|
|
304
304
|
"existing translation?"
|
|
305
305
|
msgstr ""
|
|
306
|
+
"Voulez-vous aider à traduire cette application dans votre langue ou "
|
|
307
|
+
"améliorer la traduction existante ?"
|
|
306
308
|
|
|
307
309
|
#: aa_intel_tool/templates/aa_intel_tool/partials/footer/app-translation-footer.html:8
|
|
308
310
|
msgid "Join our team of translators!"
|
|
309
|
-
msgstr ""
|
|
311
|
+
msgstr "Rejoignez notre équipe de traducteurs !"
|
|
310
312
|
|
|
311
313
|
#: aa_intel_tool/templates/aa_intel_tool/partials/index/form.html:10
|
|
312
314
|
msgid "What can I paste?"
|
|
Binary file
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
3
|
# This file is distributed under the same license as the PACKAGE package.
|
|
4
|
-
#
|
|
5
|
-
#
|
|
4
|
+
# Dehao Wu <wudehao2000@163.com>, 2024.
|
|
5
|
+
# Faer Yili <yilifaer@gmail.com>, 2024.
|
|
6
6
|
msgid ""
|
|
7
7
|
msgstr ""
|
|
8
8
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
9
9
|
"Report-Msgid-Bugs-To: \n"
|
|
10
10
|
"POT-Creation-Date: 2023-10-04 17:44+0200\n"
|
|
11
|
-
"PO-Revision-Date:
|
|
12
|
-
"Last-Translator:
|
|
11
|
+
"PO-Revision-Date: 2024-01-11 21:04+0000\n"
|
|
12
|
+
"Last-Translator: Dehao Wu <wudehao2000@163.com>\n"
|
|
13
13
|
"Language-Team: Chinese (Simplified) <https://weblate.ppfeufer.de/projects/"
|
|
14
14
|
"alliance-auth-apps/aa-intel-tool/zh_Hans/>\n"
|
|
15
15
|
"Language: zh_Hans\n"
|
|
@@ -17,7 +17,7 @@ msgstr ""
|
|
|
17
17
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
18
|
"Content-Transfer-Encoding: 8bit\n"
|
|
19
19
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
20
|
-
"X-Generator: Weblate 5.
|
|
20
|
+
"X-Generator: Weblate 5.3.1\n"
|
|
21
21
|
|
|
22
22
|
#: aa_intel_tool/__init__.py:12
|
|
23
23
|
#: aa_intel_tool/templates/aa_intel_tool/base.html:6
|
|
@@ -300,11 +300,11 @@ msgstr[0] ""
|
|
|
300
300
|
msgid ""
|
|
301
301
|
"Do you want to help translate this app into your language or improve the "
|
|
302
302
|
"existing translation?"
|
|
303
|
-
msgstr ""
|
|
303
|
+
msgstr "您想帮助将此应用程序翻译成您的母语或改进现有的翻译吗?"
|
|
304
304
|
|
|
305
305
|
#: aa_intel_tool/templates/aa_intel_tool/partials/footer/app-translation-footer.html:8
|
|
306
306
|
msgid "Join our team of translators!"
|
|
307
|
-
msgstr ""
|
|
307
|
+
msgstr "加入我们的翻译团队吧!"
|
|
308
308
|
|
|
309
309
|
#: aa_intel_tool/templates/aa_intel_tool/partials/index/form.html:10
|
|
310
310
|
msgid "What can I paste?"
|
|
@@ -450,7 +450,7 @@ msgstr ""
|
|
|
450
450
|
|
|
451
451
|
#: aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ships-breakdown/ship-types.html:18
|
|
452
452
|
msgid "Ship type"
|
|
453
|
-
msgstr ""
|
|
453
|
+
msgstr "舰船类型"
|
|
454
454
|
|
|
455
455
|
#: aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ships-breakdown/ship-types.html:36
|
|
456
456
|
msgid "No data."
|
|
@@ -15,7 +15,7 @@ from eveuniverse.constants import EveCategoryId
|
|
|
15
15
|
|
|
16
16
|
# AA Intel Tool
|
|
17
17
|
from aa_intel_tool import __title__
|
|
18
|
-
from aa_intel_tool.
|
|
18
|
+
from aa_intel_tool.app_settings import AdditionalEveCategoryId
|
|
19
19
|
|
|
20
20
|
logger = LoggerAddTag(logging.getLogger(__name__), __title__)
|
|
21
21
|
|
|
@@ -41,9 +41,10 @@ def _get_character_info(scan_data: list) -> QuerySet[EveCharacter]:
|
|
|
41
41
|
:rtype:
|
|
42
42
|
"""
|
|
43
43
|
|
|
44
|
+
fetch_from_eveuniverse = False
|
|
45
|
+
|
|
44
46
|
# Check if we have to bother Eve Universe or if we have all characters already
|
|
45
47
|
# Excluding corporation_id=1000001 (Doomheim) to force an update here …
|
|
46
|
-
fetch_from_eveuniverse = False
|
|
47
48
|
try:
|
|
48
49
|
eve_characters = EveCharacter.objects.filter(
|
|
49
50
|
character_name__in=scan_data
|
|
@@ -54,6 +55,7 @@ def _get_character_info(scan_data: list) -> QuerySet[EveCharacter]:
|
|
|
54
55
|
if len(scan_data) != eve_characters.count():
|
|
55
56
|
fetch_from_eveuniverse = True
|
|
56
57
|
|
|
58
|
+
# Fetch the character information from Eve Universe if needed
|
|
57
59
|
if fetch_from_eveuniverse:
|
|
58
60
|
try:
|
|
59
61
|
eve_character_ids = (
|
|
@@ -111,6 +113,7 @@ def _parse_alliance_info(
|
|
|
111
113
|
:rtype:
|
|
112
114
|
"""
|
|
113
115
|
|
|
116
|
+
# Build alliance info dict
|
|
114
117
|
if eve_character.alliance_id is None:
|
|
115
118
|
alliance_info = _get_unaffiliated_alliance_info()
|
|
116
119
|
else:
|
|
@@ -151,6 +154,7 @@ def _parse_corporation_info(
|
|
|
151
154
|
"logo": eve_character.corporation_logo_url_32,
|
|
152
155
|
}
|
|
153
156
|
|
|
157
|
+
# Add eve links if requested
|
|
154
158
|
if with_evelinks:
|
|
155
159
|
corporation_info["dotlan"] = dotlan.corporation_url(
|
|
156
160
|
name=eve_character.corporation_name
|
|
@@ -159,6 +163,7 @@ def _parse_corporation_info(
|
|
|
159
163
|
eve_id=eve_character.corporation_id
|
|
160
164
|
)
|
|
161
165
|
|
|
166
|
+
# Add alliance info if requested
|
|
162
167
|
if with_alliance_info:
|
|
163
168
|
corporation_info["alliance"] = _parse_alliance_info(
|
|
164
169
|
eve_character=eve_character, with_evelinks=with_evelinks
|
|
@@ -208,17 +213,21 @@ def _parse_chatscan_data(eve_characters: QuerySet[EveCharacter]) -> dict:
|
|
|
208
213
|
corporation_info = {}
|
|
209
214
|
character_info = {}
|
|
210
215
|
|
|
216
|
+
# Loop through the characters
|
|
211
217
|
for eve_character in eve_characters:
|
|
212
218
|
eve_character__alliance_name = "Unaffiliated"
|
|
213
219
|
|
|
220
|
+
# If the character is in an alliance, use the alliance name
|
|
214
221
|
if eve_character.alliance_name is not None:
|
|
215
222
|
eve_character__alliance_name = eve_character.alliance_name
|
|
216
223
|
|
|
217
|
-
|
|
218
|
-
counter
|
|
224
|
+
counter[eve_character__alliance_name] = (
|
|
225
|
+
counter.get(eve_character__alliance_name, 0) + 1
|
|
226
|
+
)
|
|
219
227
|
|
|
220
|
-
|
|
221
|
-
counter
|
|
228
|
+
counter[eve_character.corporation_name] = (
|
|
229
|
+
counter.get(eve_character.corporation_name, 0) + 1
|
|
230
|
+
)
|
|
222
231
|
|
|
223
232
|
# Alliance Info
|
|
224
233
|
if eve_character__alliance_name not in alliance_info:
|
|
@@ -238,12 +247,10 @@ def _parse_chatscan_data(eve_characters: QuerySet[EveCharacter]) -> dict:
|
|
|
238
247
|
)
|
|
239
248
|
|
|
240
249
|
# Update the counter
|
|
241
|
-
counter[eve_character__alliance_name] += 1
|
|
242
250
|
alliance_info[eve_character__alliance_name]["count"] = counter[
|
|
243
251
|
eve_character__alliance_name
|
|
244
252
|
]
|
|
245
253
|
|
|
246
|
-
counter[eve_character.corporation_name] += 1
|
|
247
254
|
corporation_info[eve_character.corporation_name]["count"] = counter[
|
|
248
255
|
eve_character.corporation_name
|
|
249
256
|
]
|
|
@@ -273,12 +280,14 @@ def parse(
|
|
|
273
280
|
|
|
274
281
|
message = _("The chat list module is currently disabled.")
|
|
275
282
|
|
|
283
|
+
# Only parse the chat scan if the module is enabled
|
|
276
284
|
if AppSettings.INTELTOOL_ENABLE_MODULE_CHATSCAN is True:
|
|
277
285
|
logger.debug(msg=f"{len(scan_data)} name(s) to work through …")
|
|
278
286
|
|
|
279
287
|
pilots_in_scan = len(scan_data)
|
|
280
288
|
max_allowed_pilots = AppSettings.INTELTOOL_CHATSCAN_MAX_PILOTS
|
|
281
289
|
|
|
290
|
+
# Check if the number of pilots in the scan exceeds the maximum allowed number
|
|
282
291
|
if 0 < max_allowed_pilots < pilots_in_scan and ignore_limit is False:
|
|
283
292
|
logger.debug(
|
|
284
293
|
msg=(
|
|
@@ -287,6 +296,7 @@ def parse(
|
|
|
287
296
|
)
|
|
288
297
|
)
|
|
289
298
|
|
|
299
|
+
# Throw a tantrum
|
|
290
300
|
raise ParserError(
|
|
291
301
|
message=ngettext(
|
|
292
302
|
singular=f"Chat scans are currently limited to a maximum of {max_allowed_pilots} pilot per scan. Your list of pilots exceeds this limit.", # pylint: disable=line-too-long
|
|
@@ -20,7 +20,11 @@ from eveuniverse.models import EveType
|
|
|
20
20
|
|
|
21
21
|
# AA Intel Tool
|
|
22
22
|
from aa_intel_tool import __title__
|
|
23
|
-
from aa_intel_tool.app_settings import
|
|
23
|
+
from aa_intel_tool.app_settings import (
|
|
24
|
+
AdditionalEveCategoryId,
|
|
25
|
+
AppSettings,
|
|
26
|
+
UpwellStructureId,
|
|
27
|
+
)
|
|
24
28
|
from aa_intel_tool.exceptions import ParserError
|
|
25
29
|
from aa_intel_tool.helper.data_structure import dict_to_list
|
|
26
30
|
from aa_intel_tool.models import Scan, ScanData
|
|
@@ -44,9 +48,11 @@ def _is_on_grid(distance: str) -> bool:
|
|
|
44
48
|
REGEX_PATTERN,
|
|
45
49
|
)
|
|
46
50
|
|
|
51
|
+
# Check if we have a distance
|
|
47
52
|
if re.search(pattern=REGEX_PATTERN["localised_on_grid"], string=distance):
|
|
48
53
|
distance_sanitised = int(re.sub(pattern=r"[^0-9]", repl="", string=distance))
|
|
49
54
|
|
|
55
|
+
# Check if the distance is within the grid size
|
|
50
56
|
if distance_sanitised <= AppSettings.INTELTOOL_DSCAN_GRID_SIZE:
|
|
51
57
|
return True
|
|
52
58
|
|
|
@@ -102,6 +108,7 @@ def _get_ships(eve_types: QuerySet, counter: dict) -> dict:
|
|
|
102
108
|
eve_group__eve_category_id__exact=EveCategoryId.SHIP
|
|
103
109
|
)
|
|
104
110
|
|
|
111
|
+
# Loop through all ships types
|
|
105
112
|
for eve_type in eve_types_ships:
|
|
106
113
|
# Info for "All Ships" table
|
|
107
114
|
if eve_type[0] in counter["all"]:
|
|
@@ -160,6 +167,7 @@ def _get_upwell_structures_on_grid(
|
|
|
160
167
|
|
|
161
168
|
upwell_structures = {}
|
|
162
169
|
|
|
170
|
+
# Loop through all Upwell structures
|
|
163
171
|
for eve_type in eve_types_structures:
|
|
164
172
|
if eve_type[0] in counter["ongrid"]:
|
|
165
173
|
if eve_type[1] not in upwell_structures:
|
|
@@ -167,7 +175,10 @@ def _get_upwell_structures_on_grid(
|
|
|
167
175
|
upwell_structures[eve_type[1]]["count"] = counter["ongrid"][eve_type[0]]
|
|
168
176
|
|
|
169
177
|
# If it is an Ansiblex Jump Gate, add the destination system
|
|
170
|
-
if
|
|
178
|
+
if (
|
|
179
|
+
eve_type[0] == UpwellStructureId.ANSIBLEX_JUMP_GATE
|
|
180
|
+
and ansiblex_destination
|
|
181
|
+
):
|
|
171
182
|
upwell_structures[eve_type[1]][
|
|
172
183
|
"name"
|
|
173
184
|
] += f" » {ansiblex_destination}"
|
|
@@ -187,17 +198,13 @@ def _get_deployables_on_grid(eve_types: QuerySet, counter: dict) -> list:
|
|
|
187
198
|
:rtype:
|
|
188
199
|
"""
|
|
189
200
|
|
|
190
|
-
# AA Intel Tool
|
|
191
|
-
from aa_intel_tool.constants import ( # pylint: disable=import-outside-toplevel
|
|
192
|
-
AdditionalEveCategoryId,
|
|
193
|
-
)
|
|
194
|
-
|
|
195
201
|
eve_types_deployables = eve_types.filter(
|
|
196
202
|
eve_group__eve_category_id__exact=AdditionalEveCategoryId.DEPLOYABLE
|
|
197
203
|
)
|
|
198
204
|
|
|
199
205
|
deployables = {}
|
|
200
206
|
|
|
207
|
+
# Loop through all deployables
|
|
201
208
|
for eve_type in eve_types_deployables:
|
|
202
209
|
if eve_type[0] in counter["ongrid"]:
|
|
203
210
|
if eve_type[1] not in deployables:
|
|
@@ -219,17 +226,13 @@ def _get_starbases_on_grid(eve_types: QuerySet, counter: dict) -> list:
|
|
|
219
226
|
:rtype:
|
|
220
227
|
"""
|
|
221
228
|
|
|
222
|
-
# AA Intel Tool
|
|
223
|
-
from aa_intel_tool.constants import ( # pylint: disable=import-outside-toplevel
|
|
224
|
-
AdditionalEveCategoryId,
|
|
225
|
-
)
|
|
226
|
-
|
|
227
229
|
eve_types_starbase = eve_types.filter(
|
|
228
230
|
eve_group__eve_category_id__exact=AdditionalEveCategoryId.STARBASE
|
|
229
231
|
)
|
|
230
232
|
|
|
231
233
|
starbases = {}
|
|
232
234
|
|
|
235
|
+
# Loop through all starbases
|
|
233
236
|
for eve_type in eve_types_starbase:
|
|
234
237
|
if eve_type[0] in counter["ongrid"]:
|
|
235
238
|
if eve_type[1] not in starbases:
|
|
@@ -241,7 +244,7 @@ def _get_starbases_on_grid(eve_types: QuerySet, counter: dict) -> list:
|
|
|
241
244
|
|
|
242
245
|
def _get_ansiblex_jumpgate_destination(ansiblex_name: str) -> str:
|
|
243
246
|
"""
|
|
244
|
-
Get the Ansiblex Jump Gate
|
|
247
|
+
Get the Ansiblex Jump Gate destination system
|
|
245
248
|
|
|
246
249
|
:param ansiblex_name:
|
|
247
250
|
:type ansiblex_name:
|
|
@@ -268,7 +271,6 @@ def _get_scan_details(scan_data: list) -> tuple:
|
|
|
268
271
|
ansiblex_destination = None
|
|
269
272
|
counter = {"all": {}, "ongrid": {}, "offgrid": {}, "type": {}}
|
|
270
273
|
eve_ids = {"all": [], "ongrid": [], "offgrid": []}
|
|
271
|
-
# dscan_lines = []
|
|
272
274
|
|
|
273
275
|
# Let's split this list up
|
|
274
276
|
#
|
|
@@ -276,35 +278,31 @@ def _get_scan_details(scan_data: list) -> tuple:
|
|
|
276
278
|
# line[1] => Name
|
|
277
279
|
# line[2] => Ship Class / Structure Type
|
|
278
280
|
# line[3] => Distance
|
|
281
|
+
#
|
|
282
|
+
# Loop through all lines
|
|
279
283
|
for entry in scan_data:
|
|
280
284
|
line = re.split(pattern=r"\t+", string=entry.rstrip("\t"))
|
|
281
285
|
entry_id = int(line[0])
|
|
282
286
|
|
|
283
|
-
|
|
284
|
-
counter["all"][entry_id] = 0
|
|
287
|
+
counter["all"][entry_id] = counter["all"].get(entry_id, 0) + 1
|
|
285
288
|
|
|
289
|
+
# Check if the entry is "on grid" or not
|
|
286
290
|
if _is_on_grid(line[3]):
|
|
287
|
-
|
|
288
|
-
counter["ongrid"][entry_id] = 0
|
|
291
|
+
counter["ongrid"][entry_id] = counter["ongrid"].get(entry_id, 0) + 1
|
|
289
292
|
|
|
290
|
-
# If
|
|
291
|
-
if entry_id ==
|
|
293
|
+
# If it is an Ansiblex Jump Gate, get its destination system
|
|
294
|
+
if entry_id == UpwellStructureId.ANSIBLEX_JUMP_GATE:
|
|
292
295
|
ansiblex_destination = _get_ansiblex_jumpgate_destination(
|
|
293
296
|
ansiblex_name=line[1]
|
|
294
297
|
)
|
|
295
298
|
|
|
296
|
-
counter["ongrid"][entry_id] += 1
|
|
297
299
|
eve_ids["ongrid"].append(entry_id)
|
|
298
300
|
else:
|
|
299
|
-
|
|
300
|
-
counter["offgrid"][entry_id] = 0
|
|
301
|
+
counter["offgrid"][entry_id] = counter["offgrid"].get(entry_id, 0) + 1
|
|
301
302
|
|
|
302
|
-
counter["offgrid"][entry_id] += 1
|
|
303
303
|
eve_ids["offgrid"].append(entry_id)
|
|
304
304
|
|
|
305
|
-
counter["all"][entry_id] += 1
|
|
306
305
|
eve_ids["all"].append(entry_id)
|
|
307
|
-
# dscan_lines.append([entry_id, line[1], line[2], line[3]])
|
|
308
306
|
|
|
309
307
|
return ansiblex_destination, counter, eve_ids
|
|
310
308
|
|
|
@@ -321,9 +319,14 @@ def parse(scan_data: list) -> Scan:
|
|
|
321
319
|
|
|
322
320
|
message = _("The D-Scan module is currently disabled.")
|
|
323
321
|
|
|
322
|
+
# Only parse the D-Scan when the module is enabled
|
|
324
323
|
if AppSettings.INTELTOOL_ENABLE_MODULE_DSCAN is True:
|
|
325
324
|
parsed_data = {}
|
|
326
|
-
|
|
325
|
+
(
|
|
326
|
+
ansiblex_destination, # pylint: disable=unused-variable
|
|
327
|
+
counter,
|
|
328
|
+
eve_ids,
|
|
329
|
+
) = _get_scan_details(scan_data=scan_data)
|
|
327
330
|
|
|
328
331
|
eve_types = EveType.objects.bulk_get_or_create_esi(
|
|
329
332
|
ids=set(eve_ids["all"]), include_children=True
|
|
@@ -334,19 +337,19 @@ def parse(scan_data: list) -> Scan:
|
|
|
334
337
|
upwell_structures = _get_upwell_structures_on_grid(
|
|
335
338
|
eve_types=eve_types,
|
|
336
339
|
counter=counter,
|
|
337
|
-
ansiblex_destination=ansiblex_destination,
|
|
340
|
+
# ansiblex_destination=ansiblex_destination,
|
|
338
341
|
)
|
|
339
342
|
deployables = _get_deployables_on_grid(eve_types=eve_types, counter=counter)
|
|
340
343
|
starbases = _get_starbases_on_grid(eve_types=eve_types, counter=counter)
|
|
341
344
|
|
|
342
|
-
# Add "ships all" to parsed data when available
|
|
345
|
+
# Add "ships all" to the parsed data when available
|
|
343
346
|
if ships["all"]:
|
|
344
347
|
parsed_data["all"] = {
|
|
345
348
|
"section": ScanData.Section.SHIPLIST,
|
|
346
349
|
"data": ships["all"],
|
|
347
350
|
}
|
|
348
351
|
|
|
349
|
-
# Add "ships on grid" to parsed data when available
|
|
352
|
+
# Add "ships on grid" to the parsed data when available
|
|
350
353
|
if ships["ongrid"]:
|
|
351
354
|
parsed_data["ongrid"] = {
|
|
352
355
|
"section": ScanData.Section.SHIPLIST_ON_GRID,
|
|
@@ -360,21 +363,21 @@ def parse(scan_data: list) -> Scan:
|
|
|
360
363
|
"data": ships["offgrid"],
|
|
361
364
|
}
|
|
362
365
|
|
|
363
|
-
# Add "ship types" to parsed data when available
|
|
366
|
+
# Add "ship types" to the parsed data when available
|
|
364
367
|
if ships["types"]:
|
|
365
368
|
parsed_data["shiptypes"] = {
|
|
366
369
|
"section": ScanData.Section.SHIPTYPES,
|
|
367
370
|
"data": ships["types"],
|
|
368
371
|
}
|
|
369
372
|
|
|
370
|
-
# Add "Upwell structures on grid" to parsed data when available
|
|
373
|
+
# Add "Upwell structures on grid" to the parsed data when available
|
|
371
374
|
if upwell_structures:
|
|
372
375
|
parsed_data["sructures_on_grid"] = {
|
|
373
376
|
"section": ScanData.Section.STRUCTURES_ON_GRID,
|
|
374
377
|
"data": upwell_structures,
|
|
375
378
|
}
|
|
376
379
|
|
|
377
|
-
# Add "deployables on grid" to parsed data when available
|
|
380
|
+
# Add "deployables on grid" to the parsed data when available
|
|
378
381
|
if deployables:
|
|
379
382
|
parsed_data["deployables"] = {
|
|
380
383
|
"section": ScanData.Section.DEPLOYABLES_ON_GRID,
|
|
@@ -39,19 +39,21 @@ def _get_fleet_composition(pilots: dict, ships: dict) -> dict:
|
|
|
39
39
|
:rtype:
|
|
40
40
|
"""
|
|
41
41
|
|
|
42
|
-
#
|
|
42
|
+
# Get ship class IDs
|
|
43
43
|
ship_class_ids = (
|
|
44
44
|
EveEntity.objects.fetch_by_names_esi(names=ships["class"], update=True)
|
|
45
45
|
.filter(category=EveEntity.CATEGORY_INVENTORY_TYPE)
|
|
46
46
|
.values_list("id", flat=True)
|
|
47
47
|
)
|
|
48
48
|
|
|
49
|
+
# Get ship class details
|
|
49
50
|
ship_class_details = EveType.objects.bulk_get_or_create_esi(
|
|
50
51
|
ids=set(ship_class_ids), include_children=True
|
|
51
52
|
).values_list("id", "name", "eve_group__id", "eve_group__name", named=True)
|
|
52
53
|
|
|
54
|
+
# Loop through ship classes
|
|
53
55
|
for ship_class in ship_class_details:
|
|
54
|
-
#
|
|
56
|
+
# Build ship class dict
|
|
55
57
|
ships["class"][ship_class.name]["id"] = ship_class.id
|
|
56
58
|
ships["class"][ship_class.name]["name"] = ship_class.name
|
|
57
59
|
ships["class"][ship_class.name]["type_id"] = ship_class.eve_group__id
|
|
@@ -60,18 +62,21 @@ def _get_fleet_composition(pilots: dict, ships: dict) -> dict:
|
|
|
60
62
|
type_id=ship_class.id, size=32
|
|
61
63
|
)
|
|
62
64
|
|
|
63
|
-
#
|
|
65
|
+
# Build ship type dict
|
|
64
66
|
ships["type"][ship_class.eve_group__name]["id"] = ship_class.eve_group__id
|
|
65
67
|
ships["type"][ship_class.eve_group__name]["name"] = ship_class.eve_group__name
|
|
66
68
|
|
|
67
69
|
# Pilots
|
|
68
70
|
pilot_details = _get_character_info(scan_data=list(set(pilots)))
|
|
69
71
|
|
|
72
|
+
# Loop through pilots
|
|
70
73
|
for pilot in pilot_details:
|
|
74
|
+
# Get ship class details for a pilot
|
|
71
75
|
pilot__ship_class = ship_class_details.filter(
|
|
72
76
|
name=pilots[pilot.character_name]["ship"]
|
|
73
77
|
).get()
|
|
74
78
|
|
|
79
|
+
# Build pilots dict
|
|
75
80
|
pilots[pilot.character_name]["id"] = pilot.character_id
|
|
76
81
|
pilots[pilot.character_name]["portrait"] = pilot.portrait_url_32
|
|
77
82
|
pilots[pilot.character_name]["evewho"] = evewho.character_url(
|
|
@@ -102,9 +107,9 @@ def parse(scan_data: list) -> Scan:
|
|
|
102
107
|
|
|
103
108
|
message = _("The fleet composition module is currently disabled.")
|
|
104
109
|
|
|
110
|
+
# Only parse fleet composition when the module is enabled
|
|
105
111
|
if AppSettings.INTELTOOL_ENABLE_MODULE_FLEETCOMP is True:
|
|
106
112
|
parsed_data = {}
|
|
107
|
-
# pilots = {"list": [], "flying": {}}
|
|
108
113
|
pilots = {}
|
|
109
114
|
ships = {"type": {}, "class": {}}
|
|
110
115
|
lines = []
|
|
@@ -124,7 +129,6 @@ def parse(scan_data: list) -> Scan:
|
|
|
124
129
|
if len(line) == 6:
|
|
125
130
|
line.append("")
|
|
126
131
|
|
|
127
|
-
# pilots["list"].append(line[0])
|
|
128
132
|
pilots[line[0]] = {
|
|
129
133
|
"name": line[0],
|
|
130
134
|
"solarsystem": line[1],
|
|
@@ -148,6 +152,8 @@ def parse(scan_data: list) -> Scan:
|
|
|
148
152
|
fleet_composition = _get_fleet_composition(pilots=pilots, ships=ships)
|
|
149
153
|
|
|
150
154
|
participation = None
|
|
155
|
+
|
|
156
|
+
# Check if chat scan module is enabled
|
|
151
157
|
if AppSettings.INTELTOOL_ENABLE_MODULE_CHATSCAN is True:
|
|
152
158
|
participation = parse_pilots(
|
|
153
159
|
scan_data=list(set(pilots)),
|