diff --git a/syscontrol/run_process.py b/syscontrol/run_process.py index 50a9cc34aa..409ae1085f 100644 --- a/syscontrol/run_process.py +++ b/syscontrol/run_process.py @@ -19,7 +19,7 @@ import time import sys from syscontrol.report_process_status import reportProcessStatus -from syscore.constants import status, success, failure +from syscore.constants import success from syscontrol.timer_functions import get_list_of_timer_functions, listOfTimerFunctions diff --git a/sysdata/futures/multiple_prices.py b/sysdata/futures/multiple_prices.py index d718edffa2..edd3c00dec 100644 --- a/sysdata/futures/multiple_prices.py +++ b/sysdata/futures/multiple_prices.py @@ -11,7 +11,6 @@ """ from syscore.exceptions import existingData from sysdata.base_data import baseData -from syscore.constants import status, success, failure # These are used when inferring prices in an incomplete series from sysobjects.multiple_prices import futuresMultiplePrices @@ -46,9 +45,7 @@ def get_multiple_prices(self, instrument_code: str) -> futuresMultiplePrices: return multiple_prices - def delete_multiple_prices( - self, instrument_code: str, are_you_sure=False - ) -> status: + def delete_multiple_prices(self, instrument_code: str, are_you_sure=False): log = self.log.setup(instrument_code=instrument_code) if are_you_sure: @@ -58,18 +55,15 @@ def delete_multiple_prices( ) log.info("Deleted multiple price data for %s" % instrument_code) - return success - else: # doesn't exist anyway log.warning( "Tried to delete non existent multiple prices for %s" % instrument_code ) - return failure else: log.error("You need to call delete_multiple_prices with a flag to be sure") - return failure + raise Exception("You need to be sure!") def is_code_in_data(self, instrument_code: str) -> bool: if instrument_code in self.get_list_of_instruments(): diff --git a/sysinit/futures/repocsv_spread_costs.py b/sysinit/futures/repocsv_spread_costs.py index 9afbdc5736..926d2c30f5 100644 --- a/sysinit/futures/repocsv_spread_costs.py +++ b/sysinit/futures/repocsv_spread_costs.py @@ -95,7 +95,8 @@ def process_modified_instruments( if check_on_modify: okay_to_modify = true_if_answer_is_yes( - "Okay to replace %f with %f" % (existing_spread, new_spread) + "%s: Okay to replace %f with %f" + % (instrument_code, existing_spread, new_spread) ) if not okay_to_modify: continue