Use new `str.removeprefix()` from py3.10

notokeninwswrapper
Tyler Goodlet 2022-07-02 15:49:32 -04:00
parent f6888057c3
commit 47777e4192
1 changed files with 3 additions and 3 deletions

View File

@ -615,7 +615,7 @@ def load_pps_from_toml(
if not pps: if not pps:
log.warning( log.warning(
f'No trade history could be loaded for {brokername}:{acctid}' f'No `pps.toml` positions cold be loaded for {brokername}:{acctid}'
) )
# unmarshal/load ``pps.toml`` config entries into object form. # unmarshal/load ``pps.toml`` config entries into object form.
@ -752,11 +752,11 @@ def update_pps_conf(
# drop symbol obj in serialized form # drop symbol obj in serialized form
s = asdict.pop('symbol') s = asdict.pop('symbol')
fqsn = s.front_fqsn() fqsn = s.front_fqsn()
print(f'Updating active pp: {fqsn}') log.info(f'Updating active pp: {fqsn}')
# XXX: ugh, it's cuz we push the section under # XXX: ugh, it's cuz we push the section under
# the broker name.. maybe we need to rethink this? # the broker name.. maybe we need to rethink this?
brokerless_key = fqsn.rstrip(f'.{brokername}') brokerless_key = fqsn.removeprefix(f'{brokername}.')
pp_entries[brokerless_key] = asdict pp_entries[brokerless_key] = asdict