aa-intel-tool 0.0.1a4__tar.gz → 0.0.1a6__tar.gz

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.
Files changed (93) hide show
  1. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/PKG-INFO +1 -1
  2. aa_intel_tool-0.0.1a6/aa_intel_tool/admin.py +108 -0
  3. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/de/LC_MESSAGES/django.mo +0 -0
  4. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/de/LC_MESSAGES/django.po +5 -5
  5. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/management/commands/aa_intel_tool_load_eve_types.py +2 -0
  6. aa_intel_tool-0.0.1a6/aa_intel_tool/migrations/0005_alter_scan_options_alter_scandata_options_and_more.py +94 -0
  7. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/models.py +10 -10
  8. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/parser/module/chatlist.py +8 -11
  9. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/pyproject.toml +1 -1
  10. aa_intel_tool-0.0.1a4/aa_intel_tool/admin.py +0 -70
  11. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/.gitignore +0 -0
  12. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/LICENSE +0 -0
  13. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/README.md +0 -0
  14. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/__init__.py +0 -0
  15. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/app_settings.py +0 -0
  16. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/apps.py +0 -0
  17. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/auth_hooks.py +0 -0
  18. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/constants.py +0 -0
  19. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/exceptions.py +0 -0
  20. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/form.py +0 -0
  21. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/helper/eve_character.py +0 -0
  22. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/django.pot +0 -0
  23. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/es/LC_MESSAGES/django.po +0 -0
  24. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/fr_FR/LC_MESSAGES/django.po +0 -0
  25. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/it_IT/LC_MESSAGES/django.po +0 -0
  26. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/ja/LC_MESSAGES/django.po +0 -0
  27. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/ko_KR/LC_MESSAGES/django.po +0 -0
  28. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/ru/LC_MESSAGES/django.po +0 -0
  29. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/uk/LC_MESSAGES/django.po +0 -0
  30. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/locale/zh_Hans/LC_MESSAGES/django.po +0 -0
  31. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/migrations/0001_initial.py +0 -0
  32. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/migrations/0002_remove_scan_processed_data_scandata.py +0 -0
  33. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/migrations/0003_alter_scandata_scan.py +0 -0
  34. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/migrations/0004_alter_scandata_section.py +0 -0
  35. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/migrations/__init__.py +0 -0
  36. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/parser/__init__.py +0 -0
  37. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/parser/general.py +0 -0
  38. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/parser/helper/db.py +0 -0
  39. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/parser/module/dscan.py +0 -0
  40. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/parser/module/fleetcomp.py +0 -0
  41. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/providers.py +0 -0
  42. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/css/aa-bootstrap-fix.css +0 -0
  43. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/css/aa-bootstrap-fix.min.css +0 -0
  44. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/css/aa-intel-tool.css +0 -0
  45. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/css/aa-intel-tool.min.css +0 -0
  46. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.js +0 -0
  47. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.min.js +0 -0
  48. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-clipboard.js +0 -0
  49. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-clipboard.min.js +0 -0
  50. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.js +0 -0
  51. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.min.js +0 -0
  52. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-highlight.js +0 -0
  53. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-highlight.min.js +0 -0
  54. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool.js +0 -0
  55. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool.min.js +0 -0
  56. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tasks.py +0 -0
  57. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/base.html +0 -0
  58. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-chatscan-js.html +0 -0
  59. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-css.html +0 -0
  60. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-dscan-js.html +0 -0
  61. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-js-l10n.html +0 -0
  62. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-js.html +0 -0
  63. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/partials/body/scan-retention-note.html +0 -0
  64. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/partials/footer/app-translation-footer.html +0 -0
  65. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/partials/index/form.html +0 -0
  66. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/partials/scan/buttons.html +0 -0
  67. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/alliances.html +0 -0
  68. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/corporations.html +0 -0
  69. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/pilots.html +0 -0
  70. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ship-classes.html +0 -0
  71. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ship-types.html +0 -0
  72. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/partials/scan/evetime.html +0 -0
  73. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/views/index.html +0 -0
  74. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/views/scan/chatlist.html +0 -0
  75. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templates/aa_intel_tool/views/scan/dscan.html +0 -0
  76. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templatetags/__init__.py +0 -0
  77. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/templatetags/inteltool_versioned_static.py +0 -0
  78. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/__init__.py +0 -0
  79. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/test-data/chatscan-faulty.txt +0 -0
  80. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/test-data/chatscan.txt +0 -0
  81. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/test-data/dscan.txt +0 -0
  82. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/test-data/fleetcomp.txt +0 -0
  83. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/test_access.py +0 -0
  84. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/test_app_settings.py +0 -0
  85. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/test_auth_hooks.py +0 -0
  86. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/test_models.py +0 -0
  87. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/test_parser.py +0 -0
  88. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/test_templatetags.py +0 -0
  89. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/tests/utils.py +0 -0
  90. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/urls.py +0 -0
  91. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/views/__init__.py +0 -0
  92. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/views/ajax.py +0 -0
  93. {aa_intel_tool-0.0.1a4 → aa_intel_tool-0.0.1a6}/aa_intel_tool/views/general.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aa-intel-tool
