tradedangerous 11.1.6__tar.gz → 11.2.1__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 (96) hide show
  1. {tradedangerous-11.1.6/tradedangerous.egg-info → tradedangerous-11.2.1}/PKG-INFO +1 -1
  2. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/trade.py +0 -0
  3. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/parsing.py +0 -4
  4. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/shipvendor_cmd.py +2 -0
  5. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/station_cmd.py +1 -0
  6. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/trade_cmd.py +1 -1
  7. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/update_cmd.py +1 -0
  8. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/update_gui.py +1 -0
  9. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/edscupdate.py +1 -0
  10. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/edsmupdate.py +1 -0
  11. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/jsonprices.py +1 -0
  12. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/mapping.py +2 -1
  13. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/plugins/eddblink_plug.py +15 -21
  14. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/submit-distances.py +2 -0
  15. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/tradeenv.py +34 -0
  16. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/transfers.py +4 -52
  17. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/version.py +1 -1
  18. {tradedangerous-11.1.6 → tradedangerous-11.2.1/tradedangerous.egg-info}/PKG-INFO +1 -1
  19. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/LICENSE +0 -0
  20. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/README.md +0 -0
  21. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/pyproject.toml +0 -0
  22. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/setup.cfg +0 -0
  23. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/setup.py +0 -0
  24. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tests/test_bootstrap_commands.py +0 -0
  25. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tests/test_bootstrap_plugins.py +0 -0
  26. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tests/test_cache.py +0 -0
  27. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tests/test_commands.py +0 -0
  28. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tests/test_fs.py +0 -0
  29. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tests/test_peek.py +0 -0
  30. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tests/test_tools.py +0 -0
  31. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tests/test_trade.py +0 -0
  32. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tests/test_trade_run.py +0 -0
  33. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tests/test_utils.py +0 -0
  34. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/__init__.py +0 -0
  35. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/cache.py +0 -0
  36. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/cli.py +0 -0
  37. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/TEMPLATE.py +0 -0
  38. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/__init__.py +0 -0
  39. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/buildcache_cmd.py +0 -0
  40. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/buy_cmd.py +0 -0
  41. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/commandenv.py +0 -0
  42. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/exceptions.py +0 -0
  43. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/export_cmd.py +0 -0
  44. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/import_cmd.py +0 -0
  45. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/local_cmd.py +0 -0
  46. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/market_cmd.py +0 -0
  47. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/nav_cmd.py +0 -0
  48. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/olddata_cmd.py +0 -0
  49. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/rares_cmd.py +0 -0
  50. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/run_cmd.py +0 -0
  51. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/commands/sell_cmd.py +0 -0
  52. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/corrections.py +0 -0
  53. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/csvexport.py +0 -0
  54. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/formatting.py +0 -0
  55. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/fs.py +0 -0
  56. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/gui.py +0 -0
  57. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/mfd/__init__.py +0 -0
  58. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/mfd/saitek/__init__.py +0 -0
  59. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/mfd/saitek/directoutput.py +0 -0
  60. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/mfd/saitek/x52pro.py +0 -0
  61. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/checkpricebounds.py +0 -0
  62. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/clipboard.py +0 -0
  63. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/coord64.py +0 -0
  64. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/derp-sentinel.py +0 -0
  65. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/diff-system-csvs.py +0 -0
  66. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/eddb.py +0 -0
  67. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/eddn.py +0 -0
  68. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/edsc.py +0 -0
  69. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/edsm.py +0 -0
  70. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/importeddbstats.py +0 -0
  71. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/prices-json-exp.py +0 -0
  72. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/misc/progress.py +0 -0
  73. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/plugins/__init__.py +0 -0
  74. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/plugins/edapi_plug.py +0 -0
  75. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/plugins/edcd_plug.py +0 -0
  76. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/plugins/edmc_batch_plug.py +0 -0
  77. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/plugins/journal_plug.py +0 -0
  78. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/plugins/netlog_plug.py +0 -0
  79. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/plugins/spansh_plug.py +0 -0
  80. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/prices.py +0 -0
  81. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/templates/Added.csv +0 -0
  82. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/templates/Category.csv +0 -0
  83. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/templates/RareItem.csv +0 -0
  84. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/templates/TradeDangerous.sql +0 -0
  85. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/tools.py +0 -0
  86. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/tradecalc.py +0 -0
  87. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/tradedb.py +0 -0
  88. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/tradeexcept.py +0 -0
  89. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous/utils.py +0 -0
  90. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous.egg-info/SOURCES.txt +0 -0
  91. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous.egg-info/dependency_links.txt +0 -0
  92. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous.egg-info/entry_points.txt +0 -0
  93. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous.egg-info/not-zip-safe +0 -0
  94. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous.egg-info/requires.txt +0 -0
  95. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradedangerous.egg-info/top_level.txt +0 -0
  96. {tradedangerous-11.1.6 → tradedangerous-11.2.1}/tradegui.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tradedangerous
