aa-intel-tool 0.0.1a9__tar.gz → 0.0.1a10__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 (100) hide show
  1. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/PKG-INFO +10 -8
  2. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/README.md +9 -7
  3. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/app_settings.py +7 -0
  4. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/constants.py +5 -2
  5. aa_intel_tool-0.0.1a10/aa_intel_tool/migrations/0006_alter_scandata_unique_together.py +17 -0
  6. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/models.py +2 -0
  7. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/parser/module/dscan.py +96 -14
  8. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test-data/dscan-russian-client.txt +0 -7
  9. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test-data/dscan.txt +1 -1
  10. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test_app_settings.py +27 -0
  11. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/views/ajax.py +4 -9
  12. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/pyproject.toml +1 -1
  13. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/.gitignore +0 -0
  14. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/LICENSE +0 -0
  15. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/__init__.py +0 -0
  16. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/admin.py +0 -0
  17. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/apps.py +0 -0
  18. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/auth_hooks.py +0 -0
  19. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/exceptions.py +0 -0
  20. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/form.py +0 -0
  21. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/helper/data_structure.py +0 -0
  22. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/helper/eve_character.py +0 -0
  23. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/de/LC_MESSAGES/django.mo +0 -0
  24. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/de/LC_MESSAGES/django.po +0 -0
  25. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/django.pot +0 -0
  26. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/es/LC_MESSAGES/django.mo +0 -0
  27. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/es/LC_MESSAGES/django.po +0 -0
  28. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/fr_FR/LC_MESSAGES/django.po +0 -0
  29. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/it_IT/LC_MESSAGES/django.po +0 -0
  30. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/ja/LC_MESSAGES/django.po +0 -0
  31. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/ko_KR/LC_MESSAGES/django.po +0 -0
  32. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/ru/LC_MESSAGES/django.mo +0 -0
  33. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/ru/LC_MESSAGES/django.po +0 -0
  34. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/uk/LC_MESSAGES/django.po +0 -0
  35. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/locale/zh_Hans/LC_MESSAGES/django.po +0 -0
  36. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/management/commands/aa_intel_tool_load_eve_types.py +0 -0
  37. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/migrations/0001_initial.py +0 -0
  38. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/migrations/0002_remove_scan_processed_data_scandata.py +0 -0
  39. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/migrations/0003_alter_scandata_scan.py +0 -0
  40. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/migrations/0004_alter_scandata_section.py +0 -0
  41. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/migrations/0005_alter_scan_options_alter_scandata_options_and_more.py +0 -0
  42. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/migrations/__init__.py +0 -0
  43. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/parser/__init__.py +0 -0
  44. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/parser/general.py +0 -0
  45. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/parser/helper/db.py +0 -0
  46. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/parser/module/chatlist.py +0 -0
  47. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/parser/module/fleetcomp.py +0 -0
  48. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/providers.py +0 -0
  49. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/css/aa-bootstrap-fix.css +0 -0
  50. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/css/aa-bootstrap-fix.min.css +0 -0
  51. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/css/aa-intel-tool.css +0 -0
  52. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/css/aa-intel-tool.min.css +0 -0
  53. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan-highlight.js +0 -0
  54. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan-highlight.min.js +0 -0
  55. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.js +0 -0
  56. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.min.js +0 -0
  57. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-clipboard.js +0 -0
  58. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-clipboard.min.js +0 -0
  59. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan-highlight.js +0 -0
  60. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan-highlight.min.js +0 -0
  61. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.js +0 -0
  62. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.min.js +0 -0
  63. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool.js +0 -0
  64. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool.min.js +0 -0
  65. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tasks.py +0 -0
  66. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/base.html +0 -0
  67. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-chatscan-js.html +0 -0
  68. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-css.html +0 -0
  69. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-dscan-js.html +0 -0
  70. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-js-l10n.html +0 -0
  71. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-js.html +0 -0
  72. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/partials/body/scan-retention-note.html +0 -0
  73. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/partials/footer/app-translation-footer.html +0 -0
  74. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/partials/index/form.html +0 -0
  75. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/partials/scan/buttons.html +0 -0
  76. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/alliances.html +0 -0
  77. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/corporations.html +0 -0
  78. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/pilots.html +0 -0
  79. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ship-classes.html +0 -0
  80. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ship-types.html +0 -0
  81. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/partials/scan/evetime.html +0 -0
  82. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/views/index.html +0 -0
  83. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/views/scan/chatlist.html +0 -0
  84. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templates/aa_intel_tool/views/scan/dscan.html +0 -0
  85. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templatetags/__init__.py +0 -0
  86. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/templatetags/inteltool_versioned_static.py +0 -0
  87. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/__init__.py +0 -0
  88. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test-data/chatscan-faulty.txt +0 -0
  89. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test-data/chatscan.txt +0 -0
  90. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test-data/dscan-german-client.txt +0 -0
  91. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test-data/fleetcomp.txt +0 -0
  92. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test_access.py +0 -0
  93. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test_auth_hooks.py +0 -0
  94. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test_models.py +0 -0
  95. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test_parser.py +0 -0
  96. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/test_templatetags.py +0 -0
  97. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/tests/utils.py +0 -0
  98. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/urls.py +0 -0
  99. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/aa_intel_tool/views/__init__.py +0 -0
  100. {aa_intel_tool-0.0.1a9 → aa_intel_tool-0.0.1a10}/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.1a9
