/[weechat]/weechat/src/plugins/scripts/python/weechat-python.c
ViewVC logotype

Diff of /weechat/src/plugins/scripts/python/weechat-python.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by flashcode, Sun Oct 16 17:38:50 2005 UTC revision 1.4 by flashcode, Mon Oct 17 14:30:03 2005 UTC
# Line 456  weechat_python_get_dcc_info (PyObject *s Line 456  weechat_python_get_dcc_info (PyObject *s
456            
457      return list;      return list;
458  }  }
459    
460    /*
461     * weechat.get_config: get value of a config option
462     */
463    
464    static PyObject *
465    weechat_python_get_config (PyObject *self, PyObject *args)
466    {
467        char *option, *value;
468        PyObject *object;
469        
470        /* make gcc happy */
471        (void) self;
472        
473        if (!PyArg_ParseTuple (args, "s", &option))
474        {
475            python_plugin->printf_server (python_plugin,
476                                          "Python error: wrong parameters for "
477                                          "\"get_config\" function");
478            return NULL;
479        }
480        
481        if (option)
482        {
483            value = python_plugin->get_config (python_plugin, option);
484            
485            if (value)
486            {
487                object = Py_BuildValue ("s", value);
488                free (value);
489                return object;
490            }
491            else
492                return Py_BuildValue ("s", "");
493        }
494        
495        return Py_BuildValue ("i", 1);
496    }
497                    
498  /*  /*
499   * Python subroutines   * Python subroutines
# Line 471  PyMethodDef weechat_funcs[] = { Line 509  PyMethodDef weechat_funcs[] = {
509      { "add_command_handler", weechat_python_add_command_handler, METH_VARARGS, "" },      { "add_command_handler", weechat_python_add_command_handler, METH_VARARGS, "" },
510      { "get_info", weechat_python_get_info, METH_VARARGS, "" },      { "get_info", weechat_python_get_info, METH_VARARGS, "" },
511      { "get_dcc_info", weechat_python_get_dcc_info, METH_VARARGS, "" },      { "get_dcc_info", weechat_python_get_dcc_info, METH_VARARGS, "" },
512        { "get_config", weechat_python_get_config, METH_VARARGS, "" },
513      { NULL, NULL, 0, NULL }      { NULL, NULL, 0, NULL }
514  };  };
515    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26