3
- Version: 11.1.6
3
+ Version: 11.2.1
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
@@ -60,7 +60,6 @@ class PadSizeArgument(int):
60
60
  'dest': 'padSize',
61
61
  'metavar': 'PADSIZES',
62
62
  'type': 'padsize',
63
- 'choices': 'SsMmLl?',
64
63
  }
65
64
 
66
65
 
@@ -153,7 +152,6 @@ class PlanetaryArgument(int):
153
152
  'dest': 'planetary',
154
153
  'metavar': 'PLANETARY',
155
154
  'type': 'planetary',
156
- 'choices': 'YyNn?',
157
155
  }
158
156
 
159
157
 
@@ -181,7 +179,6 @@ class FleetCarrierArgument(int):
181
179
  'dest': 'fleet',
182
180
  'metavar': 'FLEET',
183
181
  'type': 'fleet',
184
- 'choices': 'YyNn?',
185
182
  }
186
183
 
187
184
  class OdysseyArgument(int):
@@ -208,7 +205,6 @@ class OdysseyArgument(int):
208
205
  'dest': 'odyssey',
209
206
  'metavar': 'ODYSSEY',
210
207
  'type': 'odyssey',
211
- 'choices': 'YyNn?',
212
208
  }
213
209
 
214
210
 
@@ -1,3 +1,5 @@
1
+ # Deprecated
2
+ # Can already use buy command for ship searching
1
3
  from .commandenv import ResultRow
2
4
  from .exceptions import CommandLineError
3
5
  from .parsing import MutuallyExclusiveGroup, ParseArgument
@@ -1,3 +1,4 @@
1
+ # Deprecated
1
2
  from .commandenv import ResultRow
2
3
  from .exceptions import CommandLineError
3
4
  from .parsing import MutuallyExclusiveGroup, ParseArgument
@@ -6,7 +6,7 @@ from ..formatting import RowFormat, max_len
6
6
  ######################################################################
7
7
  # Parser config
8
8
 
9
- help='Find places to buy a given item within range of a given station.'
9
+ help='Find potential trades between two given stations.'
10
10
  name='trade'
11
11
  epilog=None
12
12
  wantsTradeDB=True
@@ -1,3 +1,4 @@
1
+ # Deprecated
1
2
  from .parsing import MutuallyExclusiveGroup, ParseArgument
2
3
  from ..tradeexcept import TradeException
3
4
  from .exceptions import CommandLineError
@@ -1,3 +1,4 @@
1
+ # Deprecated
1
2
  import tkinter as tk
2
3
  import tkinter.messagebox as mbox
3
4
  import sqlite3
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env python3.6
2
+ # Deprecated
2
3
 
3
4
  """
4
5
  This tool looks for changes in the EDSC service since the most
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env python3.6
2
+ # Deprecated
2
3
 
3
4
  """
4
5
  based on edscupdate.py without the submit_distance()
@@ -1,3 +1,4 @@
1
+ # Deprecated
1
2
  from tradedangerous import tradedb
2
3
  from tradedangerous.tradeexcept import TradeException
3
4
 
@@ -1,7 +1,8 @@
1
1
  #
2
2
  # Mapping class for FDEV-IDs to TD names
3
3
  #
4
-
4
+ # Deprecated
5
+ # FDEVMappingItems and FDEVMappingShips used by edapi plugin
5
6
  class FDEVMappingBase:
