tradedangerous 11.5.0__py3-none-any.whl → 11.5.2__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.
Potentially problematic release.
This version of tradedangerous might be problematic. Click here for more details.
- tradedangerous/commands/commandenv.py +9 -5
- tradedangerous/plugins/spansh_plug.py +26 -6
- tradedangerous/version.py +1 -1
- {tradedangerous-11.5.0.dist-info → tradedangerous-11.5.2.dist-info}/METADATA +1 -1
- {tradedangerous-11.5.0.dist-info → tradedangerous-11.5.2.dist-info}/RECORD +9 -9
- {tradedangerous-11.5.0.dist-info → tradedangerous-11.5.2.dist-info}/LICENSE +0 -0
- {tradedangerous-11.5.0.dist-info → tradedangerous-11.5.2.dist-info}/WHEEL +0 -0
- {tradedangerous-11.5.0.dist-info → tradedangerous-11.5.2.dist-info}/entry_points.txt +0 -0
- {tradedangerous-11.5.0.dist-info → tradedangerous-11.5.2.dist-info}/top_level.txt +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import sqlite3
|
|
2
|
+
|
|
1
3
|
from .exceptions import (
|
|
2
4
|
CommandLineError, FleetCarrierError, OdysseyError,
|
|
3
5
|
PadSizeError, PlanetaryError,
|
|
@@ -72,11 +74,13 @@ class CommandEnv(TradeEnv):
|
|
|
72
74
|
self.tdb = tdb
|
|
73
75
|
db_change = pathlib.Path(self.tdb.templatePath, 'database_changes.json')
|
|
74
76
|
if pathlib.Path.exists(db_change):
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
try:
|
|
78
|
+
import ijson
|
|
79
|
+
with open(db_change) as file:
|
|
80
|
+
for change in ijson.items(file, 'item'):
|
|
81
|
+
self.tdb.getDB().execute(change)
|
|
82
|
+
finally:
|
|
83
|
+
db_change.unlink()
|
|
80
84
|
|
|
81
85
|
self.checkMFD()
|
|
82
86
|
self.checkFromToNear()
|
|
@@ -4,16 +4,18 @@ from __future__ import annotations
|
|
|
4
4
|
from collections import namedtuple
|
|
5
5
|
from contextlib import contextmanager
|
|
6
6
|
from datetime import datetime, timedelta
|
|
7
|
+
from email.utils import parsedate_to_datetime
|
|
7
8
|
from pathlib import Path
|
|
8
9
|
from rich.progress import Progress
|
|
9
10
|
|
|
10
11
|
from .. import plugins, cache, transfers, csvexport, corrections
|
|
11
12
|
|
|
13
|
+
import os
|
|
14
|
+
import requests
|
|
12
15
|
import sqlite3
|
|
13
16
|
import sys
|
|
14
17
|
import time
|
|
15
18
|
import typing
|
|
16
|
-
|
|
17
19
|
import ijson
|
|
18
20
|
|
|
19
21
|
if sys.version_info.major == 3 and sys.version_info.minor >= 10:
|
|
@@ -277,14 +279,32 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
277
279
|
|
|
278
280
|
theme = self.tdenv.theme
|
|
279
281
|
BOLD, CLOSE, DIM, ITALIC = theme.bold, theme.CLOSE, theme.dim, theme.italic # pylint: disable=invalid-name
|
|
280
|
-
# TODO: don't download file if local copy is not older
|
|
281
|
-
# see eddblink_plug.download_file()
|
|
282
282
|
if not self.file:
|
|
283
283
|
url = self.url or SOURCE_URL
|
|
284
|
-
|
|
284
|
+
local_mod_time = 0
|
|
285
285
|
self.file = Path(self.tdenv.tmpDir, "galaxy_stations.json")
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
if self.file.exists():
|
|
287
|
+
local_mod_time = self.file.stat().st_mtime
|
|
288
|
+
|
|
289
|
+
headers = {"User-Agent": "Trade-Dangerous", "Accept-Encoding": "identity"}
|
|
290
|
+
try:
|
|
291
|
+
response = requests.head(url, headers=headers, timeout=70)
|
|
292
|
+
except Exception as e: # pylint: disable=broad-exception-caught
|
|
293
|
+
self.tdenv.WARN("Problem with download:\n URL: {}\n Error: {}", url, str(e))
|
|
294
|
+
return False
|
|
295
|
+
last_modified = response.headers.get("last-modified")
|
|
296
|
+
dump_mod_time = parsedate_to_datetime(last_modified).timestamp()
|
|
297
|
+
if local_mod_time < dump_mod_time:
|
|
298
|
+
if self.file.exists():
|
|
299
|
+
self.file.unlink()
|
|
300
|
+
self.print(f'Downloading prices from remote URL: {url}')
|
|
301
|
+
try:
|
|
302
|
+
transfers.download(self.tdenv, url, self.file)
|
|
303
|
+
except Exception as e: # pylint: disable=broad-exception-caught
|
|
304
|
+
self.tdenv.WARN("Problem with download:\n URL: {}\n Error: {}", url, str(e))
|
|
305
|
+
return False
|
|
306
|
+
self.print(f'Download complete, saved to local file: "{self.file}"')
|
|
307
|
+
os.utime(self.file, (dump_mod_time, dump_mod_time))
|
|
288
308
|
|
|
289
309
|
sys_desc = f"Importing {ITALIC}spansh{CLOSE} data"
|
|
290
310
|
|
tradedangerous/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tradedangerous
|
|
3
|
-
Version: 11.5.
|
|
3
|
+
Version: 11.5.2
|
|
4
4
|
Summary: Trade-Dangerous is a set of powerful trading tools for Elite Dangerous, organized around one of the most powerful trade run optimizers available.
|
|
5
5
|
Home-page: https://github.com/eyeonus/Trade-Dangerous
|
|
6
6
|
Author: eyeonus
|
|
@@ -21,12 +21,12 @@ tradedangerous/tradeenv.py,sha256=aIeK291Ene98kaEEu1LvlJ4KT4EvPfIXlT4IfZnpVc0,11
|
|
|
21
21
|
tradedangerous/tradeexcept.py,sha256=aZ-Y31MbkjF7lmAzBAbaMsPPE7FEEfuf4gaX2GvriDk,368
|
|
22
22
|
tradedangerous/transfers.py,sha256=t_0Sjr4FI9lhIPwyPOXdR8d97bE611ujbKK4ioWShm0,6024
|
|
23
23
|
tradedangerous/utils.py,sha256=PUPvAEqUyxYGqqQa0b_yfLAvq8YVUxK6HfdS-CxM-Lo,5186
|
|
24
|
-
tradedangerous/version.py,sha256=
|
|
24
|
+
tradedangerous/version.py,sha256=fz4ryPywxoVGOSsaRzrb_isVjrC3EkOFzHQj6J5dLCo,646
|
|
25
25
|
tradedangerous/commands/TEMPLATE.py,sha256=MOE69xsZPHPIMBQ-LXicfsOlCZdy-2gPX_nlnwYYil8,2026
|
|
26
26
|
tradedangerous/commands/__init__.py,sha256=3gz2cnXNZNkV1gtZh0dOnCRxBkQHbeIyysRe3bM2WEE,9516
|
|
27
27
|
tradedangerous/commands/buildcache_cmd.py,sha256=jhNSqHX_xX43SiSUMFiKtWpB9v4oeZ0sqfNq6DCrjUs,2181
|
|
28
28
|
tradedangerous/commands/buy_cmd.py,sha256=qgOBTzCvcYgLOcdkx7BpqF-rSs6GFjOL_f3Gzutmx1I,13947
|
|
29
|
-
tradedangerous/commands/commandenv.py,sha256=
|
|
29
|
+
tradedangerous/commands/commandenv.py,sha256=72hEqaZzUBsTiYzkJrGP6Z1EN7WyvyZrKHxlRQNp--4,9868
|
|
30
30
|
tradedangerous/commands/exceptions.py,sha256=sisGoBvOpt25TYWWjp-s-k_--O_nZe5Zd9HhAW3SElA,3487
|
|
31
31
|
tradedangerous/commands/export_cmd.py,sha256=VfxwrNU_TzrSw71KrmtmXKYCBkpDGr5KRLGPXOBewnI,4405
|
|
32
32
|
tradedangerous/commands/import_cmd.py,sha256=PKMrO1DhOGkqAn_q9vZBxhogpFL5MHp2JyYb4qiBdq0,5633
|
|
@@ -66,15 +66,15 @@ tradedangerous/plugins/eddblink_plug.py,sha256=dyVaQhpElq7ceLD0bJhVeuiZoMu8Jdo3Y
|
|
|
66
66
|
tradedangerous/plugins/edmc_batch_plug.py,sha256=rrP_lFFxWsba8DPEo0WF2EdCiMoRC7tCT8z62MIvtIo,4173
|
|
67
67
|
tradedangerous/plugins/journal_plug.py,sha256=5HMyoxQ7z42qj7NiL8rDxSyTN9gKikoQjyWzJLD-SYQ,23746
|
|
68
68
|
tradedangerous/plugins/netlog_plug.py,sha256=yUl47l9xt3kGj9oSiY_FZaDGdnQj63oa9MBtSeIy1Zo,13469
|
|
69
|
-
tradedangerous/plugins/spansh_plug.py,sha256=
|
|
69
|
+
tradedangerous/plugins/spansh_plug.py,sha256=PXFarH_i0QASrIoTpkYjq27ZgeRqGSH9sac5OqYLMLU,38028
|
|
70
70
|
tradedangerous/templates/Added.csv,sha256=8o54civQCcS9y7_DBo0GX196XWRbbREQqKDYTKibsgQ,649
|
|
71
71
|
tradedangerous/templates/Category.csv,sha256=8xwUDcBZE25T6x6dZGlRUMTCqeDLt3a9LXU5h6hRHV8,250
|
|
72
72
|
tradedangerous/templates/RareItem.csv,sha256=F1RhRnTD82PiwrVUO-ai2ErGH2PTqNnQaDw5mcgljXs,10483
|
|
73
73
|
tradedangerous/templates/TradeDangerous.sql,sha256=XJ0T09OiS9UdYKJXXAG-rCe6T_ua4MU-icb2lD7iEz0,9342
|
|
74
74
|
tradedangerous/templates/database_changes.json,sha256=-KszgXhUUhwI7FRPDxnkV3bv9paXGpTgnUZxZN7i5OA,371
|
|
75
|
-
tradedangerous-11.5.
|
|
76
|
-
tradedangerous-11.5.
|
|
77
|
-
tradedangerous-11.5.
|
|
78
|
-
tradedangerous-11.5.
|
|
79
|
-
tradedangerous-11.5.
|
|
80
|
-
tradedangerous-11.5.
|
|
75
|
+
tradedangerous-11.5.2.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
76
|
+
tradedangerous-11.5.2.dist-info/METADATA,sha256=ipZGrNpBEb6tAX_4qQjGNYtEf-ZDd0wvhv8hr8UUu94,4435
|
|
77
|
+
tradedangerous-11.5.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
78
|
+
tradedangerous-11.5.2.dist-info/entry_points.txt,sha256=lrA7U9JHOcNuam2WEK4Hmc3vQ3mrJfsbJCE74qd9au8,62
|
|
79
|
+
tradedangerous-11.5.2.dist-info/top_level.txt,sha256=JEoOVAhg5GfXZ4kHpNontu0RVzek_7P9_jp93f3Pqn8,16
|
|
80
|
+
tradedangerous-11.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|