tradedangerous 11.0.4__tar.gz → 11.0.5__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.

Potentially problematic release.


This version of tradedangerous might be problematic. Click here for more details.

Files changed (97) hide show
  1. {tradedangerous-11.0.4/tradedangerous.egg-info → tradedangerous-11.0.5}/PKG-INFO +1 -1
  2. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/setup.py +3 -3
  3. {tradedangerous-11.0.4/tradedangerous → tradedangerous-11.0.5}/trade.py +5 -12
  4. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/plugins/spansh_plug.py +17 -20
  5. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/version.py +1 -1
  6. {tradedangerous-11.0.4 → tradedangerous-11.0.5/tradedangerous.egg-info}/PKG-INFO +1 -1
  7. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous.egg-info/SOURCES.txt +2 -2
  8. tradedangerous-11.0.5/tradedangerous.egg-info/entry_points.txt +3 -0
  9. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous.egg-info/top_level.txt +1 -0
  10. tradedangerous-11.0.4/tradedangerous.egg-info/entry_points.txt +0 -3
  11. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/LICENSE +0 -0
  12. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/README.md +0 -0
  13. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/pyproject.toml +0 -0
  14. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/setup.cfg +0 -0
  15. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tests/test_bootstrap_commands.py +0 -0
  16. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tests/test_bootstrap_plugins.py +0 -0
  17. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tests/test_cache.py +0 -0
  18. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tests/test_commands.py +0 -0
  19. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tests/test_fs.py +0 -0
  20. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tests/test_peek.py +0 -0
  21. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tests/test_tools.py +0 -0
  22. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tests/test_trade.py +0 -0
  23. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tests/test_trade_run.py +0 -0
  24. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tests/test_utils.py +0 -0
  25. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/__init__.py +0 -0
  26. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/cache.py +0 -0
  27. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/cli.py +0 -0
  28. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/TEMPLATE.py +0 -0
  29. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/__init__.py +0 -0
  30. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/buildcache_cmd.py +0 -0
  31. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/buy_cmd.py +0 -0
  32. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/commandenv.py +0 -0
  33. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/exceptions.py +0 -0
  34. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/export_cmd.py +0 -0
  35. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/import_cmd.py +0 -0
  36. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/local_cmd.py +0 -0
  37. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/market_cmd.py +0 -0
  38. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/nav_cmd.py +0 -0
  39. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/olddata_cmd.py +0 -0
  40. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/parsing.py +0 -0
  41. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/rares_cmd.py +0 -0
  42. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/run_cmd.py +0 -0
  43. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/sell_cmd.py +0 -0
  44. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/shipvendor_cmd.py +0 -0
  45. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/station_cmd.py +0 -0
  46. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/trade_cmd.py +0 -0
  47. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/update_cmd.py +0 -0
  48. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/commands/update_gui.py +0 -0
  49. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/corrections.py +0 -0
  50. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/csvexport.py +0 -0
  51. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/edscupdate.py +0 -0
  52. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/edsmupdate.py +0 -0
  53. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/formatting.py +0 -0
  54. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/fs.py +0 -0
  55. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/gui.py +0 -0
  56. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/jsonprices.py +0 -0
  57. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/mapping.py +0 -0
  58. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/mfd/__init__.py +0 -0
  59. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/mfd/saitek/__init__.py +0 -0
  60. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/mfd/saitek/directoutput.py +0 -0
  61. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/mfd/saitek/x52pro.py +0 -0
  62. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/checkpricebounds.py +0 -0
  63. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/clipboard.py +0 -0
  64. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/coord64.py +0 -0
  65. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/derp-sentinel.py +0 -0
  66. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/diff-system-csvs.py +0 -0
  67. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/eddb.py +0 -0
  68. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/eddn.py +0 -0
  69. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/edsc.py +0 -0
  70. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/edsm.py +0 -0
  71. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/importeddbstats.py +0 -0
  72. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/prices-json-exp.py +0 -0
  73. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/misc/progress.py +0 -0
  74. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/plugins/__init__.py +0 -0
  75. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/plugins/edapi_plug.py +0 -0
  76. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/plugins/edcd_plug.py +0 -0
  77. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/plugins/eddblink_plug.py +0 -0
  78. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/plugins/edmc_batch_plug.py +0 -0
  79. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/plugins/journal_plug.py +0 -0
  80. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/plugins/netlog_plug.py +0 -0
  81. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/prices.py +0 -0
  82. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/submit-distances.py +0 -0
  83. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/templates/Added.csv +0 -0
  84. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/templates/Category.csv +0 -0
  85. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/templates/RareItem.csv +0 -0
  86. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/templates/TradeDangerous.sql +0 -0
  87. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/tools.py +0 -0
  88. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/tradecalc.py +0 -0
  89. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/tradedb.py +0 -0
  90. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/tradeenv.py +0 -0
  91. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/tradeexcept.py +0 -0
  92. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/transfers.py +0 -0
  93. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous/utils.py +0 -0
  94. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous.egg-info/dependency_links.txt +0 -0
  95. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous.egg-info/not-zip-safe +0 -0
  96. {tradedangerous-11.0.4 → tradedangerous-11.0.5}/tradedangerous.egg-info/requires.txt +0 -0
  97. {tradedangerous-11.0.4/tradedangerous → tradedangerous-11.0.5}/tradegui.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tradedangerous