6
7
  """
7
8
  Base class to map FDEV-IDs to TD names, do not use directly.
@@ -118,6 +118,7 @@ class ImportPlugin(plugins.ImportPluginBase):
118
118
  'force': "Force regeneration of selected items even if source file not updated since previous run. "
119
119
  "(Useful for updating Vendor tables if they were skipped during a '-O clean' run.)",
120
120
  'purge': "Remove any empty systems that previously had fleet carriers.",
121
+ 'optimize': "Optimize ('vacuum') database after processing.",
121
122
  'solo': "Don't download crowd-sourced market data. (Implies '-O skipvend', supercedes '-O all', '-O clean', '-O listings'.)",
122
123
  }
123
124
 
@@ -197,22 +198,10 @@ class ImportPlugin(plugins.ImportPluginBase):
197
198
  db = self.tdb.getDB()
198
199
  self.tdenv.NOTE("Purging Systems with no stations: Start time = {}", self.now())
199
200
 
200
- db.execute("PRAGMA foreign_keys = OFF")
201
-
202
- self.tdenv.DEBUG0("Saving systems with stations.... " + str(self.now()) + "\t\t\t\t", end="\r")
203
- db.execute("DROP TABLE IF EXISTS System_copy")
204
- db.execute("""CREATE TABLE System_copy AS SELECT * FROM System
205
- WHERE system_id IN (SELECT system_id FROM Station)
206
- """)
207
-
208
- self.tdenv.DEBUG0("Erasing table and reinserting kept systems.... " + str(self.now()) + "\t\t\t\t", end="\r")
209
- db.execute("DELETE FROM System")
210
- db.execute("INSERT INTO System SELECT * FROM System_copy")
211
-
212
- self.tdenv.DEBUG0("Removing copy.... " + str(self.now()) + "\t\t\t\t", end="\r")
213
- db.execute("PRAGMA foreign_keys = ON")
214
- db.execute("DROP TABLE IF EXISTS System_copy")
215
-
201
+ db.execute("""
202
+ DELETE FROM System
203
+ WHERE NOT EXISTS(SELECT 1 FROM Station WHERE Station.system_id = System.system_id)
204
+ """)
216
205
  db.commit()
217
206
 
218
207
  self.tdenv.NOTE("Finished purging Systems. End time = {}", self.now())
@@ -349,7 +338,7 @@ class ImportPlugin(plugins.ImportPluginBase):
349
338
 
350
339
  # We can probably safely assume that the plugin
351
340
  # has never been run if the db file doesn't exist.
352
- if not (self.tdb.dataPath / Path("TradeDangerous.db")).exists():
341
+ if not self.tdb.dbPath.exists():
353
342
  self.options["clean"] = True
354
343
 
355
344
  if self.getOption("clean"):
@@ -392,8 +381,11 @@ class ImportPlugin(plugins.ImportPluginBase):
392
381
  if rib_path.exists():
393
382
  rib_path.unlink()
394
383
  ri_path.rename(rib_path)
395
-
384
+
385
+ self.tdb.close()
386
+
396
387
  self.tdb.reloadCache()
388
+ self.tdb.close()
397
389
 
398
390
  # Now it's safe to move RareItems back.
399
391
  if ri_path.exists():
@@ -451,7 +443,7 @@ class ImportPlugin(plugins.ImportPluginBase):
451
443
  if self.downloadFile(self.upgradesPath) or self.getOption("force"):
452
444
  transfers.download(self.tdenv, self.urlOutfitting, self.FDevOutfittingPath)
453
445
  buildCache = True
454
-
446
+
455
447
  if self.getOption("ship"):
456
448
  if self.downloadFile(self.shipPath) or self.getOption("force"):
457
449
  transfers.download(self.tdenv, self.urlShipyard, self.FDevShipyardPath)
@@ -486,16 +478,18 @@ class ImportPlugin(plugins.ImportPluginBase):
486
478
  if buildCache:
487
479
  self.tdb.close()
488
480
  self.tdb.reloadCache()
489
-
481
+ self.tdb.close()
482
+
490
483
  if self.getOption("purge"):
491
484
  self.purgeSystems()
485
+ self.tdb.close()
492
486
 
493
487
  if self.getOption("listings"):
494
488
  if self.downloadFile(self.listingsPath) or self.getOption("force"):
495
489
  self.importListings(self.listingsPath)
496
490
  if self.downloadFile(self.liveListingsPath) or self.getOption("force"):
497
491
  self.importListings(self.liveListingsPath)
498
-
492
+
499
493
  if self.getOption("listings"):
500
494
  self.tdenv.NOTE("Regenerating .prices file.")
501
495
  cache.regeneratePricesFile(self.tdb, self.tdenv)
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env python3.6
2
+ # Deprecated
3
+ # Website no longer exists
2
4
 
3
5
  """
4
6
  Small tool to submit new star data to EDStarCoordinator.
@@ -2,6 +2,7 @@
2
2
  # into a single object, the TradeEnv. See TradeEnv docstring for more.
3
3
  from __future__ import annotations
4
4
 
5
+ from pathlib import Path
5
6
  import os
6
7
  import sys
7
8
  import traceback
@@ -270,3 +271,36 @@ class TradeEnv(Utf8SafeConsoleIOMixin):
270
271
  return noteFn
271
272
 
272
273
  return None
