black reformatted
This commit is contained in:
49
qt.py
49
qt.py
@@ -628,7 +628,7 @@ class BalWindow(Logger):
|
||||
try:
|
||||
del self.heirs[heir]
|
||||
except Exception as e:
|
||||
_logger.debug(f"error deleting heir: {heir} {e}")
|
||||
_logger.debug(f"error deleting heir: {heir} {e}")
|
||||
pass
|
||||
self.heirs.save()
|
||||
self.heir_list.update()
|
||||
@@ -2038,9 +2038,9 @@ class bal_checkbox(QCheckBox):
|
||||
|
||||
class BalBuildWillDialog(BalDialog):
|
||||
updatemessage = pyqtSignal()
|
||||
COLOR_WARNING='#cfa808'
|
||||
COLOR_ERROR='#ff0000'
|
||||
COLOR_OK='#05ad05'
|
||||
COLOR_WARNING = "#cfa808"
|
||||
COLOR_ERROR = "#ff0000"
|
||||
COLOR_OK = "#05ad05"
|
||||
|
||||
def __init__(self, bal_window, parent=None):
|
||||
if not parent:
|
||||
@@ -2097,7 +2097,7 @@ class BalBuildWillDialog(BalDialog):
|
||||
self.bal_window.window.wallet.dust_threshold(),
|
||||
)
|
||||
_logger.debug("variables ok")
|
||||
self.msg_set_status("checking variables:", varrow, "Ok",self.COLOR_OK)
|
||||
self.msg_set_status("checking variables:", varrow, "Ok", self.COLOR_OK)
|
||||
except AmountException:
|
||||
self.msg_set_status(
|
||||
"checking variables",
|
||||
@@ -2107,7 +2107,7 @@ class BalBuildWillDialog(BalDialog):
|
||||
+ "the entire wallet will always be fully emptied. \n"
|
||||
+ "Your settings require an adjustment of the amounts"
|
||||
),
|
||||
self.COLOR_WARNING
|
||||
self.COLOR_WARNING,
|
||||
)
|
||||
|
||||
self.msg_set_checking()
|
||||
@@ -2150,19 +2150,19 @@ class BalBuildWillDialog(BalDialog):
|
||||
try:
|
||||
if not self.bal_window.build_will():
|
||||
self.msg_set_status(
|
||||
_("Balance is too low. No transaction was built"),None,_("Skipped"),self.COLOR_ERROR
|
||||
_("Balance is too low. No transaction was built"),
|
||||
None,
|
||||
_("Skipped"),
|
||||
self.COLOR_ERROR,
|
||||
)
|
||||
|
||||
|
||||
self.bal_window.check_will()
|
||||
for wid in Will.only_valid(self.bal_window.willitems):
|
||||
self.bal_window.wallet.set_label(wid, "BAL Transaction")
|
||||
self.msg_set_building(self.msg_ok())
|
||||
except WillExecutorNotPresent as e:
|
||||
self.msg_set_status(
|
||||
_("Will-Executor excluded"),
|
||||
None,
|
||||
_("Skipped"),
|
||||
self.COLOR_ERROR
|
||||
_("Will-Executor excluded"), None, _("Skipped"), self.COLOR_ERROR
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
@@ -2175,10 +2175,10 @@ class BalBuildWillDialog(BalDialog):
|
||||
for hid, heir in heirs.items():
|
||||
if "DUST" in str(heir[HEIR_REAL_AMOUNT]):
|
||||
self.msg_set_status(
|
||||
f'{hid},{heir[HEIR_DUST_AMOUNT]} is DUST',
|
||||
f"{hid},{heir[HEIR_DUST_AMOUNT]} is DUST",
|
||||
None,
|
||||
f"Excluded from will {wid}",
|
||||
self.COLOR_WARNING
|
||||
self.COLOR_WARNING,
|
||||
)
|
||||
|
||||
have_to_sign = False
|
||||
@@ -2430,20 +2430,19 @@ class BalBuildWillDialog(BalDialog):
|
||||
self.wait_row = self.msg_edit_row(f"Please wait {status}secs", self.wait_row)
|
||||
|
||||
def msg_error(self, e):
|
||||
return "<font color='{}'>{}</font>".format(self.COLOR_ERROR,e)
|
||||
return "<font color='{}'>{}</font>".format(self.COLOR_ERROR, e)
|
||||
|
||||
def msg_ok(self, e="Ok"):
|
||||
return "<font color='{}'>{}</font>".format(self.COLOR_OK,e)
|
||||
return "<font color='{}'>{}</font>".format(self.COLOR_OK, e)
|
||||
|
||||
def msg_warning(self, e):
|
||||
return "<font color='{}'>{}</font".format(self.COLOR_WARNING,e)
|
||||
return "<font color='{}'>{}</font".format(self.COLOR_WARNING, e)
|
||||
|
||||
def msg_set_status(self, msg, row=None, status=None,color="#000000"):
|
||||
def msg_set_status(self, msg, row=None, status=None, color="#000000"):
|
||||
status = "Wait" if status is None else status
|
||||
line = "<font color={}>{}:\t{}</font>".format(color,_(msg), status)
|
||||
line = "<font color={}>{}:\t{}</font>".format(color, _(msg), status)
|
||||
return self.msg_edit_row(line, row)
|
||||
|
||||
|
||||
def ask_password(self, msg=None):
|
||||
self.password = self.bal_window.get_wallet_password(msg, parent=self)
|
||||
|
||||
@@ -2560,9 +2559,9 @@ class HeirList(MyTreeView, MessageBoxMixin):
|
||||
except Exception:
|
||||
self.update()
|
||||
|
||||
def delete_heirs(self,selected_keys):
|
||||
self.bal_window.delete_heirs(selected_keys)
|
||||
self.update()
|
||||
def delete_heirs(self, selected_keys):
|
||||
self.bal_window.delete_heirs(selected_keys)
|
||||
self.update()
|
||||
|
||||
def create_menu(self, position):
|
||||
menu = QMenu()
|
||||
@@ -2591,9 +2590,7 @@ class HeirList(MyTreeView, MessageBoxMixin):
|
||||
_("Edit {}").format(column_title),
|
||||
lambda p=persistent: self.edit(QModelIndex(p)),
|
||||
)
|
||||
menu.addAction(
|
||||
_("Delete"), lambda: self.delete_heirs(selected_keys)
|
||||
)
|
||||
menu.addAction(_("Delete"), lambda: self.delete_heirs(selected_keys))
|
||||
menu.exec(self.viewport().mapToGlobal(position))
|
||||
|
||||
# def get_selected_keys(self):
|
||||
|
||||
Reference in New Issue
Block a user