1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

Drop support for Slopey's BPC format

This commit is contained in:
Jonathan Harris 2016-12-19 15:28:40 +00:00
parent c3df78c2c1
commit 4dcecc2989
19 changed files with 8 additions and 56 deletions

View File

@ -37,7 +37,7 @@ Translations().install(config.get('language') or None)
import companion
import commodity
from commodity import COMMODITY_BPC, COMMODITY_CSV
from commodity import COMMODITY_CSV
import td
from eddn import eddn
import edsm
@ -401,12 +401,10 @@ class AppWindow:
# stuff we can do when not docked
plug.notify_newdata(data)
if config.getint('output') & config.OUT_SHIP_EDS:
if config.getint('output') & config.OUT_SHIP:
loadout.export(data)
if config.getint('output') & config.OUT_SHIP_CORIOLIS:
coriolis.export(data)
if not (config.getint('output') & (config.OUT_MKT_CSV|config.OUT_MKT_TD|config.OUT_MKT_BPC|config.OUT_MKT_EDDN)):
if not (config.getint('output') & ~config.OUT_SHIP & config.OUT_STATION_ANY):
# no station data requested - we're done
pass
@ -435,7 +433,7 @@ class AppWindow:
self.status['text'] = _("Station doesn't have a market!")
else:
if data['lastStarport'].get('commodities') and config.getint('output') & (config.OUT_MKT_CSV|config.OUT_MKT_TD|config.OUT_MKT_BPC):
if data['lastStarport'].get('commodities') and config.getint('output') & (config.OUT_MKT_CSV|config.OUT_MKT_TD):
# Fixup anomalies in the commodity data
fixed = companion.fixup(data)
@ -443,8 +441,6 @@ class AppWindow:
commodity.export(fixed, COMMODITY_CSV)
if config.getint('output') & config.OUT_MKT_TD:
td.export(fixed)
if config.getint('output') & config.OUT_MKT_BPC:
commodity.export(fixed, COMMODITY_BPC)
if config.getint('output') & config.OUT_MKT_EDDN:
old_status = self.status['text']

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Obchodní data ve formátu CSV";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Obchodní data ve formátu Slopey's BPC";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Obchodní data ve formátu Trade Dangerous";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Marktdaten als CSV Datei";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Marktdaten als Slopeys-BPC Datei";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Marktdaten als Trade-Dangerous Datei";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Market data in CSV format file";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Market data in Slopey's BPC format file";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Market data in Trade Dangerous format file";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Datos de mercado en formato CSV";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Datos de mercado en formato Slopey's BPC";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Datos de mercado en formato Trade Dangerous";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Données du marché au format CSV";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Données du marché au format Slopey's BPC";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Données du marché au format Trade Dangerous";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Market data in formato CSV";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Market data in formato Slopey's BPC";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Market data in formato Trade Dangerous";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "市場データをCSV形式で記録する";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "市場データをSlopey's BPC形式で記録する";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "市場データをTrade Dangerous形式で記録する";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Tirgus dati CSV formātā";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Tirgus dati Slopey`s BPC formātā";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Tirgus dati Trade Dangerous formātā";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Markt data in CSV bestand formaat";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Markt data in Slopey's BPC formaat bestand";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Markt data in Trade Dangerous bestand formaat";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Dane rynkowe w formacie CSV";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Dane rynkowe w formacie Slopey's BPC";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Dane rynkowe w formacie Trade Dangerous";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Торговые данные в формате CSV";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Торговые данные в формате Slopey's BPC";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Торговые данные в формате Trade Dangerous";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Podatki trga v CSV formatu";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Podatki trga v Slopey's BPC formatu";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Podatki trga v Trade Dangerous formatu";

View File

@ -232,9 +232,6 @@
/* [prefs.py] */
"Market data in CSV format file" = "Ринкові дані у форматі CSV файлу";
/* [prefs.py] */
"Market data in Slopey's BPC format file" = "Ринкові дані у форматі Slopey's BPC файлу";
/* [prefs.py] */
"Market data in Trade Dangerous format file" = "Ринкові дані у форматі Trade Dangerous файлу";

View File

