Exemplo n.º 1
0
 def loadModule(self, obj):
     try:
         for name in obj.getters:
             self.getters[name] = obj.getters[name]
             self.cachedvalues[name] = parallel.SharedVar()
             self.namespace[name] = self.cachedvalues[name].get
     except AttributeError:
         obj.getters = {}
     try:
         for name in obj.setters:
             self.setters[name] = obj.setters[name]
             self.namespace[name] = obj.setters[name]
     except AttributeError:
         obj.setters = {}
     try:
         obj.setup()
     except AttributeError:
         pass
Exemplo n.º 2
0
import os
################################################################################

################################################################################
# Now we bring in the rest of form's files
#
# Warning! This must stay first to allow tk_enqueue to be globally accessed by
# the rest of the files imported
import form.common as common
import form.parallel as parallel
import form.listener as listener
import form.spicy as spicy

tk = Tk()
tk.withdraw()
tk.tk_tasks = parallel.SharedVar(deque())
tk_tasks = tk.tk_tasks


def tk_enqueue(task):
    tk_tasks.op(spicy.curried_list_appender(task))


def tk_recycle():
    try:
        tk.destroy()
    except:
        pass
    tk = Tk()
    tk.withdraw()