comparison sat_frontends/primitivus/xmlui.py @ 2765:378188abe941

misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
author Goffi <goffi@goffi.org>
date Fri, 11 Jan 2019 11:13:15 +0100
parents 5c2ed8a5ae22
children 003b8b4b56a7
comparison
equal deleted inserted replaced
2764:92af49cde255 2765:378188abe941
341 class PrimitivusMessageDialog(PrimitivusDialog, xmlui.MessageDialog, sat_widgets.Alert): 341 class PrimitivusMessageDialog(PrimitivusDialog, xmlui.MessageDialog, sat_widgets.Alert):
342 def __init__(self, _xmlui_parent, title, message, level): 342 def __init__(self, _xmlui_parent, title, message, level):
343 PrimitivusDialog.__init__(self, _xmlui_parent) 343 PrimitivusDialog.__init__(self, _xmlui_parent)
344 xmlui.MessageDialog.__init__(self, _xmlui_parent) 344 xmlui.MessageDialog.__init__(self, _xmlui_parent)
345 sat_widgets.Alert.__init__( 345 sat_widgets.Alert.__init__(
346 self, title, message, ok_cb=lambda dummy: self._xmluiClose() 346 self, title, message, ok_cb=lambda __: self._xmluiClose()
347 ) 347 )
348 348
349 349
350 class PrimitivusNoteDialog(xmlui.NoteDialog, PrimitivusMessageDialog): 350 class PrimitivusNoteDialog(xmlui.NoteDialog, PrimitivusMessageDialog):
351 # TODO: separate NoteDialog 351 # TODO: separate NoteDialog
360 xmlui.ConfirmDialog.__init__(self, _xmlui_parent) 360 xmlui.ConfirmDialog.__init__(self, _xmlui_parent)
361 sat_widgets.ConfirmDialog.__init__( 361 sat_widgets.ConfirmDialog.__init__(
362 self, 362 self,
363 title, 363 title,
364 message, 364 message,
365 no_cb=lambda dummy: self._xmluiCancelled(), 365 no_cb=lambda __: self._xmluiCancelled(),
366 yes_cb=lambda dummy: self._xmluiValidated(), 366 yes_cb=lambda __: self._xmluiValidated(),
367 ) 367 )
368 368
369 369
370 class PrimitivusFileDialog( 370 class PrimitivusFileDialog(
371 PrimitivusDialog, xmlui.FileDialog, files_management.FileDialog 371 PrimitivusDialog, xmlui.FileDialog, files_management.FileDialog
378 if filetype == C.XMLUI_DATA_FILETYPE_DIR: 378 if filetype == C.XMLUI_DATA_FILETYPE_DIR:
379 style.append("dir") 379 style.append("dir")
380 files_management.FileDialog.__init__( 380 files_management.FileDialog.__init__(
381 self, 381 self,
382 ok_cb=lambda path: self._xmluiValidated({"path": path}), 382 ok_cb=lambda path: self._xmluiValidated({"path": path}),
383 cancel_cb=lambda dummy: self._xmluiCancelled(), 383 cancel_cb=lambda __: self._xmluiCancelled(),
384 message=message, 384 message=message,
385 title=title, 385 title=title,
386 style=style, 386 style=style,
387 ) 387 )
388 388
456 buttons.append(urwid.Button(_("Submit"), self.onFormSubmitted)) 456 buttons.append(urwid.Button(_("Submit"), self.onFormSubmitted))
457 if not "NO_CANCEL" in self.flags: 457 if not "NO_CANCEL" in self.flags:
458 buttons.append(urwid.Button(_("Cancel"), self.onFormCancelled)) 458 buttons.append(urwid.Button(_("Cancel"), self.onFormCancelled))
459 else: 459 else:
460 buttons.append( 460 buttons.append(
461 urwid.Button(_("OK"), on_press=lambda dummy: self._xmluiClose()) 461 urwid.Button(_("OK"), on_press=lambda __: self._xmluiClose())
462 ) 462 )
463 max_len = max([len(button.get_label()) for button in buttons]) 463 max_len = max([len(button.get_label()) for button in buttons])
464 grid_wid = urwid.GridFlow(buttons, max_len + 4, 1, 0, "center") 464 grid_wid = urwid.GridFlow(buttons, max_len + 4, 1, 0, "center")
465 self.main_cont.body.append(grid_wid) 465 self.main_cont.body.append(grid_wid)
466 elif self.type == "param": 466 elif self.type == "param":