3
+ Version: 0.0.1a10
4
4
  Summary: A simple parser for D-Scans and more for Alliance Auth
5
5
  Project-URL: Changelog, https://github.com/ppfeufer/aa-intel-tool/blob/master/CHANGELOG.md
6
6
  Project-URL: Documentation, https://github.com/ppfeufer/aa-intel-tool/blob/master/README.md
@@ -254,13 +254,15 @@ Restart your Nginx service.
254
254
  To customize the app, the following settings are available and can be made in
255
255
  your `local.py`.
256
256
 
257
- | Name | Description | Default |
258
- |:----------------------------------|:-----------------------------------------------------------------------------------------------------------------|:--------|
259
- | INTELTOOL_ENABLE_MODULE_CHATSCAN | Enable or disable the chat scan module. | False |
260
- | INTELTOOL_ENABLE_MODULE_DSCAN | Enable or disable the d-scan module. | True |
261
- | INTELTOOL_ENABLE_MODULE_FLEETCOMP | Enable or disable the fleet composition module. | True |
262
- | INTELTOOL_SCAN_RETENTION_TIME | Sets the time in days for how long the scans will be kept in the database. Set to 0 to keep scans indefinitely. | 30 |
263
- | INTELTOOL_CHATSCAN_MAX_PILOTS | Sets the limit of pilots for chat scans, since these can take quite a long time to process. Set to 0 to disable. | 500 |
257
+ | Name | Description | Default |
258
+ |:----------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------|:--------|
259
+ | INTELTOOL_ENABLE_MODULE_CHATSCAN | Enable or disable the chat scan module. | False |
260
+ | INTELTOOL_ENABLE_MODULE_DSCAN | Enable or disable the d-scan module. | True |
261
+ | INTELTOOL_ENABLE_MODULE_FLEETCOMP | Enable or disable the fleet composition module. | True |
262
+ | INTELTOOL_SCAN_RETENTION_TIME | Set the time in days for how long the scans will be kept in the database. Set to 0 to keep scans indefinitely. | 30 |
263
+ | INTELTOOL_CHATSCAN_MAX_PILOTS | Set the limit of pilots for chat scans, since these can take quite a long time to process. Set to 0 to disable. | 500 |
264
+ | INTELTOOL_DSCAN_GRID_SIZE | Set the grid size for D-Scans. This defines <br/>the size of the grid in km in which ships and structures are considered to be "on grid" | 10000 |
265
+
264
266
 
265
267
  > **Note**
266
268
  >
@@ -221,13 +221,15 @@ Restart your Nginx service.
221
221
  To customize the app, the following settings are available and can be made in
222
222
  your `local.py`.
223
223
 