3
- Version: 11.0.4
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
@@ -30,7 +30,7 @@ setup(name = package,
30
30
  install_requires = ["requests", "appJar", "ijson", "rich"],
31
31
  setup_requires = ["pytest-runner"],
32
32
  tests_require = ["pytest"],
33
- packages = ['tradedangerous', 'tradedangerous.commands', 'tradedangerous.mfd', 'tradedangerous.mfd.saitek', 'tradedangerous.misc', 'tradedangerous.plugins'],
33
+ packages = ['.', 'tradedangerous', 'tradedangerous.commands', 'tradedangerous.mfd', 'tradedangerous.mfd.saitek', 'tradedangerous.misc', 'tradedangerous.plugins'],
34
34
  url = "https://github.com/eyeonus/Trade-Dangerous",
35
35
  project_urls = {
36
36
  "Bug Tracker": "https://github.com/eyeonus/Trade-Dangerous/issues",
@@ -57,8 +57,8 @@ setup(name = package,
57
57
  package_data = {"tradedangerous": ["templates/TradeDangerous.sql", "templates/Added.csv", "templates/Category.csv", "templates/RareItem.csv"]},
58
58
  entry_points = {
59
59
  "console_scripts": [
60
- "trade=tradedangerous.trade:main",
61
- "tradegui=tradedangerous.tradegui:main"
60
+ "trade=trade:main",
61
+ "tradegui=tradegui:main"
62
62
  ]
63
63
  },
64
64
  zip_safe = False
@@ -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
- import sys
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
- cli.main(sys.argv)
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
- # Good time to save data and try to keep the transaction small
341
- self.commit()
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} | Added missing station')
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. """
@@ -12,5 +12,5 @@
12
12
  """just keeper of current version"""
13
13
 
14
14
  # TODO: remember to update tests when version changes
15
- __version__ = '11.0.4'
15
+ __version__ = '11.0.5'
16
16
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tradedangerous
3
- Version: 11.0.4
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
@@ -3,6 +3,8 @@ README.md
3
3
  pyproject.toml
4
4
  setup.cfg
5
5
  setup.py
6
+ trade.py
7
+ tradegui.py
6
8
  tests/test_bootstrap_commands.py
7
9
  tests/test_bootstrap_plugins.py
8
10
  tests/test_cache.py
@@ -28,12 +30,10 @@ tradedangerous/mapping.py
28
30
  tradedangerous/prices.py
29
31
  tradedangerous/submit-distances.py
30
32
  tradedangerous/tools.py
31
- tradedangerous/trade.py
32
33
  tradedangerous/tradecalc.py
33
34
  tradedangerous/tradedb.py
34
35
  tradedangerous/tradeenv.py
35
36
  tradedangerous/tradeexcept.py
36
- tradedangerous/tradegui.py
37
37
  tradedangerous/transfers.py
38
38
  tradedangerous/utils.py
39
39
  tradedangerous/version.py
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ trade = trade:main
3
+ tradegui = tradegui:main
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- trade = tradedangerous.trade:main
3
- tradegui = tradedangerous.tradegui:main
File without changes