tradedangerous 11.1.6__tar.gz → 11.2.0__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.
- {tradedangerous-11.1.6/tradedangerous.egg-info → tradedangerous-11.2.0}/PKG-INFO +1 -1
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/trade.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/shipvendor_cmd.py +2 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/station_cmd.py +1 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/trade_cmd.py +1 -1
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/update_cmd.py +1 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/update_gui.py +1 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/edscupdate.py +1 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/edsmupdate.py +1 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/jsonprices.py +1 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/mapping.py +2 -1
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/submit-distances.py +2 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/tradeenv.py +34 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/transfers.py +4 -52
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/version.py +1 -1
- {tradedangerous-11.1.6 → tradedangerous-11.2.0/tradedangerous.egg-info}/PKG-INFO +1 -1
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/LICENSE +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/README.md +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/pyproject.toml +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/setup.cfg +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/setup.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tests/test_bootstrap_commands.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tests/test_bootstrap_plugins.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tests/test_cache.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tests/test_commands.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tests/test_fs.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tests/test_peek.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tests/test_tools.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tests/test_trade.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tests/test_trade_run.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tests/test_utils.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/__init__.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/cache.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/cli.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/TEMPLATE.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/__init__.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/buildcache_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/buy_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/commandenv.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/exceptions.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/export_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/import_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/local_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/market_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/nav_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/olddata_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/parsing.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/rares_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/run_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/commands/sell_cmd.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/corrections.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/csvexport.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/formatting.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/fs.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/gui.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/mfd/__init__.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/mfd/saitek/__init__.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/mfd/saitek/directoutput.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/mfd/saitek/x52pro.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/checkpricebounds.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/clipboard.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/coord64.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/derp-sentinel.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/diff-system-csvs.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/eddb.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/eddn.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/edsc.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/edsm.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/importeddbstats.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/prices-json-exp.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/misc/progress.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/plugins/__init__.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/plugins/edapi_plug.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/plugins/edcd_plug.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/plugins/eddblink_plug.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/plugins/edmc_batch_plug.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/plugins/journal_plug.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/plugins/netlog_plug.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/plugins/spansh_plug.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/prices.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/templates/Added.csv +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/templates/Category.csv +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/templates/RareItem.csv +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/templates/TradeDangerous.sql +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/tools.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/tradecalc.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/tradedb.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/tradeexcept.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous/utils.py +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous.egg-info/SOURCES.txt +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous.egg-info/dependency_links.txt +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous.egg-info/entry_points.txt +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous.egg-info/not-zip-safe +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous.egg-info/requires.txt +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous.egg-info/top_level.txt +0 -0
- {tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradegui.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tradedangerous
|
|
3
|
-
Version: 11.
|
|
3
|
+
Version: 11.2.0
|
|
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
|
|
@@ -6,7 +6,7 @@ from ..formatting import RowFormat, max_len
|
|
|
6
6
|
######################################################################
|
|
7
7
|
# Parser config
|
|
8
8
|
|
|
9
|
-
help='Find
|
|
9
|
+
help='Find potential trades between two given stations.'
|
|
10
10
|
name='trade'
|
|
11
11
|
epilog=None
|
|
12
12
|
wantsTradeDB=True
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tradedangerous
|
|
3
|
-
Version: 11.
|
|
3
|
+
Version: 11.2.0
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tradedangerous-11.1.6 → tradedangerous-11.2.0}/tradedangerous.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|