274
+
275
+ def remove_file(self, *args) -> bool:
276
+ """ Unlinks a file, as long as it exists, and logs the action at level 1. """
277
+ path = Path(*args)
278
+ if not path.exists():
279
+ return False
280
+ path.unlink()
281
+ self.DEBUG1(":cross_mark: deleted {}", path)
282
+ return True
283
+
284
+ def rename_file(self, *, old: os.PathLike, new: os.PathLike) -> bool:
285
+ """
286
+ If 'new' exists, deletes it, and then attempts to rename old -> new. If new is not specified,
287
+ then '.old' is appended to the end of the old filename while retaining the original suffix.
288
+
289
+ :param old: The current path/name of the file.
290
+ :param new: The path/name to rename the file to and remove before attempting.
291
+ :returns: True if the file existed and was renamed.
292
+ """
293
+ # Promote new to a guaranteed Path and remove it if it's present.
294
+ new = Path(new)
295
+ self.remove_file(new)
296
+
297
+ # Promote new to a guaranteed Path and confirm it exists.
298
+ old = Path(old)
299
+ if not old.exists():
300
+ return False
301
+
302
+ # Perform the rename and log it at level 1.
303
+ old.rename(new)
304
+ self.DEBUG1(":recycle: moved {} to {}", old, new)
305
+
306
+ return True
@@ -6,7 +6,6 @@ from .tradeexcept import TradeException
6
6
  from .misc import progress as pbar
7
7
  from . import fs
8
8
 
9
- import csv
10
9
  import json
11
10
  import time
12
11
  import typing
@@ -50,6 +49,7 @@ def download(
50
49
  timeout: int = 90,
51
50
  *,
52
51
  length: Optional[Union[int, str]] = None,
52
+ session: Optional[requests.Session] = None,
53
53
  ):
54
54
  """
55
55
  Fetch data from a URL and save the output
@@ -75,7 +75,8 @@ def download(
75
75
  if isinstance(length, str):
76
76
  length = int(length)
77
77
 
78
- req = requests.get(url, headers=headers or None, stream=True, timeout=timeout)
78
+ # If the caller provided an existing session stream, use that the fetch the request.
79
+ req = (session or requests).get(url, headers=headers or None, stream=True, timeout=timeout)
79
80
  req.raise_for_status()
80
81
 
81
82
  encoding = req.headers.get('content-encoding', 'uncompress')
@@ -85,7 +86,7 @@ def download(
85
86
  # chunked transfer-encoding doesn't need a content-length
86
87
  if content_length is None:
87
88
  print(req.headers)
88
- raise Exception("Remote server replied with invalid content-length.")
89
+ raise TradeException("Remote server replied with invalid content-length.")
89
90
  content_length = int(content_length)
90
91
  if content_length <= 0:
91
92
  raise TradeException(
@@ -210,52 +211,3 @@ def get_json_data(url, *, timeout: int = 90):
210
211
  progBar.clear()
211
212
 
212
213
  return json.loads(jsData.decode())
213
-
214
- class CSVStream:
215
- """
216
- Provides an iterator that fetches CSV data from a given URL
217
- and presents it as an iterable of (columns, values).
218
-
219
- Example:
220
- stream = transfers.CSVStream("http://blah.com/foo.csv")
221
- for cols, vals in stream:
222
- print("{} = {}".format(cols[0], vals[0]))
223
- """
224
-
225
- def __init__(self, url, tdenv=None, *, timeout: int = 90):
226
- self.url = url
227
- self.tdenv = tdenv
228
- if not url.startswith("file:///"):
229
- self.req = requests.get(self.url, stream=True, timeout=timeout)
230
- self.lines = self.req.iter_lines()
231
- else:
232
- self.lines = open(url[8:], "rUb")
233
- self.columns = self.next_line().split(',')
234
-
235
- def next_line(self):
236
- """ Fetch the next line as a text string """
237
- while True:
238
- line = next(self.lines)
239
- try:
240
- return line.decode(encoding="utf-8")
241
- except UnicodeDecodeError as e:
242
- if not self.tdenv:
243
- raise e
244
- self.tdenv.WARN(
245
- "{}: line:{}: {}\n{}",
246
- self.url, self.csvin.line_num, line, e
247
- )
248
-
249
- def __iter__(self):
250
- """
251
- Iterate across data received as csv values.
252
- Yields [column headings], [column values]
253
- """
254
- self.csvin = csvin = csv.reader(
255
- iter(self.next_line, 'END'),
256
- delimiter=',', quotechar="'", doublequote=True
257
- )
258
- columns = self.columns
259
- for values in csvin:
260
- if values and len(values) == len(columns):
261
- yield columns, values
@@ -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.1.6'
15
+ __version__ = '11.2.1'
16
16
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tradedangerous
3
- Version: 11.1.6
3
+ Version: 11.2.1
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
File without changes