def save_callback(operation, graphdef):
    '''callback from save thread'''
    if operation == 'test':
        for e in graphdef.expressions:
            if expression_ok(e, msgs):
                graphdef.expression = e
                pipe_graph_input.send('graph ' + graphdef.expression)
                return
        pipe_console_input.send('Invalid graph expressions')
        return
    if operation == 'save':
        save_graph(graphdef)
def save_callback ( operation , graphdef ) : if operation == 'test' : for e in graphdef . expressions : if expression_ok ( e , msgs ) : graphdef . expression = e pipe_graph_input . send ( 'graph ' + graphdef . expression ) return pipe_console_input . send ( 'Invalid graph expressions' ) return if operation == 'save' : save_graph ( graphdef )
callback from save thread