예제 #1
0
파일: init.py 프로젝트: gavine199/pymt
def test_runpymt(*largs, **kwargs):
    from pymt import runTouchApp, curry, getClock, stopTouchApp
    kwargs.setdefault('frame', 1)

    class testinfo(object):
        frame = kwargs.get('frame') + 1

    def test_runpymt_stop(info, *largs):
        info.frame -= 1
        if info.frame == 0:
            stopTouchApp()

    getClock().schedule_interval(curry(test_runpymt_stop, testinfo), 0)
    runTouchApp(*largs)
예제 #2
0
파일: init.py 프로젝트: triselectif/pymt
def test_runpymt(*largs, **kwargs):
    from pymt import runTouchApp, curry, getClock, stopTouchApp
    kwargs.setdefault('frame', 1)

    class testinfo(object):
        frame = kwargs.get('frame') + 1

    def test_runpymt_stop(info, *largs):
        info.frame -= 1
        if info.frame == 0:
            stopTouchApp()

    getClock().schedule_interval(curry(test_runpymt_stop, testinfo), 0)
    runTouchApp(*largs)
예제 #3
0
파일: config.py 프로젝트: bernt/pymt
    e_input_list.selection_set(eval(c_input.get()).index(t))

    c_input_devicename.set('')
    c_input_option.set('')

e_input_add = Button(g_input, text='Add input', command=_input_add)
e_input_add.grid(row=4, column=1)


# ================================================================
# Buttons
# ================================================================

btn_save = Button(master, text='Save configuration', command=configuration_save)
btn_save.grid(row=2, column=0, sticky=W+E+N+S)
btn_quit = Button(master, text='Exit', command=curry(sys.exit, 0))
btn_quit.grid(row=2, column=1, sticky=W+E+N+S)

# ================================================================
# Fill list
# ================================================================
for mod in pymt_modules.list():
    e_modules_list.insert(END, mod)
for opt in pymt_config.options('modules'):
    index = eval(c_modules.get()).index(opt)
    e_modules_list.selection_set(index)
for device_id in pymt_config.options('input'):
    line = pymt_config.get('input', device_id)
    t = '%s=%s' % (str(device_id), str(line))
    e_input_list.insert(END, t)
    e_input_list.selection_set(eval(c_input.get()).index(t))
예제 #4
0
파일: config.py 프로젝트: gavine199/pymt
    c_input_devicename.set('')
    c_input_option.set('')


e_input_add = Button(g_input, text='Add input', command=_input_add)
e_input_add.grid(row=4, column=1)

# ================================================================
# Buttons
# ================================================================

btn_save = Button(master,
                  text='Save configuration',
                  command=configuration_save)
btn_save.grid(row=2, column=0, sticky=W + E + N + S)
btn_quit = Button(master, text='Exit', command=curry(sys.exit, 0))
btn_quit.grid(row=2, column=1, sticky=W + E + N + S)

# ================================================================
# Fill list
# ================================================================
for mod in pymt_modules.list():
    e_modules_list.insert(END, mod)
for opt in pymt_config.options('modules'):
    index = eval(c_modules.get()).index(opt)
    e_modules_list.selection_set(index)
for device_id in pymt_config.options('input'):
    line = pymt_config.get('input', device_id)
    t = '%s=%s' % (str(device_id), str(line))
    e_input_list.insert(END, t)
    e_input_list.selection_set(eval(c_input.get()).index(t))