1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-24 20:06:38 +02:00

Remove "category" for buffers (keep only name).

This commit is contained in:
Sebastien Helleu
2008-09-18 18:44:03 +02:00
parent c3df7da641
commit c572e393e7
81 changed files with 1645 additions and 11842 deletions
@@ -88,7 +88,7 @@ weechat_python_api_register (PyObject *self, PyObject *args)
weechat_gettext ("%s%s: unable to register script "
"\"%s\" (another script already "
"exists with this name)"),
weechat_prefix ("error"), "python", name);
weechat_prefix ("error"), PYTHON_PLUGIN_NAME, name);
PYTHON_RETURN_ERROR;
}
@@ -104,7 +104,7 @@ weechat_python_api_register (PyObject *self, PyObject *args)
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
"python", name, version, description);
PYTHON_PLUGIN_NAME, name, version, description);
}
else
{
@@ -1834,12 +1834,6 @@ weechat_python_api_prnt (PyObject *self, PyObject *args)
/* make C compiler happy */
(void) self;
if (!python_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("prnt");
PYTHON_RETURN_ERROR;
}
buffer = NULL;
message = NULL;
@@ -2985,7 +2979,7 @@ weechat_python_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
static PyObject *
weechat_python_api_buffer_new (PyObject *self, PyObject *args)
{
char *category, *name, *function_input, *function_close, *result;
char *name, *function_input, *function_close, *result;
PyObject *object;
/* make C compiler happy */
@@ -2997,12 +2991,11 @@ weechat_python_api_buffer_new (PyObject *self, PyObject *args)
PYTHON_RETURN_EMPTY;
}
category = NULL;
name = NULL;
function_input = NULL;
function_close = NULL;
if (!PyArg_ParseTuple (args, "ssss", &category, &name, &function_input,
if (!PyArg_ParseTuple (args, "sss", &name, &function_input,
&function_close))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_new");
@@ -3011,7 +3004,6 @@ weechat_python_api_buffer_new (PyObject *self, PyObject *args)
result = script_ptr2str (script_api_buffer_new (weechat_python_plugin,
python_current_script,
category,
name,
&weechat_python_api_buffer_input_data_cb,
function_input,
@@ -3028,7 +3020,7 @@ weechat_python_api_buffer_new (PyObject *self, PyObject *args)
static PyObject *
weechat_python_api_buffer_search (PyObject *self, PyObject *args)
{
char *category, *name;
char *plugin, *name;
char *result;
PyObject *object;
@@ -3041,16 +3033,16 @@ weechat_python_api_buffer_search (PyObject *self, PyObject *args)
PYTHON_RETURN_EMPTY;
}
category = NULL;
plugin = NULL;
name = NULL;
if (!PyArg_ParseTuple (args, "ss", &category, &name))
if (!PyArg_ParseTuple (args, "ss", &plugin, &name))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_search");
PYTHON_RETURN_EMPTY;
}
result = script_ptr2str (weechat_buffer_search (category, name));
result = script_ptr2str (weechat_buffer_search (plugin, name));
PYTHON_RETURN_STRING_FREE(result);
}
+25 -24
View File
@@ -28,7 +28,7 @@
#include "weechat-python-api.h"
WEECHAT_PLUGIN_NAME("python");
WEECHAT_PLUGIN_NAME(PYTHON_PLUGIN_NAME);
WEECHAT_PLUGIN_DESCRIPTION("Python plugin for WeeChat");
WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>");
WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION);
@@ -72,7 +72,7 @@ weechat_python_exec (struct t_plugin_script *script,
{
weechat_printf (NULL,
weechat_gettext ("%s%s unable to run function \"%s\""),
weechat_prefix ("error"), "python", function);
weechat_prefix ("error"), PYTHON_PLUGIN_NAME, function);
/* PyEval_ReleaseThread (python_current_script->interpreter); */
return NULL;
}
@@ -151,7 +151,7 @@ weechat_python_exec (struct t_plugin_script *script,
weechat_printf (NULL,
weechat_gettext ("%s%s: function \"%s\" must return "
"a valid value"),
weechat_prefix ("error"), "python", function);
weechat_prefix ("error"), PYTHON_PLUGIN_NAME, function);
/* PyEval_ReleaseThread (python_current_script->interpreter); */
python_current_script = old_python_current_script;
if (python_current_script)
@@ -164,7 +164,7 @@ weechat_python_exec (struct t_plugin_script *script,
weechat_printf (NULL,
weechat_gettext ("%s%s: not enough memory in "
"function \"%s\""),
weechat_prefix ("error"), "python", function);
weechat_prefix ("error"), PYTHON_PLUGIN_NAME, function);
/* PyEval_ReleaseThread (python_current_script->interpreter); */
python_current_script = old_python_current_script;
if (python_current_script)
@@ -204,7 +204,7 @@ weechat_python_output (PyObject *self, PyObject *args)
{
weechat_printf (NULL,
weechat_gettext ("%s: stdout/stderr: %s%s"),
"python", python_buffer_output, "");
PYTHON_PLUGIN_NAME, python_buffer_output, "");
python_buffer_output[0] = '\0';
}
}
@@ -218,7 +218,7 @@ weechat_python_output (PyObject *self, PyObject *args)
{
weechat_printf (NULL,
weechat_gettext ("%s: stdout/stderr: %s%s"),
"python", python_buffer_output, m);
PYTHON_PLUGIN_NAME, python_buffer_output, m);
}
*p = '\n';
python_buffer_output[0] = '\0';
@@ -229,7 +229,7 @@ weechat_python_output (PyObject *self, PyObject *args)
{
weechat_printf (NULL,
weechat_gettext ("%s: stdout/stderr: %s%s"),
"python", python_buffer_output, m);
PYTHON_PLUGIN_NAME, python_buffer_output, m);
python_buffer_output[0] = '\0';
}
else
@@ -269,13 +269,13 @@ weechat_python_load (const char *filename)
{
weechat_printf (NULL,
weechat_gettext ("%s%s: script \"%s\" not found"),
weechat_prefix ("error"), "python", filename);
weechat_prefix ("error"), PYTHON_PLUGIN_NAME, filename);
return 0;
}
weechat_printf (NULL,
weechat_gettext ("%s: loading script \"%s\""),
"python", filename);
PYTHON_PLUGIN_NAME, filename);
python_current_script = NULL;
@@ -288,7 +288,7 @@ weechat_python_load (const char *filename)
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to create new "
"sub-interpreter"),
weechat_prefix ("error"), "python");
weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
fclose (fp);
/* PyEval_ReleaseLock (); */
return 0;
@@ -303,7 +303,7 @@ weechat_python_load (const char *filename)
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to initialize WeeChat "
"module"),
weechat_prefix ("error"), "python");
weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
fclose (fp);
Py_EndInterpreter (python_current_interpreter);
@@ -317,7 +317,7 @@ weechat_python_load (const char *filename)
w_home = weechat_info_get ("weechat_dir", "");
if (w_home)
{
len = strlen (w_home) + 1 + strlen("python") + 1;
len = strlen (w_home) + 1 + strlen(PYTHON_PLUGIN_NAME) + 1;
p_home = malloc (len);
if (p_home)
{
@@ -371,7 +371,7 @@ weechat_python_load (const char *filename)
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to redirect stdout and "
"stderr"),
weechat_prefix ("error"), "python");
weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
}
else
{
@@ -379,13 +379,13 @@ weechat_python_load (const char *filename)
{
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to redirect stdout"),
weechat_prefix ("error"), "python");
weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
}
if (PySys_SetObject("stderr", weechat_outputs) == -1)
{
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to redirect stderr"),
weechat_prefix ("error"), "python");
weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
}
}
@@ -395,7 +395,7 @@ weechat_python_load (const char *filename)
{
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to parse file \"%s\""),
weechat_prefix ("error"), "python", filename);
weechat_prefix ("error"), PYTHON_PLUGIN_NAME, filename);
fclose (fp);
if (PyErr_Occurred ())
@@ -420,7 +420,7 @@ weechat_python_load (const char *filename)
weechat_printf (NULL,
weechat_gettext ("%s%s: function \"register\" not "
"found (or failed) in file \"%s\""),
weechat_prefix ("error"), "python", filename);
weechat_prefix ("error"), PYTHON_PLUGIN_NAME, filename);
if (PyErr_Occurred ())
PyErr_Print ();
@@ -461,7 +461,7 @@ weechat_python_unload (struct t_plugin_script *script)
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
"python", script->name);
PYTHON_PLUGIN_NAME, script->name);
if (script->shutdown_func && script->shutdown_func[0])
{
@@ -494,13 +494,13 @@ weechat_python_unload_name (const char *name)
weechat_python_unload (ptr_script);
weechat_printf (NULL,
weechat_gettext ("%s: script \"%s\" unloaded"),
"python", name);
PYTHON_PLUGIN_NAME, name);
}
else
{
weechat_printf (NULL,
weechat_gettext ("%s%s: script \"%s\" not loaded"),
weechat_prefix ("error"), "python", name);
weechat_prefix ("error"), PYTHON_PLUGIN_NAME, name);
}
}
@@ -593,7 +593,8 @@ weechat_python_command_cb (void *data, struct t_gui_buffer *buffer,
weechat_printf (NULL,
weechat_gettext ("%s%s: unknown option for "
"command \"%s\""),
weechat_prefix ("error"), "python", "python");
weechat_prefix ("error"), PYTHON_PLUGIN_NAME,
"python");
}
}
@@ -679,7 +680,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to launch global "
"interpreter"),
weechat_prefix ("error"), "python");
weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
return WEECHAT_RC_ERROR;
}
@@ -693,7 +694,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to get current "
"interpreter state"),
weechat_prefix ("error"), "python");
weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
return WEECHAT_RC_ERROR;
}
@@ -735,7 +736,7 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
{
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to free interpreter"),
weechat_prefix ("error"), "python");
weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
}
return WEECHAT_RC_OK;
@@ -21,6 +21,7 @@
#define __WEECHAT_PYTHON_H 1
#define weechat_plugin weechat_python_plugin
#define PYTHON_PLUGIN_NAME "python"
extern struct t_weechat_plugin *weechat_python_plugin;