Пример #1
0
 def delete(self):
     """Layout group deletion
     """
     LayoutManager.getSingleton().removeLayoutGroup(self)
     import time
     self.lock.acquire()
     self.deleted = True        
     self.objects = None
     self.lock.release()
Пример #2
0
    def __init__(self):
        #default location is Home
        self.location = Layouts.HOME

        self.controller = TensorController(self)
        self.content = ContentManager(self)
        self.layouts = LayoutManager(self)
        self.keyBindings = KeyBindingsManager(self)

        #initialize only after all managers have been instantiated due to cyclic dependencies between them
        self.controller.initializeController()
        self.content.initializeContent()
        self.layouts.initializeLayouts()
        self.keyBindings.initializeKeyBinds()

        #the prompt_toolkit Application object
        self.app = self.initializeApp()
Пример #3
0
   def __init__(self):
       """Constructor
       @param _objects: list of group objects
       @type _object: list  
       """
       self.lock = thread.allocate_lock()  # lock object for multithreading layout
       
       self.objects = []   # list of group objects   
       
       self.need_layout = False
       
 
       # callbacks
       self.eventStart = None
       self.eventFinish = None
       self.eventOrder = None
       
       self.deleted = False
       
       self.playing = True 
       
       # appending to layout manager
       LayoutManager.getSingleton().addLayoutGroup(self)
Пример #4
0
class TensorStudio:
    def __init__(self):
        #default location is Home
        self.location = Layouts.HOME

        self.controller = TensorController(self)
        self.content = ContentManager(self)
        self.layouts = LayoutManager(self)
        self.keyBindings = KeyBindingsManager(self)

        #initialize only after all managers have been instantiated due to cyclic dependencies between them
        self.controller.initializeController()
        self.content.initializeContent()
        self.layouts.initializeLayouts()
        self.keyBindings.initializeKeyBinds()

        #the prompt_toolkit Application object
        self.app = self.initializeApp()

    # ------------- Helpers ----------------#

    def initializeApp(self):
        layout = self.layouts.getLayout(self.location)
        style = self.layouts.getStyle()
        keyBindings = self.keyBindings.getGlobalKeyBinds()

        return Application(layout=layout,
                           key_bindings=keyBindings,
                           style=style,
                           full_screen=True)

    def run(self):
        self.app.run()

    def exit(self, event=None):
        self.app.exit()