tradedangerous 11.0.4__py3-none-any.whl → 11.0.5__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/trade.py → trade.py +5 -12
- tradedangerous/plugins/spansh_plug.py +17 -20
- tradedangerous/version.py +1 -1
- {tradedangerous-11.0.4.dist-info → tradedangerous-11.0.5.dist-info}/METADATA +1 -1
- {tradedangerous-11.0.4.dist-info → tradedangerous-11.0.5.dist-info}/RECORD +10 -10
- tradedangerous-11.0.5.dist-info/entry_points.txt +3 -0
- {tradedangerous-11.0.4.dist-info → tradedangerous-11.0.5.dist-info}/top_level.txt +1 -0
- tradedangerous-11.0.4.dist-info/entry_points.txt +0 -3
- {tradedangerous-11.0.4.dist-info → tradedangerous-11.0.5.dist-info}/LICENSE +0 -0
- {tradedangerous-11.0.4.dist-info → tradedangerous-11.0.5.dist-info}/WHEEL +0 -0
- /tradedangerous/tradegui.py → /tradegui.py +0 -0
|
@@ -33,19 +33,12 @@
|
|
|
33
33
|
# DEVELOPERS: If you are a programmer who wants TD to do something
|
|
34
34
|
# cool, please see the TradeDB and TradeCalc modules. TD is designed
|
|
35
35
|
# to empower other programmers to do cool stuff.
|
|
36
|
-
from __future__ import annotations
|
|
37
|
-
|
|
38
36
|
from tradedangerous import cli
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def main(argv: list[tuple] = None) -> None:
|
|
44
|
-
""" Entry point for the TradeDangerous command-line app. """
|
|
45
|
-
if argv is None:
|
|
46
|
-
argv = sys.argv
|
|
47
|
-
cli.main(argv)
|
|
48
|
-
|
|
38
|
+
def main(argv = None):
|
|
39
|
+
import sys
|
|
40
|
+
cli.main(sys.argv)
|
|
49
41
|
|
|
50
42
|
if __name__ == "__main__":
|
|
51
|
-
|
|
43
|
+
import sys
|
|
44
|
+
cli.main(sys.argv)
|
|
@@ -294,19 +294,14 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
294
294
|
|
|
295
295
|
for station, commodities in stations:
|
|
296
296
|
fq_station_name = f'@{upper_sys}/{station.name}'
|
|
297
|
-
if age_cutoff and (now - station.modified) > age_cutoff:
|
|
298
|
-
if self.tdenv.detail:
|
|
299
|
-
self.print(f' | {fq_station_name:50s} | Skipping station due to age: {now - station.modified}, ts: {station.modified}')
|
|
300
|
-
progress.bump(sys_task)
|
|
301
|
-
continue
|
|
302
297
|
|
|
303
298
|
station_info = self.known_stations.get(station.id)
|
|
304
|
-
if not station_info:
|
|
299
|
+
if not station_info or station.modified > station_info[2]:
|
|
305
300
|
self.ensure_station(station)
|
|
306
301
|
elif station_info[1] != station.system_id:
|
|
307
302
|
self.print(f' | {station.name:50s} | Megaship station moved, updating system')
|
|
308
303
|
self.execute("UPDATE Station SET system_id = ? WHERE station_id = ?", station.system_id, station.id, commitable=True)
|
|
309
|
-
self.known_stations[station.id] = (station.name, station.system_id)
|
|
304
|
+
self.known_stations[station.id] = (station.name, station.system_id, station.modified)
|
|
310
305
|
|
|
311
306
|
items = []
|
|
312
307
|
db_times = dict(self.execute("SELECT item_id, modified FROM StationItem WHERE station_id = ?", station.id))
|
|
@@ -315,12 +310,19 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
315
310
|
if commodity.id not in self.known_commodities:
|
|
316
311
|
commodity = self.ensure_commodity(commodity)
|
|
317
312
|
|
|
313
|
+
# We're concerned with the market age, not the station age,
|
|
314
|
+
# as they each have their own 'modified' times.
|
|
315
|
+
if age_cutoff and (now - commodity.modified) > age_cutoff:
|
|
316
|
+
if self.tdenv.detail:
|
|
317
|
+
self.print(f' | {fq_station_name:50s} | Skipping station due to age: {now - station.modified}, ts: {station.modified}')
|
|
318
|
+
break
|
|
319
|
+
|
|
318
320
|
db_modified = db_times.get(commodity.id)
|
|
319
321
|
modified = parse_ts(db_modified) if db_modified else None
|
|
320
322
|
if modified and commodity.modified <= modified:
|
|
321
323
|
# All commodities in a station will have the same modified time,
|
|
322
324
|
# so no need to check the rest if the fist is older.
|
|
323
|
-
if self.tdenv.detail:
|
|
325
|
+
if self.tdenv.detail > 2:
|
|
324
326
|
self.print(f' | {fq_station_name:50s} | Skipping older commodity data')
|
|
325
327
|
break
|
|
326
328
|
items.append((station.id, commodity.id, commodity.modified,
|
|
@@ -337,8 +339,8 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
337
339
|
?, ?, ?, ?
|
|
338
340
|
)""", items, commitable=True)
|
|
339
341
|
commodity_count += len(items)
|
|
340
|
-
|
|
341
|
-
|
|
342
|
+
# Good time to save data and try to keep the transaction small
|
|
343
|
+
self.commit()
|
|
342
344
|
|
|
343
345
|
if commodity_count:
|
|
344
346
|
station_count += 1
|
|
@@ -360,12 +362,6 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
360
362
|
progress.update(f"{sys_desc}{DIM} ({total_station_count}:station:, {avg_stations:.1f}per:glowing_star:){CLOSE}")
|
|
361
363
|
|
|
362
364
|
self.commit()
|
|
363
|
-
|
|
364
|
-
# Need to make sure cached tables are updated, if changes were made
|
|
365
|
-
# if self.update_cache:
|
|
366
|
-
# for table in [ "Item", "Station", "System" ]:
|
|
367
|
-
# _, path = csvexport.exportTableToFile( self.tdb, self.tdenv, table )
|
|
368
|
-
|
|
369
365
|
self.tdb.close()
|
|
370
366
|
|
|
371
367
|
# Need to make sure cached tables are updated
|
|
@@ -445,7 +441,7 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
445
441
|
def load_known_stations(self) -> dict[int, tuple[str, int]]:
|
|
446
442
|
""" Returns a dictionary of {station_id -> (station_name, system_id)} for all current stations in the database. """
|
|
447
443
|
try:
|
|
448
|
-
return {cols[0]: (cols[1], cols[2]) for cols in self.cursor.execute('SELECT station_id, name, system_id FROM Station')}
|
|
444
|
+
return {cols[0]: (cols[1], cols[2], parse_ts(cols[3])) for cols in self.cursor.execute('SELECT station_id, name, system_id, modified FROM Station')}
|
|
449
445
|
except Exception as e: # pylint: disable=broad-except
|
|
450
446
|
self.print("[purple]:thinking_face:Assuming no station data yet")
|
|
451
447
|
self.tdenv.DEBUG0(f"load_known_stations query raised {e}")
|
|
@@ -477,7 +473,7 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
477
473
|
""" Adds a record for a station, and registers the station in the known_stations dict. """
|
|
478
474
|
self.execute(
|
|
479
475
|
'''
|
|
480
|
-
INSERT INTO Station (
|
|
476
|
+
INSERT OR REPLACE INTO Station (
|
|
481
477
|
system_id, station_id, name,
|
|
482
478
|
ls_from_star, max_pad_size,
|
|
483
479
|
market, blackmarket, shipyard, outfitting,
|
|
@@ -513,9 +509,10 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
513
509
|
station.type,
|
|
514
510
|
commitable=True,
|
|
515
511
|
)
|
|
512
|
+
note = "Updated" if self.known_stations.get(station.id) else "Added"
|
|
516
513
|
if self.tdenv.detail > 1:
|
|
517
|
-
self.print(f' | {station.name:50s} |
|
|
518
|
-
self.known_stations[station.id] = (station.name, station.system_id)
|
|
514
|
+
self.print(f' | {station.name:50s} | {note} station')
|
|
515
|
+
self.known_stations[station.id] = (station.name, station.system_id, station.modified)
|
|
519
516
|
|
|
520
517
|
def ensure_commodity(self, commodity: Commodity):
|
|
521
518
|
""" Adds a record for a commodity and registers the commodity in the known_commodities dict. """
|
tradedangerous/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tradedangerous
|
|
3
|
-
Version: 11.0.
|
|
3
|
+
Version: 11.0.5
|
|
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
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
trade.py,sha256=vBEJZR3Bybesw9FMelcHOTRA7KqKeH-4_wqbJ4VMB_E,1779
|
|
2
|
+
tradegui.py,sha256=q2HdIdoyeLUpeF2X0hVIGn7sU6T4zOzq1HN0zGvZdyE,788
|
|
1
3
|
tradedangerous/__init__.py,sha256=bwsbE_GyCNsuyGDKnfXAg0RD-ewsWHliySJ5QfCK7h8,1166
|
|
2
4
|
tradedangerous/cache.py,sha256=mROADjtCtSWkvR6crdl7SycBH0AjuaceagUj-x9RZDM,36071
|
|
3
5
|
tradedangerous/cli.py,sha256=dLekZ3MTbn9XcSGtE532qZF3iSnsb5G-ddQyErwTv9o,4559
|
|
@@ -13,15 +15,13 @@ tradedangerous/mapping.py,sha256=eGBQeYPD04Kq_ygZCDRafKMGz9EnxSgXUzQU-u78_2A,404
|
|
|
13
15
|
tradedangerous/prices.py,sha256=JqiDVrtvvPd5pqE3HdwOHOuFgdAbOR-pt0GLD3ZIXM8,7425
|
|
14
16
|
tradedangerous/submit-distances.py,sha256=EMpqxXFauo3oaR9OAnHCHCsrqwABK1nZdmg92m62zrk,11560
|
|
15
17
|
tradedangerous/tools.py,sha256=pp-4WtA12SVaaQHFJFOMTF7EDFRCU2mQeOhC4xoXmEk,1331
|
|
16
|
-
tradedangerous/trade.py,sha256=nGiTFj9ZrqeN9Xad3z8e4MpA2fNqYAcYMrZnwpnuus4,1938
|
|
17
18
|
tradedangerous/tradecalc.py,sha256=A7peEMiaCjlwFvReSq3E7_Ar0shUoFedQi83ZmOc7uY,42075
|
|
18
19
|
tradedangerous/tradedb.py,sha256=3nGB55dYs4igP3U3J4Ye1-M6Kt9A4xPAMmnX7JEDW7w,72220
|
|
19
20
|
tradedangerous/tradeenv.py,sha256=SDzRC6ERYZzzb_I6uexmFpFJJrnbzXa-1ogYt_GH26w,10576
|
|
20
21
|
tradedangerous/tradeexcept.py,sha256=aZ-Y31MbkjF7lmAzBAbaMsPPE7FEEfuf4gaX2GvriDk,368
|
|
21
|
-
tradedangerous/tradegui.py,sha256=q2HdIdoyeLUpeF2X0hVIGn7sU6T4zOzq1HN0zGvZdyE,788
|
|
22
22
|
tradedangerous/transfers.py,sha256=88gIvXpjd8T6NLxBrBRzmH2IfUmDDtiMcDTrc7qF3OI,7830
|
|
23
23
|
tradedangerous/utils.py,sha256=PUPvAEqUyxYGqqQa0b_yfLAvq8YVUxK6HfdS-CxM-Lo,5186
|
|
24
|
-
tradedangerous/version.py,sha256=
|
|
24
|
+
tradedangerous/version.py,sha256=Ruo3PXeo9RbLy-XofnontsIw0ImQFoMJhP0mTVqQ3Jg,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=_8vKu9e3tQy0HEPrnG8Ts0OoQ_kF6gZPQ9EOfTUd73w,2179
|
|
@@ -66,14 +66,14 @@ tradedangerous/plugins/eddblink_plug.py,sha256=EWJrVn5twwPVT-vGicmWuL4NAwf69G_0m
|
|
|
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=RoqCapz_nL4tqCJuN-mYDYbo99TlsXXZVwvTBXDhJNc,26801
|
|
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=VlQK7QGtEi2brGtWaIZDvKmbJ_vLocD4CJ8h_6kKptU,7808
|
|
74
|
-
tradedangerous-11.0.
|
|
75
|
-
tradedangerous-11.0.
|
|
76
|
-
tradedangerous-11.0.
|
|
77
|
-
tradedangerous-11.0.
|
|
78
|
-
tradedangerous-11.0.
|
|
79
|
-
tradedangerous-11.0.
|
|
74
|
+
tradedangerous-11.0.5.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
75
|
+
tradedangerous-11.0.5.dist-info/METADATA,sha256=H1ImbOKei8lEN5zMQ-7ocsKAKXYJ_BoDnh8fBbBZkCQ,4435
|
|
76
|
+
tradedangerous-11.0.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
77
|
+
tradedangerous-11.0.5.dist-info/entry_points.txt,sha256=lrA7U9JHOcNuam2WEK4Hmc3vQ3mrJfsbJCE74qd9au8,62
|
|
78
|
+
tradedangerous-11.0.5.dist-info/top_level.txt,sha256=JEoOVAhg5GfXZ4kHpNontu0RVzek_7P9_jp93f3Pqn8,16
|
|
79
|
+
tradedangerous-11.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|