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.

Files changed (74) hide show
  1. tradedangerous/__init__.py +4 -4
  2. tradedangerous/cache.py +183 -148
  3. tradedangerous/cli.py +2 -7
  4. tradedangerous/commands/TEMPLATE.py +1 -2
  5. tradedangerous/commands/__init__.py +2 -4
  6. tradedangerous/commands/buildcache_cmd.py +6 -11
  7. tradedangerous/commands/buy_cmd.py +11 -12
  8. tradedangerous/commands/commandenv.py +16 -15
  9. tradedangerous/commands/exceptions.py +6 -4
  10. tradedangerous/commands/export_cmd.py +2 -4
  11. tradedangerous/commands/import_cmd.py +3 -5
  12. tradedangerous/commands/local_cmd.py +16 -25
  13. tradedangerous/commands/market_cmd.py +9 -8
  14. tradedangerous/commands/nav_cmd.py +17 -25
  15. tradedangerous/commands/olddata_cmd.py +9 -15
  16. tradedangerous/commands/parsing.py +9 -6
  17. tradedangerous/commands/rares_cmd.py +9 -10
  18. tradedangerous/commands/run_cmd.py +25 -26
  19. tradedangerous/commands/sell_cmd.py +9 -9
  20. tradedangerous/commands/shipvendor_cmd.py +4 -7
  21. tradedangerous/commands/station_cmd.py +8 -14
  22. tradedangerous/commands/trade_cmd.py +5 -10
  23. tradedangerous/commands/update_cmd.py +10 -7
  24. tradedangerous/commands/update_gui.py +1 -3
  25. tradedangerous/corrections.py +1 -3
  26. tradedangerous/csvexport.py +8 -8
  27. tradedangerous/edscupdate.py +4 -6
  28. tradedangerous/edsmupdate.py +4 -4
  29. tradedangerous/formatting.py +53 -40
  30. tradedangerous/fs.py +6 -6
  31. tradedangerous/gui.py +53 -62
  32. tradedangerous/jsonprices.py +8 -16
  33. tradedangerous/mapping.py +4 -3
  34. tradedangerous/mfd/__init__.py +2 -4
  35. tradedangerous/mfd/saitek/__init__.py +0 -1
  36. tradedangerous/mfd/saitek/directoutput.py +8 -11
  37. tradedangerous/mfd/saitek/x52pro.py +5 -7
  38. tradedangerous/misc/checkpricebounds.py +2 -3
  39. tradedangerous/misc/clipboard.py +2 -3
  40. tradedangerous/misc/coord64.py +2 -1
  41. tradedangerous/misc/derp-sentinel.py +1 -1
  42. tradedangerous/misc/diff-system-csvs.py +3 -0
  43. tradedangerous/misc/eddb.py +1 -3
  44. tradedangerous/misc/eddn.py +2 -2
  45. tradedangerous/misc/edsc.py +7 -14
  46. tradedangerous/misc/edsm.py +1 -8
  47. tradedangerous/misc/importeddbstats.py +2 -1
  48. tradedangerous/misc/prices-json-exp.py +7 -5
  49. tradedangerous/misc/progress.py +2 -2
  50. tradedangerous/plugins/__init__.py +2 -2
  51. tradedangerous/plugins/edapi_plug.py +13 -19
  52. tradedangerous/plugins/edcd_plug.py +4 -5
  53. tradedangerous/plugins/eddblink_plug.py +14 -17
  54. tradedangerous/plugins/edmc_batch_plug.py +3 -5
  55. tradedangerous/plugins/journal_plug.py +2 -1
  56. tradedangerous/plugins/netlog_plug.py +5 -5
  57. tradedangerous/plugins/spansh_plug.py +393 -176
  58. tradedangerous/prices.py +19 -20
  59. tradedangerous/submit-distances.py +3 -8
  60. tradedangerous/templates/TradeDangerous.sql +305 -306
  61. tradedangerous/trade.py +12 -5
  62. tradedangerous/tradecalc.py +30 -34
  63. tradedangerous/tradedb.py +140 -206
  64. tradedangerous/tradeenv.py +143 -69
  65. tradedangerous/tradegui.py +4 -2
  66. tradedangerous/transfers.py +23 -20
  67. tradedangerous/version.py +1 -1
  68. {tradedangerous-10.16.17.dist-info → tradedangerous-11.0.0.dist-info}/METADATA +2 -2
  69. tradedangerous-11.0.0.dist-info/RECORD +79 -0
  70. tradedangerous-10.16.17.dist-info/RECORD +0 -79
  71. {tradedangerous-10.16.17.dist-info → tradedangerous-11.0.0.dist-info}/LICENSE +0 -0
  72. {tradedangerous-10.16.17.dist-info → tradedangerous-11.0.0.dist-info}/WHEEL +0 -0
  73. {tradedangerous-10.16.17.dist-info → tradedangerous-11.0.0.dist-info}/entry_points.txt +0 -0
  74. {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(object):
21
- basic = (1 << 0)
22
- supply = (1 << 1)
23
- timestamp = (1 << 2)
24
- full = (basic | supply | timestamp)
25
- blanks = (1 <<31)
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 = (elementMask & Element.timestamp)
46
- getBlanks = (elementMask & Element.blanks)
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 = { ID: name for (ID, name) in cur.execute("SELECT system_id, name FROM System") }
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 = { ID: name for (ID, name) in cur.execute("SELECT category_id, name FROM Category") }
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
- lastSys, lastStn, lastCat = None, None, None
117
+ lastStn, lastCat = None, None
122
118
 
123
- if not file: file = sys.stdout
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
- if __name__ == "__main__":
230
- import tradedb
231
- tdb = tradedb.TradeDB(load=False)
232
- dumpPrices(tdb.dbPath, elementMask=Element.full)
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
- self.argv, self.error = argv, error
64
+ self.argv, self.error = argv, error
65
+
71
66
  def __str__(self):
72
67
  return error + "\n" + argv.format_usage()
73
68