def call_with_ui(self, f, *args, **kwargs):
    self.show()
    try:
        return f(*args, **kwargs)
    finally:
        self.hide()
def call_with_ui(self, f, *args, **kwargs):
    self.show()
    try:
        return f(*args, **kwargs)
    finally:
        self.hide()