Browse Source

replace deprecated log.warn part2

add_frost
zebra-lucky 2 weeks ago
parent
commit
efe84521e0
  1. 8
      scripts/joinmarket-qt.py
  2. 8
      scripts/snicker/snicker-server.py
  3. 5
      scripts/yg-privacyenhanced.py
  4. 2
      test/jmclient/test_frost_ipc.py

8
scripts/joinmarket-qt.py

@ -284,7 +284,8 @@ class SettingsTab(QDialog):
log.debug('setting section: ' + section + ' and name: ' + oname +
' to: ' + oval)
if not update_persist_config(section, oname, oval):
log.warn("Unable to persist config change to file: " + str(section) + str(oname) + str(oval))
log.warning("Unable to persist config change to file: " +
str(section) + str(oname) + str(oval))
else: #currently there is only QLineEdit
log.debug('setting section: ' + section + ' and name: ' + str(t[
@ -292,8 +293,9 @@ class SettingsTab(QDialog):
if not update_persist_config(section, str(t[0].text()), str(t[1].text())):
# we don't include GUI as it's not required to be persisted:
if not section == "GUI":
log.warn("Unable to persist config change to file: " + str(
section) + str(t[0].text()) + str(t[1].text()))
log.warning("Unable to persist config change to file: " +
str(section) + str(t[0].text()) +
str(t[1].text()))
if str(t[0].text()) == 'blockchain_source':
jm_single().bc_interface = get_blockchain_interface_instance(
jm_single().config)

8
scripts/snicker/snicker-server.py

@ -159,8 +159,8 @@ class SNICKERServer(Resource):
bin_nonce = hextobin(nonce.decode('utf-8'))
base64.b64decode(encryptedtx)
except:
log.warn("This proposal was not accepted: " + proposal.decode(
"utf-8"))
log.warning("This proposal was not accepted: " +
proposal.decode("utf-8"))
# give up immediately in case of format error:
return self.return_error(request, "Invalid request format",
"invalid-request-format")
@ -185,8 +185,8 @@ class SNICKERServer(Resource):
self.cursor.execute('INSERT INTO {} VALUES(?, ?);'.format(
database_table_name),proposal_to_add)
except sqlite3.Error as e:
log.warn("Error inserting data into table: {}".format(
" ".join(e.args)))
log.warning("Error inserting data into table:"
" {}".format(" ".join(e.args)))
return False
self.conn.commit()
return True

5
scripts/yg-privacyenhanced.py

@ -77,8 +77,9 @@ class YieldGeneratorPrivacyEnhanced(YieldGeneratorBasic):
self.minsize * (1 - float(self.size_factor)),
self.minsize * (1 + float(self.size_factor))))
if randomize_minsize < jm_single().DUST_THRESHOLD:
jlog.warn("Minsize was randomized to below dust; resetting to dust "
"threshold: " + amount_to_str(jm_single().DUST_THRESHOLD))
jlog.warning("Minsize was randomized to below dust; resetting to"
" dust threshold: " +
amount_to_str(jm_single().DUST_THRESHOLD))
randomize_minsize = jm_single().DUST_THRESHOLD
possible_maxsize = mix_balance[max_mix] - max(jm_single().DUST_THRESHOLD, randomize_txfee)
randomize_maxsize = int(random.uniform(possible_maxsize * (1 - float(self.size_factor)),

2
test/jmclient/test_frost_ipc.py

@ -61,7 +61,7 @@ class DummyFrostJMClientProtocol:
if session_id is None:
session_id, _, session = self.dkg_init(*md_type_idx)
if session_id is None:
log.warn('could not get session_id from dkg_init}')
log.warning('could not get session_id from dkg_init}')
await asyncio.sleep(5)
continue

Loading…
Cancel
Save