tradedangerous 10.14.4__py3-none-any.whl → 10.15.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/cache.py +29 -11
- tradedangerous/plugins/spansh_plug.py +10 -4
- tradedangerous/version.py +1 -1
- {tradedangerous-10.14.4.dist-info → tradedangerous-10.15.0.dist-info}/METADATA +1 -1
- {tradedangerous-10.14.4.dist-info → tradedangerous-10.15.0.dist-info}/RECORD +9 -9
- {tradedangerous-10.14.4.dist-info → tradedangerous-10.15.0.dist-info}/LICENSE +0 -0
- {tradedangerous-10.14.4.dist-info → tradedangerous-10.15.0.dist-info}/WHEEL +0 -0
- {tradedangerous-10.14.4.dist-info → tradedangerous-10.15.0.dist-info}/entry_points.txt +0 -0
- {tradedangerous-10.14.4.dist-info → tradedangerous-10.15.0.dist-info}/top_level.txt +0 -0
tradedangerous/cache.py
CHANGED
|
@@ -632,17 +632,34 @@ def processPricesFile(tdenv, db, pricesPath, pricesFh = None, defaultZero = Fals
|
|
|
632
632
|
removedItems = len(zeros)
|
|
633
633
|
|
|
634
634
|
if items:
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
635
|
+
for item in items:
|
|
636
|
+
try:
|
|
637
|
+
db.execute("""
|
|
638
|
+
INSERT OR REPLACE INTO StationItem (
|
|
639
|
+
station_id, item_id, modified,
|
|
640
|
+
demand_price, demand_units, demand_level,
|
|
641
|
+
supply_price, supply_units, supply_level
|
|
642
|
+
) VALUES (
|
|
643
|
+
?, ?, IFNULL(?, CURRENT_TIMESTAMP),
|
|
644
|
+
?, ?, ?,
|
|
645
|
+
?, ?, ?
|
|
646
|
+
)
|
|
647
|
+
""", item)
|
|
648
|
+
except sqlite3.IntegrityError as e:
|
|
649
|
+
print(e)
|
|
650
|
+
print(item)
|
|
651
|
+
raise e
|
|
652
|
+
# db.executemany("""
|
|
653
|
+
# INSERT OR REPLACE INTO StationItem (
|
|
654
|
+
# station_id, item_id, modified,
|
|
655
|
+
# demand_price, demand_units, demand_level,
|
|
656
|
+
# supply_price, supply_units, supply_level
|
|
657
|
+
# ) VALUES (
|
|
658
|
+
# ?, ?, IFNULL(?, CURRENT_TIMESTAMP),
|
|
659
|
+
# ?, ?, ?,
|
|
660
|
+
# ?, ?, ?
|
|
661
|
+
# )
|
|
662
|
+
# """, items)
|
|
646
663
|
updatedItems = len(items)
|
|
647
664
|
|
|
648
665
|
tdenv.DEBUG0("Marking populated stations as having a market")
|
|
@@ -654,6 +671,7 @@ def processPricesFile(tdenv, db, pricesPath, pricesFh = None, defaultZero = Fals
|
|
|
654
671
|
")"
|
|
655
672
|
)
|
|
656
673
|
|
|
674
|
+
tdenv.DEBUG0(f'Committing...')
|
|
657
675
|
db.commit()
|
|
658
676
|
|
|
659
677
|
changes = " and ".join("{} {}".format(v, k) for k, v in {
|
|
@@ -55,6 +55,7 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
55
55
|
pluginOptions = {
|
|
56
56
|
'url': f'URL to download galaxy data from (defaults to {SOURCE_URL})',
|
|
57
57
|
'file': 'Local filename to import galaxy data from; use "-" to load from stdin',
|
|
58
|
+
'maxage': 'Skip all entries older than specified age in days, ex.: maxage=1.5',
|
|
58
59
|
'listener': 'For use by TD-listener, prevents updating cache from generated prices file',
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -62,6 +63,7 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
62
63
|
super().__init__(*args, **kwargs)
|
|
63
64
|
self.url = self.getOption('url')
|
|
64
65
|
self.file = self.getOption('file')
|
|
66
|
+
self.maxage = float(self.getOption('maxage'))
|
|
65
67
|
self.listener = self.getOption('listener')
|
|
66
68
|
assert not (self.url and self.file), 'Provide either url or file, not both'
|
|
67
69
|
if self.file and (self.file != '-'):
|
|
@@ -104,6 +106,10 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
104
106
|
station_count = 0
|
|
105
107
|
commodity_count = 0
|
|
106
108
|
for station, commodities in stations:
|
|
109
|
+
if (datetime.now() - station.modified) > timedelta(days=self.maxage):
|
|
110
|
+
if self.tdenv.detail >= 1:
|
|
111
|
+
self.print(f' | @{system.name.upper()}/{station.name.upper():50s} | Skipping station due to age: {datetime.now() - station.modified}, ts: {station.modified}')
|
|
112
|
+
continue
|
|
107
113
|
if (system.name.upper(), station.name.upper()) in seen_stations:
|
|
108
114
|
fq_station_name = f'@{system.name.upper()}/{station.name}'
|
|
109
115
|
if self.tdenv.detail >= 1:
|
|
@@ -183,15 +189,15 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
183
189
|
return categories
|
|
184
190
|
|
|
185
191
|
def execute(self, query, *params, **kwparams):
|
|
186
|
-
attempts = 5
|
|
192
|
+
# attempts = 5
|
|
187
193
|
cursor = self.tdb.getDB().cursor()
|
|
188
194
|
while True:
|
|
189
195
|
try:
|
|
190
196
|
return cursor.execute(query, params or kwparams)
|
|
191
197
|
except sqlite3.OperationalError as ex:
|
|
192
|
-
if not attempts:
|
|
193
|
-
|
|
194
|
-
attempts -= 1
|
|
198
|
+
# if not attempts:
|
|
199
|
+
# raise
|
|
200
|
+
# attempts -= 1
|
|
195
201
|
self.print(f'Retrying query: {ex!s}')
|
|
196
202
|
time.sleep(1)
|
|
197
203
|
|
tradedangerous/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tradedangerous
|
|
3
|
-
Version: 10.
|
|
3
|
+
Version: 10.15.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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
tradedangerous/__init__.py,sha256=5ZeypoZaM8hlh6c-yTkD8x5hZYP8q3Q8a3bVeicHr90,1122
|
|
2
|
-
tradedangerous/cache.py,sha256=
|
|
2
|
+
tradedangerous/cache.py,sha256=R-QTud9KwrRKbe-sVHDHXYZQblkXKuKxK1nYegM90BA,33647
|
|
3
3
|
tradedangerous/cli.py,sha256=ycGkzMszwpP9OrngFIyhQbYoZ2wzRhJMTDCW1YhLrNI,4727
|
|
4
4
|
tradedangerous/corrections.py,sha256=QMs-7MKLw2imFgIHthnwcpqWT1yJTb3CrABJw9LaKLA,1441
|
|
5
5
|
tradedangerous/csvexport.py,sha256=OcOKe_VIgafw6rCvG3k5tM11KwwoYXMNY5DSSfCC0mU,8705
|
|
@@ -21,7 +21,7 @@ tradedangerous/tradeexcept.py,sha256=aZ-Y31MbkjF7lmAzBAbaMsPPE7FEEfuf4gaX2GvriDk
|
|
|
21
21
|
tradedangerous/tradegui.py,sha256=JbGFnsWupgesk6hrcUgKSdD9NNDyo0U9gh6m3DccAwU,782
|
|
22
22
|
tradedangerous/transfers.py,sha256=NmXXk2aF88YkAvYqc9Syt_aO6d2jJjC-OxoRFoOyQH4,9923
|
|
23
23
|
tradedangerous/utils.py,sha256=PUPvAEqUyxYGqqQa0b_yfLAvq8YVUxK6HfdS-CxM-Lo,5186
|
|
24
|
-
tradedangerous/version.py,sha256=
|
|
24
|
+
tradedangerous/version.py,sha256=HvTZZF5gQzfcRfEd7T27CYhdQFzmH1fwqUuu3623Bh0,647
|
|
25
25
|
tradedangerous/commands/TEMPLATE.py,sha256=7oXL124aqxGHwnb0h9yRylUiwc6M5QrRrGVrubwI1gg,2124
|
|
26
26
|
tradedangerous/commands/__init__.py,sha256=6B0WuqkFBOll5Hj67yKDAnhmyr5ZAnHc6nzUNEUh384,9640
|
|
27
27
|
tradedangerous/commands/buildcache_cmd.py,sha256=oJvP06fA8svnHrfrpWkHKR16cba8GIhHdMOyZqds18Y,2332
|
|
@@ -66,14 +66,14 @@ tradedangerous/plugins/eddblink_plug.py,sha256=n8AzLh2pJdHdar1SnqSSjCwWPl4f-OKQ8
|
|
|
66
66
|
tradedangerous/plugins/edmc_batch_plug.py,sha256=3Ptr-SZqaZFR8ViIIrp9Ak7rvfU3zl11AZYBhIceN7s,4224
|
|
67
67
|
tradedangerous/plugins/journal_plug.py,sha256=K1oIeI7E3mb04fvYLXyoAh7fOTyM9NBelibTI88MIDQ,23696
|
|
68
68
|
tradedangerous/plugins/netlog_plug.py,sha256=Gw_HSZWpN17D--OIYEM3Vo8y9SvDOv9UwAUfY24kz28,13460
|
|
69
|
-
tradedangerous/plugins/spansh_plug.py,sha256=
|
|
69
|
+
tradedangerous/plugins/spansh_plug.py,sha256=VBq0hl8p8x4HVIATpEFnCcj3gNPP5ilxdpZbitz71Mg,15914
|
|
70
70
|
tradedangerous/templates/Added.csv,sha256=8o54civQCcS9y7_DBo0GX196XWRbbREQqKDYTKibsgQ,649
|
|
71
71
|
tradedangerous/templates/DefaultShipIndex.json,sha256=m5cI3vkKiqRk1VKO1Z_8LZrG9nczV0PUMDfBSt4-1RM,94739
|
|
72
72
|
tradedangerous/templates/RareItem.csv,sha256=F1RhRnTD82PiwrVUO-ai2ErGH2PTqNnQaDw5mcgljXs,10483
|
|
73
73
|
tradedangerous/templates/TradeDangerous.sql,sha256=6sjEogGHy-9zYpjPo0Y2a5tElowmHFyJNwrimOUBfHk,8079
|
|
74
|
-
tradedangerous-10.
|
|
75
|
-
tradedangerous-10.
|
|
76
|
-
tradedangerous-10.
|
|
77
|
-
tradedangerous-10.
|
|
78
|
-
tradedangerous-10.
|
|
79
|
-
tradedangerous-10.
|
|
74
|
+
tradedangerous-10.15.0.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
75
|
+
tradedangerous-10.15.0.dist-info/METADATA,sha256=8Y24VwY_h_KlhtqxWs1qRVcmM6HdawZdF6vCPEJhp-I,4421
|
|
76
|
+
tradedangerous-10.15.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
77
|
+
tradedangerous-10.15.0.dist-info/entry_points.txt,sha256=pSwa-q0ob443uiKux7xFKYQl8uen66iDTnjdrQhNLx8,92
|
|
78
|
+
tradedangerous-10.15.0.dist-info/top_level.txt,sha256=bF29i-oEltmNICgElEKxNsg83oahJvxg3a7YrxZi9Rk,15
|
|
79
|
+
tradedangerous-10.15.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|