224
- | Name | Description | Default |
225
- |:----------------------------------|:-----------------------------------------------------------------------------------------------------------------|:--------|
226
- | INTELTOOL_ENABLE_MODULE_CHATSCAN | Enable or disable the chat scan module. | False |
227
- | INTELTOOL_ENABLE_MODULE_DSCAN | Enable or disable the d-scan module. | True |
228
- | INTELTOOL_ENABLE_MODULE_FLEETCOMP | Enable or disable the fleet composition module. | True |
229
- | INTELTOOL_SCAN_RETENTION_TIME | Sets the time in days for how long the scans will be kept in the database. Set to 0 to keep scans indefinitely. | 30 |
230
- | INTELTOOL_CHATSCAN_MAX_PILOTS | Sets the limit of pilots for chat scans, since these can take quite a long time to process. Set to 0 to disable. | 500 |
224
+ | Name | Description | Default |
225
+ |:----------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------|:--------|
226
+ | INTELTOOL_ENABLE_MODULE_CHATSCAN | Enable or disable the chat scan module. | False |
227
+ | INTELTOOL_ENABLE_MODULE_DSCAN | Enable or disable the d-scan module. | True |
228
+ | INTELTOOL_ENABLE_MODULE_FLEETCOMP | Enable or disable the fleet composition module. | True |
229
+ | INTELTOOL_SCAN_RETENTION_TIME | Set the time in days for how long the scans will be kept in the database. Set to 0 to keep scans indefinitely. | 30 |
230
+ | INTELTOOL_CHATSCAN_MAX_PILOTS | Set the limit of pilots for chat scans, since these can take quite a long time to process. Set to 0 to disable. | 500 |
231
+ | INTELTOOL_DSCAN_GRID_SIZE | Set the grid size for D-Scans. This defines <br/>the size of the grid in km in which ships and structures are considered to be "on grid" | 10000 |
232
+
231
233
 
232
234
  > **Note**
233
235
  >
@@ -50,3 +50,10 @@ class AppSettings: # pylint: disable=too-few-public-methods
50
50
  INTELTOOL_CHATSCAN_MAX_PILOTS = clean_setting(
51
51
  name="INTELTOOL_CHATSCAN_MAX_PILOTS", default_value=500, required_type=int
52
52
  )
53
+
54
+ # Set the grid size for D-Scans.
55
+ # This defines the size of teh grid in which ships and
56
+ # structure are considered to be "on grid"
57
+ INTELTOOL_DSCAN_GRID_SIZE = clean_setting(
58
+ name="INTELTOOL_DSCAN_GRID_SIZE", default_value=10000, required_type=int
59
+ )
@@ -18,6 +18,7 @@ from aa_intel_tool import __version__
18
18
  # All internal URLs need to start with this prefix
19
19
  INTERNAL_URL_PREFIX = "-"
20
20
 
21
+
21
22
  # Localised units
22
23
  distance_units_on_grid: str = """
23
24
  km|m # Latin (English, German and so on)
@@ -31,6 +32,7 @@ distance_units_off_grid: str = """
31
32
 
32
33
  distance_units = f"{distance_units_on_grid}|{distance_units_off_grid}"
33
34
 
35
+
34
36
  # Pre-compiled regex patterns used throughout the app
35
37
  REGEX_PATTERN = {
36
38
  # "chatlist": re.compile(pattern=r"(?im)^[a-zA-Z0-9\u0080-\uFFFF -_]{3,37}$"),
@@ -49,6 +51,8 @@ REGEX_PATTERN = {
49
51
  ),
50
52
  }
51
53
 
