tradedangerous 10.16.17__py3-none-any.whl → 11.0.0__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/__init__.py +4 -4
- tradedangerous/cache.py +183 -148
- tradedangerous/cli.py +2 -7
- tradedangerous/commands/TEMPLATE.py +1 -2
- tradedangerous/commands/__init__.py +2 -4
- tradedangerous/commands/buildcache_cmd.py +6 -11
- tradedangerous/commands/buy_cmd.py +11 -12
- tradedangerous/commands/commandenv.py +16 -15
- tradedangerous/commands/exceptions.py +6 -4
- tradedangerous/commands/export_cmd.py +2 -4
- tradedangerous/commands/import_cmd.py +3 -5
- tradedangerous/commands/local_cmd.py +16 -25
- tradedangerous/commands/market_cmd.py +9 -8
- tradedangerous/commands/nav_cmd.py +17 -25
- tradedangerous/commands/olddata_cmd.py +9 -15
- tradedangerous/commands/parsing.py +9 -6
- tradedangerous/commands/rares_cmd.py +9 -10
- tradedangerous/commands/run_cmd.py +25 -26
- tradedangerous/commands/sell_cmd.py +9 -9
- tradedangerous/commands/shipvendor_cmd.py +4 -7
- tradedangerous/commands/station_cmd.py +8 -14
- tradedangerous/commands/trade_cmd.py +5 -10
- tradedangerous/commands/update_cmd.py +10 -7
- tradedangerous/commands/update_gui.py +1 -3
- tradedangerous/corrections.py +1 -3
- tradedangerous/csvexport.py +8 -8
- tradedangerous/edscupdate.py +4 -6
- tradedangerous/edsmupdate.py +4 -4
- tradedangerous/formatting.py +53 -40
- tradedangerous/fs.py +6 -6
- tradedangerous/gui.py +53 -62
- tradedangerous/jsonprices.py +8 -16
- tradedangerous/mapping.py +4 -3
- tradedangerous/mfd/__init__.py +2 -4
- tradedangerous/mfd/saitek/__init__.py +0 -1
- tradedangerous/mfd/saitek/directoutput.py +8 -11
- tradedangerous/mfd/saitek/x52pro.py +5 -7
- tradedangerous/misc/checkpricebounds.py +2 -3
- tradedangerous/misc/clipboard.py +2 -3
- tradedangerous/misc/coord64.py +2 -1
- tradedangerous/misc/derp-sentinel.py +1 -1
- tradedangerous/misc/diff-system-csvs.py +3 -0
- tradedangerous/misc/eddb.py +1 -3
- tradedangerous/misc/eddn.py +2 -2
- tradedangerous/misc/edsc.py +7 -14
- tradedangerous/misc/edsm.py +1 -8
- tradedangerous/misc/importeddbstats.py +2 -1
- tradedangerous/misc/prices-json-exp.py +7 -5
- tradedangerous/misc/progress.py +2 -2
- tradedangerous/plugins/__init__.py +2 -2
- tradedangerous/plugins/edapi_plug.py +13 -19
- tradedangerous/plugins/edcd_plug.py +4 -5
- tradedangerous/plugins/eddblink_plug.py +14 -17
- tradedangerous/plugins/edmc_batch_plug.py +3 -5
- tradedangerous/plugins/journal_plug.py +2 -1
- tradedangerous/plugins/netlog_plug.py +5 -5
- tradedangerous/plugins/spansh_plug.py +393 -176
- tradedangerous/prices.py +19 -20
- tradedangerous/submit-distances.py +3 -8
- tradedangerous/templates/TradeDangerous.sql +305 -306
- tradedangerous/trade.py +12 -5
- tradedangerous/tradecalc.py +30 -34
- tradedangerous/tradedb.py +140 -206
- tradedangerous/tradeenv.py +143 -69
- tradedangerous/tradegui.py +4 -2
- tradedangerous/transfers.py +23 -20
- tradedangerous/version.py +1 -1
- {tradedangerous-10.16.17.dist-info → tradedangerous-11.0.0.dist-info}/METADATA +2 -2
- tradedangerous-11.0.0.dist-info/RECORD +79 -0
- tradedangerous-10.16.17.dist-info/RECORD +0 -79
- {tradedangerous-10.16.17.dist-info → tradedangerous-11.0.0.dist-info}/LICENSE +0 -0
- {tradedangerous-10.16.17.dist-info → tradedangerous-11.0.0.dist-info}/WHEEL +0 -0
- {tradedangerous-10.16.17.dist-info → tradedangerous-11.0.0.dist-info}/entry_points.txt +0 -0
- {tradedangerous-10.16.17.dist-info → tradedangerous-11.0.0.dist-info}/top_level.txt +0 -0
tradedangerous/prices.py
CHANGED
|
@@ -9,20 +9,16 @@
|
|
|
9
9
|
# --------------------------------------------------------------------
|
|
10
10
|
# TradeDangerous :: Modules :: Generate TradeDangerous.prices
|
|
11
11
|
|
|
12
|
-
from __future__ import absolute_import, with_statement, print_function, division, unicode_literals
|
|
13
|
-
|
|
14
12
|
import sys
|
|
15
|
-
import os
|
|
16
|
-
import re
|
|
17
13
|
import sqlite3
|
|
18
14
|
|
|
19
15
|
|
|
20
|
-
class Element
|
|
21
|
-
basic =
|
|
22
|
-
supply =
|
|
23
|
-
timestamp =
|
|
24
|
-
full =
|
|
25
|
-
blanks =
|
|
16
|
+
class Element: # TODO: enum?
|
|
17
|
+
basic = 1 << 0
|
|
18
|
+
supply = 1 << 1
|
|
19
|
+
timestamp = 1 << 2
|
|
20
|
+
full = basic | supply | timestamp
|
|
21
|
+
blanks = 1 <<31
|
|
26
22
|
|
|
27
23
|
|
|
28
24
|
######################################################################
|
|
@@ -42,20 +38,20 @@ def dumpPrices(
|
|
|
42
38
|
If file is not none, outputs to the given file handle.
|
|
43
39
|
"""
|
|
44
40
|
|
|
45
|
-
withTimes =
|
|
46
|
-
getBlanks =
|
|
41
|
+
withTimes = elementMask & Element.timestamp
|
|
42
|
+
getBlanks = elementMask & Element.blanks
|
|
47
43
|
|
|
48
44
|
conn = sqlite3.connect(str(dbPath))
|
|
49
45
|
conn.execute("PRAGMA foreign_keys=ON")
|
|
50
46
|
cur = conn.cursor()
|
|
51
47
|
|
|
52
|
-
systems =
|
|
48
|
+
systems = dict(cur.execute("SELECT system_id, name FROM System"))
|
|
53
49
|
stations = {
|
|
54
50
|
ID: [ name, systems[sysID] ]
|
|
55
51
|
for (ID, name, sysID)
|
|
56
52
|
in cur.execute("SELECT station_id, name, system_id FROM Station")
|
|
57
53
|
}
|
|
58
|
-
categories =
|
|
54
|
+
categories = dict(cur.execute("SELECT category_id, name FROM Category"))
|
|
59
55
|
items = {
|
|
60
56
|
ID: [ name, catID, categories[catID] ]
|
|
61
57
|
for (ID, name, catID)
|
|
@@ -118,9 +114,10 @@ def dumpPrices(
|
|
|
118
114
|
print(sql)
|
|
119
115
|
cur.execute(sql)
|
|
120
116
|
|
|
121
|
-
|
|
117
|
+
lastStn, lastCat = None, None
|
|
122
118
|
|
|
123
|
-
if not file:
|
|
119
|
+
if not file:
|
|
120
|
+
file = sys.stdout
|
|
124
121
|
|
|
125
122
|
if stationID:
|
|
126
123
|
stationSet = str(stations[stationID])
|
|
@@ -226,7 +223,9 @@ def dumpPrices(
|
|
|
226
223
|
|
|
227
224
|
file.write(output)
|
|
228
225
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
226
|
+
|
|
227
|
+
# if __name__ == "__main__":
|
|
228
|
+
# import tradedb
|
|
229
|
+
#
|
|
230
|
+
# tdb = tradedb.TradeDB(load=False)
|
|
231
|
+
# dumpPrices(tdb.dbPath, elementMask=Element.full)
|
|
@@ -12,14 +12,8 @@ Use:
|
|
|
12
12
|
# and submit a diff, that'd be greatly appreciated!
|
|
13
13
|
#
|
|
14
14
|
|
|
15
|
-
from __future__ import print_function
|
|
16
|
-
|
|
17
15
|
import argparse
|
|
18
|
-
import json
|
|
19
|
-
import math
|
|
20
16
|
import os
|
|
21
|
-
import pathlib
|
|
22
|
-
import platform
|
|
23
17
|
import random
|
|
24
18
|
import re
|
|
25
19
|
import sys
|
|
@@ -52,7 +46,7 @@ or if you like, I can try and install it for you now
|
|
|
52
46
|
raise e
|
|
53
47
|
import pip
|
|
54
48
|
pip.main(["install", "--upgrade", "requests"])
|
|
55
|
-
import requests
|
|
49
|
+
import requests # noqa: F401
|
|
56
50
|
|
|
57
51
|
standardStars = [
|
|
58
52
|
"SOL",
|
|
@@ -67,7 +61,8 @@ standardStars = [
|
|
|
67
61
|
|
|
68
62
|
class UsageError(Exception):
|
|
69
63
|
def __init__(self, argv, error):
|
|
70
|
-
|
|
64
|
+
self.argv, self.error = argv, error
|
|
65
|
+
|
|
71
66
|
def __str__(self):
|
|
72
67
|
return error + "\n" + argv.format_usage()
|
|
73
68
|
|