Exemplo n.º 1
0
def textbox(message="", title="", text="", codebox=0):
    """Original doc: Display some text in a proportional font with line wrapping at word breaks.
	This function is suitable for displaying general written text.

	The text parameter should be a string, or a list or tuple of lines to be
	displayed in the textbox.
	"""
    return psidialogs.text(message=message, title=title, text=text)
Exemplo n.º 2
0
def selectbackend(backend=None, title='', **kwargs):
    if backend:
        BackendLoader().force(backend)    
        selectfunc(title, **kwargs)
    else:
        while 1:
            #d = dict([(x.backend, x.name) for x in psidialogs.all_backends()])
            #names=sorted(d.keys()
            names=sorted(BackendLoader().all_names)
            b = psidialogs.choice(names, 'Select backend!', title=title)
            if not b:   
                break
            BackendLoader().force(b)
            try:
                BackendLoader().selected()
            except Exception, detail:
                BackendLoader().force(None)
                psidialogs.text('Exception:\n' + unicode(detail))
                continue
              
            #psidialogs.set_backend(force_backend=d[b])  
            selectfunc(title, **kwargs)
Exemplo n.º 3
0
def dialog(func, title='', **kwargs):
    funcs = psidialogs.FUNCTIONS
    log.debug('functions found:')
    log.debug(funcs)
    log.debug('searching for:')
    log.debug(func)
    f = None
    for x in funcs:
        if x.__name__ == func:
            f = x
    assert f
    argnames, varargs, varkw, defaults = inspect.getargspec(f)
    #argnames = psidialogs.argnames(func)
    args = testdata(title)
    args = dict([(k, v) for (k, v) in args.items() if k in argnames])
    result=None
    exec 'result = psidialogs.%s(**args)' % (func)
    #result = psidialogs.__dict__[func](**args)
    #print 'result: ' , result
#    log.debug(u'result:'+unicode(result))
    if result is not None:
        psidialogs.text('Return value=%s (%r)' % (result,result) )
Exemplo n.º 4
0
def scrolledMessageDialog(parent=None, message='', title='', pos=wx.Point(-1, -1), size=(500, 300)):
    return psidialogs.text(text=message, title=title)