All pastes #26489 Raw Edit

Something

public text v1 · immutable
#26489 ·published 2005-10-24 16:21 UTC
rendered paste body
          Py_XINCREF (callback_function);
          if (!PyCallable_Check (callback_function))
            {
              Py_XDECREF (callback_function);
              log_msg (LOG_CAUSE, "Function is not callable");
              _exit (1);
            }
          result = PyEval_CallObject (callback_function, arglist);
          Py_XDECREF (callback_function);
          if (result == NULL)
            {
              log_msg (LOG_CAUSE, "Executing callback function failed");
              _exit (1);
            }
          Py_DECREF (result);



from ldtp import *
import re

initappmap ('/home/test/evolution.map')

def evolution_error_dialog ():
    # do remap
    remap ('evolution', 'dlgEvolutionError')
    label_list = getobjectlist ('dlgEvolutionError')
    for i in label_list:
        result = re.search ('^lbl.*', i)
        if hasattr (result, 'group'):
            obj_property = getobjectinfo ('dlgEvolutionError', i)
            label = ''
            if hasattr (obj_property, 'label'):
                label = getobjectproperty ('dlgEvolutionError', i, 'label')
            elif hasattr (obj_property, 'label_by'):
                label = getobjectproperty ('dlgEvolutionError', i, 'label_by')
            if label != '':
                log (label, 'cause')
                print label
    undoremap ('evolution', 'dlgEvolutionError')

regwincallback ('dlgEvolutionError', evolution_error_dialog)
click ('dlgEvolutionSettings', 'nags')