Commits

Rodrigo Bistolfi committed d91eca2

Removed unused vinstall.core.view

Comments (0)

Files changed (1)

vinstall/core/view.py

-#-*- coding: utf-8 -*-
-
-
-"""High level functions for communicating with the view layer
-
-
-"""
-
-
-from vinstall.core.render import Render
-from vinstall.core import log
-from inspect import isgeneratorfunction
-import threading
-
-
-__all__ = ["disable_buttons"]
-
-
-log = log.get_logger(__name__)
-
-
-def disable_buttons(func):
-    """Disable user input while running func. If func is a generator function,
-    consume it giving control back to the event loop between nect() calls.
-
-    """
-    def wrapper(*args, **kwargs):
-        window = Render.main_window_instance
-        window.disable_buttons()
-        if isgeneratorfunction(func):
-            for _ in func(*args, **kwargs):
-                window.refresh()
-        else:
-            func(*args, **kwargs)
-        window.enable_buttons()
-    wrapper.__doc__ = func.__doc__
-    wrapper.__name__ = func.__name__
-    return wrapper
-