added a newline to the output in the error case.
2009-03-22 Sven Neumann <sven@gimp.org> * app/batch.c (batch_run_cmd): added a newline to the output in the error case. * plug-ins/script-fu/script-fu-eval.c (script_fu_eval_run): instead of disabling all output in batch mode, use the usual routine for error handling and pass the error string along with svn path=/trunk/; revision=28200
This commit is contained in:

committed by
Sven Neumann

parent
e6af54a687
commit
a85bbe7fec
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2009-03-22 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/batch.c (batch_run_cmd): added a newline to the output in
|
||||||
|
the error case.
|
||||||
|
|
||||||
|
* plug-ins/script-fu/script-fu-eval.c (script_fu_eval_run):
|
||||||
|
instead of disabling all output in batch mode, use the usual
|
||||||
|
routine for error handling and pass the error string along with
|
||||||
|
the return values.
|
||||||
|
|
||||||
2009-03-22 Michael Natterer <mitch@gimp.org>
|
2009-03-22 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* libgimpwidgets/gimpscrolledpreview.c: use GtkAdjustment's
|
* libgimpwidgets/gimpscrolledpreview.c: use GtkAdjustment's
|
||||||
|
@ -168,8 +168,8 @@ batch_run_cmd (Gimp *gimp,
|
|||||||
case GIMP_PDB_EXECUTION_ERROR:
|
case GIMP_PDB_EXECUTION_ERROR:
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
g_printerr ("batch command experienced an execution error: %s\n",
|
g_printerr ("batch command experienced an execution error:\n"
|
||||||
error->message);
|
"%s\n", error->message);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -180,8 +180,8 @@ batch_run_cmd (Gimp *gimp,
|
|||||||
case GIMP_PDB_CALLING_ERROR:
|
case GIMP_PDB_CALLING_ERROR:
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
g_printerr ("batch command experienced a calling error: %s\n",
|
g_printerr ("batch command experienced a calling error:\n"
|
||||||
error->message);
|
"%s\n", error->message);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -32,24 +32,24 @@ script_fu_eval_run (const gchar *name,
|
|||||||
gint *nreturn_vals,
|
gint *nreturn_vals,
|
||||||
GimpParam **return_vals)
|
GimpParam **return_vals)
|
||||||
{
|
{
|
||||||
static GimpParam values[2];
|
static GimpParam values[2];
|
||||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
GString *output = g_string_new (NULL);
|
||||||
GimpRunMode run_mode;
|
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||||
|
GimpRunMode run_mode;
|
||||||
|
|
||||||
*nreturn_vals = 1;
|
*nreturn_vals = 1;
|
||||||
*return_vals = values;
|
*return_vals = values;
|
||||||
|
|
||||||
values[0].type = GIMP_PDB_STATUS;
|
values[0].type = GIMP_PDB_STATUS;
|
||||||
|
|
||||||
run_mode = params[0].data.d_int32;
|
run_mode = params[0].data.d_int32;
|
||||||
|
|
||||||
ts_set_run_mode (run_mode);
|
ts_set_run_mode (run_mode);
|
||||||
|
ts_register_output_func (ts_gstring_output_func, output);
|
||||||
|
|
||||||
switch (run_mode)
|
switch (run_mode)
|
||||||
{
|
{
|
||||||
case GIMP_RUN_NONINTERACTIVE:
|
case GIMP_RUN_NONINTERACTIVE:
|
||||||
/* Disable Script-Fu output */
|
|
||||||
ts_register_output_func (NULL, NULL);
|
|
||||||
if (ts_interpret_string (params[1].data.d_string) != 0)
|
if (ts_interpret_string (params[1].data.d_string) != 0)
|
||||||
status = GIMP_PDB_EXECUTION_ERROR;
|
status = GIMP_PDB_EXECUTION_ERROR;
|
||||||
break;
|
break;
|
||||||
@ -57,10 +57,8 @@ script_fu_eval_run (const gchar *name,
|
|||||||
case GIMP_RUN_INTERACTIVE:
|
case GIMP_RUN_INTERACTIVE:
|
||||||
case GIMP_RUN_WITH_LAST_VALS:
|
case GIMP_RUN_WITH_LAST_VALS:
|
||||||
status = GIMP_PDB_CALLING_ERROR;
|
status = GIMP_PDB_CALLING_ERROR;
|
||||||
*nreturn_vals = 2;
|
g_string_assign (output, _("Script-Fu evaluation mode only allows "
|
||||||
values[1].type = GIMP_PDB_STRING;
|
"non-interactive invocation"));
|
||||||
values[1].data.d_string = _("Script-Fu evaluation mode only allows "
|
|
||||||
"non-interactive invocation");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -68,4 +66,15 @@ script_fu_eval_run (const gchar *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
values[0].data.d_status = status;
|
values[0].data.d_status = status;
|
||||||
|
|
||||||
|
if (status != GIMP_PDB_SUCCESS && output->len > 0)
|
||||||
|
{
|
||||||
|
*nreturn_vals = 2;
|
||||||
|
values[1].type = GIMP_PDB_STRING;
|
||||||
|
values[1].data.d_string = g_string_free (output, FALSE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_string_free (output, TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user