3
- Version: 0.0.1a4
3
+ Version: 0.0.1a6
4
4
  Summary: A simple parser for D-Scans and more for Alliance Auth
5
5
  Project-URL: Homepage, https://github.com/ppfeufer/aa-intel-tool
6
6
  Project-URL: Documentation, https://github.com/ppfeufer/aa-intel-tool/blob/master/README.md
@@ -0,0 +1,108 @@
1
+ """
2
+ Django admin integration
3
+ """
4
+
5
+ # Django
6
+ from django.contrib import admin
7
+ from django.utils import html, safestring
8
+ from django.utils.translation import gettext_lazy as _
9
+
10
+ # Alliance Auth (External Libs)
11
+ from app_utils.urls import reverse_absolute
12
+
13
+ # AA Intel Tool
14
+ from aa_intel_tool.models import Scan
15
+
16
+
17
+ class BaseReadOnlyAdminMixin:
18
+ """
19
+ Base "Read Only" mixin for admin models
20
+ """
21
+
22
+ actions = None # Removes the default delete action.
23
+
24
+ @staticmethod
25
+ def has_add_permission(request): # pylint: disable=unused-argument
26
+ """
27
+ Has "add" permissions
28
+
29
+ :param request:
30
+ :type request:
31
+ :return:
32
+ :rtype:
33
+ """
34
+
35
+ return False
36
+
37
+ @staticmethod
38
+ def has_change_permission(request, obj=None): # pylint: disable=unused-argument
39
+ """
40
+ Has "change" permissions
41
+
42
+ :param request:
43
+ :type request:
44
+ :param obj:
45
+ :type obj:
46
+ :return:
47
+ :rtype:
48
+ """
49
+
50
+ return False
51
+
52
+ @staticmethod
53
+ def has_delete_permission(request, obj=None): # pylint: disable=unused-argument
54
+ """
55
+ Has "delete" permissions
56
+
57
+ :param request:
58
+ :type request:
59
+ :param obj:
60
+ :type obj:
61
+ :return:
62
+ :rtype:
63
+ """
64
+
65
+ return False
66
+
67
+
68
+ @admin.register(Scan)
69
+ class ScanAdmin(BaseReadOnlyAdminMixin, admin.ModelAdmin):
70
+ """
71
+ Scan Admin
72
+ """
73
+
74
+ list_display = ("hash", "scan_type", "created")
75
+ fields = ("_scan_type", "_raw_data")
76
+
77
+ @admin.display(description=_("Scan type"))
78
+ def _scan_type(self, obj) -> str:
79
+ """
80
+ Add link to open the scan in a new browser tab
81
+
82
+ :param obj:
83
+ :type obj:
84
+ :return:
85
+ :rtype:
86
+ """
87
+ intel_type = obj.get_scan_type_display()
88
+ scan_link = reverse_absolute(
89
+ viewname="aa_intel_tool:intel_tool_scan", args=[obj.hash]
90
+ )
91
+ link_text = _("Open in a new browser tab")
92
+
93
+ return safestring.mark_safe(
94
+ f'{intel_type} (<a href="{scan_link}" target="_blank" rel="noreferer noopener">{link_text}</a>)'
95
+ )
96
+
97
+ @admin.display(description=_("RAW data"))
98
+ def _raw_data(self, obj) -> str:
99
+ """
100
+ Format the output properly
101
+
102
+ :param obj:
103
+ :type obj:
104
+ :return:
105
+ :rtype:
106
+ """
107
+
108
+ return html.format_html("<pre>{}</pre>", obj.raw_data)
@@ -7,7 +7,7 @@ msgstr ""
7
7
  "Project-Id-Version: PACKAGE VERSION\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