54
+
55
+ # Supported intel types and their parameters
52
56
  SUPPORTED_INTEL_TYPES = {
53
57
  # "chatlist": {
54
58
  # "name": _("Chat List"),
@@ -68,9 +72,8 @@ SUPPORTED_INTEL_TYPES = {
68
72
  }
69
73
 
70
74
 
75
+ # Building our user agent for ESI calls
71
76
  VERBOSE_NAME = "AA Intel Tool"
72
-
73
77
  verbose_name_slugified: str = slugify(VERBOSE_NAME, allow_unicode=True)
74
78
  github_url: str = "https://github.com/ppfeufer/aa-intel-tool"
75
-
76
79
  USER_AGENT = f"{verbose_name_slugified} v{__version__} {github_url}"
@@ -0,0 +1,17 @@
1
+ # Generated by Django 4.0.10 on 2023-08-22 18:41
2
+
3
+ # Django
4
+ from django.db import migrations
5
+
6
+
7
+ class Migration(migrations.Migration):
8
+ dependencies = [
9
+ ("aa_intel_tool", "0005_alter_scan_options_alter_scandata_options_and_more"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterUniqueTogether(
14
+ name="scandata",
15
+ unique_together={("scan", "section")},
16
+ ),
17
+ ]
@@ -147,3 +147,5 @@ class ScanData(models.Model):
147
147
  default_permissions = ()
148
148
  verbose_name = _("Scan data")
149
149
  verbose_name_plural = _("Scan data")
150
+
151
+ unique_together = ("scan", "section")
@@ -29,6 +29,33 @@ from aa_intel_tool.parser.helper.db import safe_scan_to_db
29
29
  logger = LoggerAddTag(my_logger=get_extension_logger(name=__name__), prefix=__title__)
30
30
 
31
31
 
32
+ def _is_on_grid(distance: str) -> bool:
33
+ """
34
+ Determine if something is "on grid" or not
35
+
36
+ :param distance:
37
+ :type distance:
38
+ :return:
39
+ :rtype:
40
+ """
41
+
42
+ # AA Intel Tool
43
+ from aa_intel_tool.constants import ( # pylint: disable=import-outside-toplevel
44
+ REGEX_PATTERN,
45
+ )
46
+
47
+ if re.search(pattern=REGEX_PATTERN["localised_on_grid"], string=distance):
48
+ # line = re.split(pattern=r" ", string=distance)
49
+ distance_sanitised = int(re.sub(r"[^0-9]", "", distance))
50
+
51
+ if distance_sanitised <= AppSettings.INTELTOOL_DSCAN_GRID_SIZE:
52
+ return True
53
+
54
+ return False
55
+
56
+ return False
57
+
58
+
32
59
  def _get_type_info_dict(eve_type: tuple) -> dict:
33
60
  """
34
61
  Get the eve_type info dict
@@ -53,9 +80,9 @@ def _get_type_info_dict(eve_type: tuple) -> dict:
53
80
  }
54
81
 
55
82
 
56
- def _parse_ships(eve_types: QuerySet, counter: dict) -> dict:
83
+ def _get_ships(eve_types: QuerySet, counter: dict) -> dict:
57
84
  """
58
- Parse ships
85
+ Get the ships
59
86
  This will be the content of the following tables in the D-Scan view:
60
87
  » All Ships
61
88
  » On Grid
@@ -103,6 +130,7 @@ def _parse_ships(eve_types: QuerySet, counter: dict) -> dict:
103
130
  "count": 0,
104
131
  }
105
132
 
133
+ # Add the count to the ship types
106
134
  ships["types"][eve_type[3]]["count"] += counter["all"][eve_type[0]]
107
135
 
108
136
  # Leaving this here just in case the method in the first loop turns out to be faulty
@@ -130,6 +158,38 @@ def _parse_ships(eve_types: QuerySet, counter: dict) -> dict:
130
158
  }
131
159
 
132
160
 
161
+ def _get_upwell_structures_on_grid(eve_types: QuerySet, dscan_list: list) -> list:
162
+ """
163
+ Get all Upwell structures that are on grid
164
+
165
+ :param eve_types:
166
+ :type eve_types:
167
+ :param counter:
168
+ :type counter:
169
+ :return:
170
+ :rtype:
171
+ """
172
+
173
+ eve_types_structures = eve_types.filter(
174
+ eve_group__eve_category_id__exact=EveCategoryId.STRUCTURE
175
+ )
176
+
177
+ structures_on_grid = {}
178
+
179
+ for item in dscan_list:
180
+ if eve_types_structures.filter(id=item[0]).exists() and _is_on_grid(item[3]):
181
+ if item[0] not in structures_on_grid:
182
+ structures_on_grid[item[0]] = {
183
+ "id": item[0],
184
+ "type": item[2],
185
+ "count": 0,
186
+ }
187
+
188
+ structures_on_grid[item[0]]["count"] += 1
189
+
190
+ return dict_to_list(structures_on_grid)
191
+
192
+
133
193
  def parse(scan_data: list) -> Scan:
