From 4dcecc29899ab575e4241a533449f1b899512308 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Mon, 19 Dec 2016 15:28:40 +0000 Subject: [PATCH] Drop support for Slopey's BPC format --- EDMarketConnector.py | 12 ++++-------- L10n/cs.strings | 3 --- L10n/de.strings | 3 --- L10n/en.template | 3 --- L10n/es.strings | 3 --- L10n/fr.strings | 3 --- L10n/it.strings | 3 --- L10n/ja.strings | 3 --- L10n/lv.strings | 3 --- L10n/nl.strings | 3 --- L10n/pl.strings | 3 --- L10n/ru.strings | 3 --- L10n/sl.strings | 3 --- L10n/uk.strings | 3 --- README.md | 1 - commodity.py | 2 +- companion.py | 1 - config.py | 4 ++-- prefs.py | 5 +---- 19 files changed, 8 insertions(+), 56 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index b9d3f866..fc658937 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -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'] diff --git a/L10n/cs.strings b/L10n/cs.strings index 37334d34..721e69b3 100644 --- a/L10n/cs.strings +++ b/L10n/cs.strings @@ -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"; diff --git a/L10n/de.strings b/L10n/de.strings index dbe499b4..66774812 100644 --- a/L10n/de.strings +++ b/L10n/de.strings @@ -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"; diff --git a/L10n/en.template b/L10n/en.template index f6cb9f5e..0c4c993e 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -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"; diff --git a/L10n/es.strings b/L10n/es.strings index 4f04d8d8..fce6f2e2 100644 --- a/L10n/es.strings +++ b/L10n/es.strings @@ -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"; diff --git a/L10n/fr.strings b/L10n/fr.strings index 2adf60c1..99b59a9c 100644 --- a/L10n/fr.strings +++ b/L10n/fr.strings @@ -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"; diff --git a/L10n/it.strings b/L10n/it.strings index 68f1c2a3..b42e795f 100644 --- a/L10n/it.strings +++ b/L10n/it.strings @@ -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"; diff --git a/L10n/ja.strings b/L10n/ja.strings index 752e848c..9a388d17 100644 --- a/L10n/ja.strings +++ b/L10n/ja.strings @@ -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形式で記録する"; diff --git a/L10n/lv.strings b/L10n/lv.strings index 9b601412..59c978a1 100644 --- a/L10n/lv.strings +++ b/L10n/lv.strings @@ -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ā"; diff --git a/L10n/nl.strings b/L10n/nl.strings index 534840ef..f9b31c02 100644 --- a/L10n/nl.strings +++ b/L10n/nl.strings @@ -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"; diff --git a/L10n/pl.strings b/L10n/pl.strings index 0c035254..98743902 100644 --- a/L10n/pl.strings +++ b/L10n/pl.strings @@ -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"; diff --git a/L10n/ru.strings b/L10n/ru.strings index fa9ab1d9..648956ee 100644 --- a/L10n/ru.strings +++ b/L10n/ru.strings @@ -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"; diff --git a/L10n/sl.strings b/L10n/sl.strings index dcdc503e..4408266c 100644 --- a/L10n/sl.strings +++ b/L10n/sl.strings @@ -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"; diff --git a/L10n/uk.strings b/L10n/uk.strings index b2bea251..2c39a370 100644 --- a/L10n/uk.strings +++ b/L10n/uk.strings @@ -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 файлу"; diff --git a/README.md b/README.md index c4a0f52a..9b77fbb7 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/commodity.py b/commodity.py index 89d8ca64..e9b91961 100644 --- a/commodity.py +++ b/commodity.py @@ -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: diff --git a/companion.py b/companion.py index 814ad23c..a4eb35aa 100644 --- a/companion.py +++ b/companion.py @@ -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'), diff --git a/config.py b/config.py index f5619260..75b75d71 100644 --- a/config.py +++ b/config.py @@ -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 diff --git a/prefs.py b/prefs.py index 6b761e3e..282ec41e 100644 --- a/prefs.py +++ b/prefs.py @@ -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) +