9
  "POT-Creation-Date: 2023-08-10 20:47+0200\n"
10
- "PO-Revision-Date: 2023-08-10 19:17+0000\n"
10
+ "PO-Revision-Date: 2023-08-12 12:28+0000\n"
11
11
  "Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
12
12
  "Language-Team: German <https://weblate.ppfeufer.de/projects/"
13
13
  "alliance-auth-apps/aa-intel-tool/de/>\n"
@@ -39,7 +39,7 @@ msgstr "D-Scan"
39
39
 
40
40
  #: models.py:23 templates/aa_intel_tool/partials/index/form.html:31
41
41
  msgid "Fleet Composition"
42
- msgstr "Flottenzusammansetzung"
42
+ msgstr "Flottenzusammensetzung"
43
43
 
44
44
  #: models.py:24
45
45
  msgid "Chat List"
@@ -155,7 +155,7 @@ msgstr ""
155
155
 
156
156
  #: parser/module/chatlist.py:264
157
157
  msgid "Character unknown to ESI."
158
- msgstr "Charakter ist nicht in ESI."
158
+ msgstr "Charakter ist in ESI nicht bekannt."
159
159
 
160
160
  #: parser/module/dscan.py:136
161
161
  msgid "The D-Scan module is currently disabled."
@@ -313,11 +313,11 @@ msgstr "Absenden"
313
313
 
314
314
  #: templates/aa_intel_tool/partials/index/form.html:52
315
315
  msgid "Working on it, please be patient …"
316
- msgstr "Arbeite, bitte hab etwas Geduld …"
316
+ msgstr "Bei der Arbeit, bitte hab etwas Geduld …"
317
317
 
318
318
  #: templates/aa_intel_tool/partials/index/form.html:54
319
319
  msgid "Detecting the intel type"
320
- msgstr "Erkennen des Intel-Typs"
320
+ msgstr "Erkennung des Intel-Typs"
321
321
 
322
322
  #: templates/aa_intel_tool/partials/index/form.html:55
323
323
  msgid ""
@@ -60,6 +60,8 @@ class Command(BaseCommand):
60
60
  __title__,
61
61
  "--category_id",
62
62
  str(EveCategoryId.SHIP.value),
63
+ "--category_id",
64
+ str(EveCategoryId.STRUCTURE.value),
63
65
  ]
64
66
 
65
67
  if options["noinput"]:
@@ -0,0 +1,94 @@
1
+ # Generated by Django 4.0.10 on 2023-08-12 19:27
2
+
3
+ # Django
4
+ from django.db import migrations, models
5
+
6
+
7
+ class Migration(migrations.Migration):
8
+ dependencies = [
9
+ ("aa_intel_tool", "0004_alter_scandata_section"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterModelOptions(
14
+ name="scan",
15
+ options={
16
+ "default_permissions": (),
17
+ "verbose_name": "Scan",
18
+ "verbose_name_plural": "Scans",
19
+ },
20
+ ),
21
+ migrations.AlterModelOptions(
22
+ name="scandata",
23
+ options={
24
+ "default_permissions": (),
25
+ "verbose_name": "Scan data",
26
+ "verbose_name_plural": "Scan data",
27
+ },
28
+ ),
29
+ migrations.AlterField(
30
+ model_name="scan",
31
+ name="created",
32
+ field=models.DateTimeField(
33
+ auto_now_add=True, db_index=True, verbose_name="Creation date/time"
34
+ ),
35
+ ),
36
+ migrations.AlterField(
37
+ model_name="scan",
38
+ name="hash",
39
+ field=models.CharField(
40
+ editable=False,
41
+ max_length=30,
42
+ primary_key=True,
43
+ serialize=False,
44
+ unique=True,
45
+ verbose_name="Scan hash",
46
+ ),
47
+ ),
48
+ migrations.AlterField(
49
+ model_name="scan",
50
+ name="raw_data",
51
+ field=models.TextField(verbose_name="Scan RAW data"),
52
+ ),
53
+ migrations.AlterField(
54
+ model_name="scan",
55
+ name="scan_type",
56
+ field=models.CharField(
57
+ choices=[
58
+ ("invalid", "Invalid scan data"),
59
+ ("dscan", "D-Scan"),
60
+ ("fleetcomp", "Fleet Composition"),
61
+ ("chatlist", "Chat List"),
62
+ ],
63
+ default="invalid",
64
+ max_length=9,
65
+ verbose_name="Scan type",
66
+ ),
67
+ ),
68
+ migrations.AlterField(
69
+ model_name="scandata",
70
+ name="processed_data",
71
+ field=models.JSONField(default=dict, verbose_name="Processed scan data"),
72
+ ),
73
+ migrations.AlterField(
74
+ model_name="scandata",
75
+ name="section",
76
+ field=models.CharField(
77
+ choices=[
78
+ ("invalid", "Invalid scan data"),
79
+ ("pilotlist", "Pilot list"),
80
+ ("corporationlist", "Corporation list"),
81
+ ("alliancelist", "Alliance list"),
82
+ ("shiptypes", "Ship types"),
83
+ ("shiplist", "Ship list"),
84
+ ("shiplist_on_grid", "Ship list (on grid)"),
85
+ ("shiplist_off_grid", "Ship list (off grid)"),
86
+ ("structures_on_grid", "Structures (on grid)"),
87
+ ("deployables_on_grid", "Deployables (on grid)"),
88
+ ],
89
+ default="invalid",
90
+ max_length=19,
91
+ verbose_name="Scan section",
92
+ ),
93
+ ),
94
+ ]
@@ -28,22 +28,22 @@ class Scan(models.Model):
28
28
  editable=False,
29
29
  unique=True,
30
30
  max_length=30,
31
- verbose_name=_("The hash of the scan."),
31
+ verbose_name=_("Scan hash"),
32
32
  )