134
194
  """
135
195
  Parse D-Scan
@@ -150,6 +210,8 @@ def parse(scan_data: list) -> Scan:
150
210
 
151
211
  counter = {"all": {}, "ongrid": {}, "offgrid": {}, "type": {}}
152
212
  eve_ids = {"all": [], "ongrid": [], "offgrid": []}
213
+ dscan_lines = []
214
+ parsed_data = {}
153
215
 
154
216
  # Let's split this list up
155
217
  #
@@ -179,32 +241,52 @@ def parse(scan_data: list) -> Scan:
179
241
 
180
242
  counter["all"][entry_id] += 1
181
243
  eve_ids["all"].append(entry_id)
244
+ dscan_lines.append([entry_id, line[1], line[2], line[3]])
182
245
 
183
246
  eve_types = EveType.objects.bulk_get_or_create_esi(
184
247
  ids=set(eve_ids["all"]), include_children=True
185
- ).values_list("id", "name", "eve_group__id", "eve_group__name")
248
+ ).values_list("id", "name", "eve_group__id", "eve_group__name", named=True)
186
249
 
187
250
  # Parse the data
188
- ships = _parse_ships(eve_types=eve_types, counter=counter)
251
+ ships = _get_ships(eve_types=eve_types, counter=counter)
252
+ upwell_structures = _get_upwell_structures_on_grid(
253
+ eve_types=eve_types, dscan_list=dscan_lines
254
+ )
189
255
 
190
- parsed_data = {
191
- "shiptypes": {
256
+ # Add "ship types" to parsed data when available
257
+ if len(ships["types"]):
258
+ parsed_data["shiptypes"] = {
192
259
  "section": ScanData.Section.SHIPTYPES,
193
260
  "data": ships["types"],
194
- },
195
- "all": {
261
+ }
262
+
263
+ # Add "ships all" to parsed data when available
264
+ if len(ships["all"]):
265
+ parsed_data["all"] = {
196
266
  "section": ScanData.Section.SHIPLIST,
197
267
  "data": ships["all"],
198
- },
199
- "ongrid": {
268
+ }
269
+
270
+ # Add "ships on grid" to parsed data when available
271
+ if len(ships["ongrid"]):
272
+ parsed_data["ongrid"] = {
200
273
  "section": ScanData.Section.SHIPLIST_ON_GRID,
201
274
  "data": ships["ongrid"],
202
- },
203
- "offgrid": {
275
+ }
276
+
277
+ # Add "ships off grid" to parsed data when available
278
+ if len(ships["offgrid"]):
279
+ parsed_data["offgrid"] = {
204
280
  "section": ScanData.Section.SHIPLIST_OFF_GRID,
205
281
  "data": ships["offgrid"],
206
- },
207
- }
282
+ }
283
+
284
+ # Add "Upwell structures on grid" to parsed data when available
285
+ if len(upwell_structures):
286
+ parsed_data["sructures_on_grid"] = {
287
+ "section": ScanData.Section.STRUCTURES_ON_GRID,
288
+ "data": upwell_structures,
289
+ }
208
290
 
209
291
  return safe_scan_to_db(scan_type=Scan.Type.DSCAN, parsed_data=parsed_data)
210
292
 
@@ -1,20 +1,13 @@
1
1
  35835 UC3H-Y - Harvester 1 Athanor* 444 141 км
2
- 35835 UC3H-Y - Wasser Athanor* 420 226 км
3
2
  35827 UC3H-Y - Factory 56 Sotiyo* 4 236 км
4
3
  670 ledu derhauer's Capsule Capsule* 1 943 км
5
4
  11963 cyno up Rapier* 1 903 км
6
5
  11129 ttjzj Gallente Shuttle* 1 898 км
7
6
  16 RD-G2R* Stargate (Caldari System)* 1 799 км
8
7
  35841 UC3H-Y » U-INPD - Way to the Light Ansiblex Jump Gate* 1 042 км
9
- 35833 UC3H-Y - Restart Fortizar* 603 км
10
8
  35840 UC3H-Y - The Bacon is Lit Pharolux Cyno Beacon* 594 км
11
- 35836 UC3H-Y - Refinery Tatara* 407 км
12
9
  28665 Vargur I Vargur* -
13
- 35835 UC3H-Y - Harvester 1 Athanor* 2,4 а.е.
14
- 35827 UC3H-Y - Factory 56 Sotiyo* 2,4 а.е.
15
- 35841 UC3H-Y » U-INPD - Way to the Light Ansiblex Jump Gate* 2,4 а.е.
16
10
  35833 UC3H-Y - Restart Fortizar* 2,4 а.е.
17
- 35840 UC3H-Y - The Bacon is Lit Pharolux Cyno Beacon* 2,4 а.е.
18
11
  35836 UC3H-Y - Refinery Tatara* 2,4 а.е.
19
12
  35835 UC3H-Y - Wasser Athanor* 2,4 а.е.
20
13
  11963 cyno up Rapier* -
@@ -7,7 +7,7 @@
7
7
  1529 Perimeter II - Moon 1 - Caldari Navy Assembly Plant Caldari Administrative Station 14.0 AU
8
8
  4023 Perimeter VII - Poksu Mineral Group Mineral Reserve Caldari Mining Station 12.1 AU
9
9
  35833 Perimeter - Tranquility Trading Tower Fortizar 3,808 km
10
- 35833 Perimeter - TEST War Headquarters Fortizar 5,209 km
10
+ 35833 Perimeter - TEST War Headquarters Fortizar 50,209 km
11
11
  12236 Gallente Control Tower Gallente Control Tower -
12
12
  20064 P7 M2 Blocker Gallente Control Tower Small -
13
13
  20064 P7 M1 Blocker Gallente Control Tower Small -
@@ -72,3 +72,30 @@ class TestAppSettings(TestCase):
72
72
  expected_max_pilots = 1000
73
73
 
74
74
  self.assertEqual(first=max_pilots, second=expected_max_pilots)
75
+
76
+ def test_dscan_grid_size(self):
77
+ """
78
+ Test for the default INTELTOOL_DSCAN_GRID_SIZE
79
+
80
+ :return:
81
+ :rtype:
82
+ """
83
+
84
+ grid_size = AppSettings.INTELTOOL_DSCAN_GRID_SIZE
85
+ expected_grid_size = 10000
86
+
87
+ self.assertEqual(first=grid_size, second=expected_grid_size)
88
+
89
+ @mock.patch(SETTINGS_PATH + ".AppSettings.INTELTOOL_DSCAN_GRID_SIZE", 1000)
90
+ def test_dscan_grid_size_custom(self):
91
+ """
92
+ Test for a custom INTELTOOL_DSCAN_GRID_SIZE
93
+
94
+ :return:
95
+ :rtype:
96
+ """
97
+
98
+ grid_size = AppSettings.INTELTOOL_DSCAN_GRID_SIZE
99
+ expected_grid_size = 1000
100
+
101
+ self.assertEqual(first=grid_size, second=expected_grid_size)
@@ -29,16 +29,11 @@ def get_scan_data(
29
29
  """
30
30
 
31
31
  try:
32
- scan_data = (
33
- ScanData.objects.filter( # pylint: disable=no-member
34
- scan_id__exact=scan_hash,
35
- section__exact=scan_section,
36
- )
37
- .exclude(section=ScanData.Section.INVALID)
38
- .get()
39
- )
32
+ scan_data = ScanData.objects.filter( # pylint: disable=no-member
33
+ scan_id__exact=scan_hash, section__exact=scan_section
34
+ ).get()
40
35
  processed_data = scan_data.processed_data
41
36
  except ScanData.DoesNotExist: # pylint: disable=no-member
42
- processed_data = None
37
+ processed_data = {}
43
38
 
44
39
  return JsonResponse(data=processed_data, safe=False)
@@ -6,7 +6,7 @@ requires = [
6
6
 
7
7
  [project]
8
8
  name = "aa-intel-tool"
9
- version = "0.0.1-alpha.9"
9
+ version = "0.0.1-alpha.10"
10
10
  description = "A simple parser for D-Scans and more for Alliance Auth"
11
11
  readme = "README.md"
12
12
  keywords = [