@ -64,7 +64,6 @@ option EDMarketConnector → Preferences (Mac) or File → Settings (Windows) an
This app can save a variety of data in a variety of formats:
* Market data
* Slopey's BPC format file - saves commodity market data as files that you can load into [Slopey's BPC Market Tool](https://forums.frontier.co.uk/showthread.php?t=76081).
* Trade Dangerous format file - saves commodity market data as files that you can load into [Trade Dangerous](https://bitbucket.org/kfsone/tradedangerous/wiki/Home).
* CSV format file - saves commodity market data as files that you can upload to [Thrudd's Trading Tools](http://www.elitetradingtool.co.uk/), [Inara](http://inara.cz) or [mEDI's Elite Tools](https://github.com/mEDI-S/mEDI_s-Elite-Tools).

View File

@ -30,7 +30,7 @@ def export(data, kind=COMMODITY_DEFAULT, filename=None):
rowheader = sep.join([data['lastSystem']['name'], data['lastStarport']['name']])
elif kind == COMMODITY_BPC:
sep = ';'
header = sep.join(['userID', 'System','Station','Commodity','Sell','Buy','Demand','','Supply','','Average','Date\n'])
header = sep.join(['userID', 'System','Station','Commodity','Sell','Buy','Demand','','Supply','','Date\n'])
cmdr = data['commander']['name'].strip()
rowheader = sep.join([(config.getint('anonymous') and hashlib.md5(cmdr.encode('utf-8')).hexdigest()) or (sep in cmdr and '"%s"' % cmdr) or cmdr, data['lastSystem']['name'], data['lastStarport']['name']])
else:

View File

@ -367,7 +367,6 @@ def ship(data):
# subset of "ship" that's not noisy
description = {}
for props in [
('alive',),
('cargo', 'capacity'),
('free',),
('fuel', 'main', 'capacity'),

View File

@ -92,7 +92,7 @@ elif platform=='linux2':
class Config:
OUT_MKT_EDDN = 1
OUT_MKT_BPC = 2
# OUT_MKT_BPC = 2 # No longer supported
OUT_MKT_TD = 4
OUT_MKT_CSV = 8
OUT_SHIP = 16
@ -100,7 +100,7 @@ class Config:
# OUT_SYS_FILE = 32 # No longer supported
# OUT_STAT = 64 # No longer available
OUT_SHIP_CORIOLIS = 128 # Replaced by OUT_SHIP
OUT_STATION_ANY = OUT_MKT_EDDN|OUT_MKT_BPC|OUT_MKT_TD|OUT_MKT_CSV|OUT_SHIP_EDS|OUT_SHIP_CORIOLIS
OUT_STATION_ANY = OUT_MKT_EDDN|OUT_MKT_TD|OUT_MKT_CSV|OUT_SHIP|OUT_SHIP_EDS|OUT_SHIP_CORIOLIS
OUT_SYS_EDSM = 256
# OUT_SYS_AUTO = 512 # Now always automatic
OUT_MKT_MANUAL = 1024

View File

@ -126,8 +126,6 @@ class PreferencesDialog(tk.Toplevel):
nb.Label(outframe, text=_('Please choose what data to save')).grid(columnspan=2, padx=PADX, sticky=tk.W)
self.out_csv = tk.IntVar(value = (output & config.OUT_MKT_CSV ) and 1)
nb.Checkbutton(outframe, text=_('Market data in CSV format file'), variable=self.out_csv, command=self.outvarchanged).grid(columnspan=2, padx=BUTTONX, sticky=tk.W)
self.out_bpc = tk.IntVar(value = (output & config.OUT_MKT_BPC ) and 1)
nb.Checkbutton(outframe, text=_("Market data in Slopey's BPC format file"), variable=self.out_bpc, command=self.outvarchanged).grid(columnspan=2, padx=BUTTONX, sticky=tk.W)
self.out_td = tk.IntVar(value = (output & config.OUT_MKT_TD ) and 1)
nb.Checkbutton(outframe, text=_('Market data in Trade Dangerous format file'), variable=self.out_td, command=self.outvarchanged).grid(columnspan=2, padx=BUTTONX, sticky=tk.W)
self.out_ship= tk.IntVar(value = (output & (config.OUT_SHIP|config.OUT_SHIP_EDS|config.OUT_SHIP_CORIOLIS) and 1))
@ -321,7 +319,7 @@ class PreferencesDialog(tk.Toplevel):
logdir = self.logdir.get()
logvalid = logdir and exists(logdir)
local = self.out_bpc.get() or self.out_td.get() or self.out_csv.get() or self.out_ship.get()
local = self.out_td.get() or self.out_csv.get() or self.out_ship.get()
self.out_auto_button['state'] = local and logvalid and not monitor.is_beta and tk.NORMAL or tk.DISABLED
self.outdir_label['state'] = local and tk.NORMAL or tk.DISABLED
self.outbutton['state'] = local and tk.NORMAL or tk.DISABLED
@ -472,7 +470,6 @@ class PreferencesDialog(tk.Toplevel):
config.set('password', self.password.get().strip())
config.set('output',
(self.out_bpc.get() and config.OUT_MKT_BPC) +
(self.out_td.get() and config.OUT_MKT_TD) +
(self.out_csv.get() and config.OUT_MKT_CSV) +
(config.OUT_MKT_MANUAL if not self.out_auto.get() else 0) +