33
33
 
34
34
  created = models.DateTimeField(
35
35
  auto_now_add=True,
36
36
  db_index=True,
37
- verbose_name=_("Date and time the scan was created."),
37
+ verbose_name=_("Creation date/time"),
38
38
  )
39
39
 
40
- raw_data = models.TextField(verbose_name=_("The original scan data."))
40
+ raw_data = models.TextField(verbose_name=_("Scan RAW data"))
41
41
 
42
42
  scan_type = models.CharField(
43
43
  max_length=9,
44
44
  choices=Type.choices,
45
45
  default=Type.INVALID,
46
- verbose_name=_("The scan type."),
46
+ verbose_name=_("Scan type"),
47
47
  )
48
48
 
49
49
  class Meta: # pylint: disable=too-few-public-methods
@@ -52,8 +52,8 @@ class Scan(models.Model):
52
52
  """
53
53
 
54
54
  default_permissions = ()
55
- verbose_name = _("scan")
56
- verbose_name_plural = _("scans")
55
+ verbose_name = _("Scan")
56
+ verbose_name_plural = _("Scans")
57
57
 
58
58
  def __str__(self) -> str:
59
59
  return str(self.pk)
@@ -132,11 +132,11 @@ class ScanData(models.Model):
132
132
  max_length=19,
133
133
  choices=Section.choices,
134
134
  default=Section.INVALID,
135
- verbose_name=_("The scan section"),
135
+ verbose_name=_("Scan section"),
136
136
  )
137
137
 
138
138
  processed_data = models.JSONField(
139
- default=dict, verbose_name=_("The processed scan section data")
139
+ default=dict, verbose_name=_("Processed scan data")
140
140
  )
141
141
 
142
142
  class Meta: # pylint: disable=too-few-public-methods
@@ -145,5 +145,5 @@ class ScanData(models.Model):
145
145
  """
146
146
 
147
147
  default_permissions = ()
148
- verbose_name = _("scan data")
149
- verbose_name_plural = _("scan data")
148
+ verbose_name = _("Scan data")
149
+ verbose_name_plural = _("Scan data")
@@ -52,9 +52,7 @@ def _parse_alliance_info(eve_character: EveCharacter) -> dict:
52
52
  "id": eve_character.alliance_id,
53
53
  "name": eve_character.alliance_name,
54
54
  "ticker": eve_character.alliance_ticker,
55
- "logo": eveimageserver.alliance_logo_url(
56
- alliance_id=eve_character.alliance_id, size=32
57
- ),
55
+ "logo": eve_character.alliance_logo_url_32,
58
56
  "dotlan": dotlan.alliance_url(eve_character.alliance_name),
59
57
  "zkillboard": zkillboard.alliance_url(eve_character.alliance_id),
60
58
  }
@@ -76,9 +74,7 @@ def _parse_corporation_info(eve_character: EveCharacter) -> dict:
76
74
  "id": eve_character.corporation_id,
77
75
  "name": eve_character.corporation_name,
78
76
  "ticker": eve_character.corporation_ticker,
79
- "logo": eveimageserver.corporation_logo_url(
80
- corporation_id=eve_character.corporation_id, size=32
81
- ),
77
+ "logo": eve_character.corporation_logo_url_32,
82
78
  "dotlan": dotlan.corporation_url(eve_character.corporation_name),
83
79
  "zkillboard": zkillboard.corporation_url(eve_character.corporation_id),
84
80
  }
@@ -97,9 +93,7 @@ def _parse_character_info(eve_character: EveCharacter) -> dict:
97
93
  return {
98
94
  "id": eve_character.character_id,
99
95
  "name": eve_character.character_name,
100
- "portrait": eveimageserver.character_portrait_url(
101
- character_id=eve_character.character_id, size=32
102
- ),
96
+ "portrait": eve_character.portrait_url_32,
103
97
  "evewho": evewho.character_url(eve_character.character_id),
104
98
  "zkillboard": zkillboard.character_url(eve_character.character_id),
105
99
  }
@@ -237,9 +231,12 @@ def parse(scan_data: list, safe_to_db: bool = True) -> Union[Scan, dict]:
237
231
  )
238
232
 
239
233
  # Check if we have to bother Eve Universe or if we have all characters already
234
+ # Excluding corporation_id=1000001 (Doomheim) to force an update here …
240
235
  fetch_from_eveuniverse = False
241
236
  try:
242
- eve_characters = EveCharacter.objects.filter(character_name__in=scan_data)
237
+ eve_characters = EveCharacter.objects.filter(
238
+ character_name__in=scan_data
239
+ ).exclude(corporation_id=1000001)
243
240
  except EveCharacter.DoesNotExist: # pylint: disable=no-member
244
241
  fetch_from_eveuniverse = True
245
242
  else:
@@ -249,7 +246,7 @@ def parse(scan_data: list, safe_to_db: bool = True) -> Union[Scan, dict]:
249
246
  if fetch_from_eveuniverse:
250
247
  try:
251
248
  eve_character_ids = (
252
- EveEntity.objects.fetch_by_names_esi(names=scan_data)
249
+ EveEntity.objects.fetch_by_names_esi(names=scan_data, update=True)
253
250
  .filter(category=EveEntity.CATEGORY_CHARACTER)
254
251
  .values_list("id", flat=True)
255
252
  )
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "aa-intel-tool"
7
- version = "0.0.1-alpha.4"
7
+ version = "0.0.1-alpha.6"
8
8
  description = "A simple parser for D-Scans and more for Alliance Auth"
9
9
  readme = "README.md"
10
10
  license = "GPL-3.0"
@@ -1,70 +0,0 @@
1
- """
2
- Django admin integration
3
- """
4
-
5
- # Django
6
- from django.contrib import admin
7
-
8
- # AA Intel Tool
9
- from aa_intel_tool.models import Scan
10
-
11
-
12
- class BaseReadOnlyAdminMixin:
13
- """
14
- Base "Read Only" mixin for admin models
15
- """
16
-
17
- actions = None # Removes the default delete action.
18
-
19
- def has_add_permission(self, request): # pylint: disable=unused-argument
20
- """
21
- Has "add" permissions
22
-
23
- :param request:
24
- :type request:
25
- :return:
26
- :rtype:
27
- """
28
-
29
- return False
30
-
31
- def has_change_permission(
32
- self, request, obj=None # pylint: disable=unused-argument
33
- ):
34
- """
35
- Has "change" permissions
36
-
37
- :param request:
38
- :type request:
39
- :param obj:
40
- :type obj:
41
- :return:
42
- :rtype:
43
- """
44
-
45
- return False
46
-
47
- def has_delete_permission(
48
- self, request, obj=None # pylint: disable=unused-argument
49
- ):
50
- """
51
- Has "delete" permissions
52
-
53
- :param request:
54
- :type request:
55
- :param obj:
56
- :type obj:
57
- :return:
58
- :rtype:
59
- """
60
-
61
- return False
62
-
63
-
64
- @admin.register(Scan)
65
- class ScanAdmin(BaseReadOnlyAdminMixin, admin.ModelAdmin):
66
- """
67
- Scan Admin
68
- """
69
-
70
- list_display = ("hash", "created")
File without changes