Mercurial > jwe > octave
changeset 27062:2bf6dcb1563c
Clean up error messages in print subsystem.
* print.m (epstool): Use error ID "print:nogs" to be consistent with other
messages about missing tools.
* print.m: Use "print:" rather than "print.m:" in error messages to be
consistent with the rest of Octave.
* __ghostscript__.m: Use error ID "print:nogs" to be consistent with other messages about missing tools.
* __gnuplot_print__.m, __opengl_print__.m, __print_parse_opts__.m: Use "print:"
rather than "print.m:" in error messages to be consistent with the rest of
Octave.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 22 Apr 2019 21:53:52 -0700 |
parents | f6e59ee37fee |
children | 3140380861ce |
files | scripts/plot/util/print.m scripts/plot/util/private/__ghostscript__.m scripts/plot/util/private/__gnuplot_print__.m scripts/plot/util/private/__opengl_print__.m scripts/plot/util/private/__print_parse_opts__.m |
diffstat | 5 files changed, 21 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/util/print.m Mon Apr 22 21:08:08 2019 -0700 +++ b/scripts/plot/util/print.m Mon Apr 22 21:53:52 2019 -0700 @@ -770,8 +770,8 @@ persistent epsdevice; if (dos_shell && isempty (epsdevice)) if (isempty (opts.ghostscript.binary)) - error ("octave:print:missing_gs", - "print: Ghostscript is required for specified output format, but binary is not available in PATH"); + error ("print:nogs", + "print: 'gs' (Ghostscript) is required for specified output format, but binary is not available in PATH"); endif [status, devlist] = system (sprintf ("%s -h", opts.ghostscript.binary)); @@ -821,7 +821,7 @@ if (! isempty (opts.preview) || opts.tight) if (isempty (opts.epstool_binary)) - error ("print:noepstool", "print.m: 'epstool' is required for specified output format, but binary is not available in PATH"); + error ("print:noepstool", "print: 'epstool' is required for specified output format, but binary is not available in PATH"); endif if (opts.tight) @@ -838,7 +838,7 @@ cmd = sprintf ("--add-%s-preview --mac-single", opts.preview); otherwise error ("print:invalidpreview", - "print.m: epstool cannot include preview for format '%s'", + "print: epstool cannot include preview for format '%s'", opts.preview); endswitch if (! isempty (opts.ghostscript.resolution)) @@ -873,7 +873,7 @@ if (! isempty (cleanup)) if (pipeout && dos_shell) error ("print:epstoolpipe", - "print.m: cannot pipe output of 'epstool' for DOS shell"); + "print: cannot pipe output of 'epstool' for DOS shell"); elseif (pipeout) cmd = sprintf ("( %s %s )", cmd, cleanup); else @@ -928,7 +928,7 @@ endif if (isempty (opts.fig2dev_binary)) - error ("print:nofig2dev", "print.m: 'fig2dev' is required for specified output format, but binary is not available in PATH"); + error ("print:nofig2dev", "print: 'fig2dev' is required for specified output format, but binary is not available in PATH"); endif dos_shell = (ispc () && ! isunix ()); @@ -977,13 +977,13 @@ fid = fopen (latexfile, "r"); if (fid < 0) error ("print:erroropeningfile", - "print.m: error opening file '%s'", latexfile); + "print: error opening file '%s'", latexfile); endif latex = fscanf (fid, "%c", Inf); status = fclose (fid); if (status != 0) error ("print:errorclosingfile", - "print.m: error closing file '%s'", latexfile); + "print: error closing file '%s'", latexfile); endif ## FIXME: should this be fixed in GL2PS? latex = strrep (latex, "\\includegraphics{}", @@ -997,11 +997,11 @@ status = fclose (fid); if (status != 0) error ("print:errorclosingfile", - "print.m: error closing file '%s'", latexfile); + "print: error closing file '%s'", latexfile); endif else error ("print:erroropeningfile", - "print.m: error opening file '%s'", latexfile); + "print: error opening file '%s'", latexfile); endif endfunction @@ -1021,7 +1021,7 @@ cmd = sprintf ("%s %s", cmd, opts.printer); endif elseif (isempty (opts.lpr_binary)) - error ("print:nolpr", "print.m: 'lpr' not found in PATH"); + error ("print:nolpr", "print: 'lpr' not found in PATH"); endif if (opts.debug) fprintf ("lpr command: '%s'\n", cmd); @@ -1037,8 +1037,7 @@ if (isempty (opts.pstoedit_binary)) error ("print:nopstoedit", ... - ["print.m: 'pstoedit' is required for specified output format, ", ... - "but binary is not available in PATH"]); + "print: 'pstoedit' is required for specified output format, but binary is not available in PATH"); endif dos_shell = (ispc () && ! isunix ());
--- a/scripts/plot/util/private/__ghostscript__.m Mon Apr 22 21:08:08 2019 -0700 +++ b/scripts/plot/util/private/__ghostscript__.m Mon Apr 22 21:53:52 2019 -0700 @@ -61,7 +61,7 @@ endfor if (isempty (opts.binary)) - error ("print:no_ghostscript", "__ghostscript__.m: Ghostscript binary is required for specified output format, but binary is not available in PATH"); + error ("print:nogs", "__ghostscript__: 'gs' (Ghostscript) binary is required for specified output format, but binary is not available in PATH"); endif if (isempty (opts.papersize))
--- a/scripts/plot/util/private/__gnuplot_print__.m Mon Apr 22 21:08:08 2019 -0700 +++ b/scripts/plot/util/private/__gnuplot_print__.m Mon Apr 22 21:53:52 2019 -0700 @@ -114,7 +114,7 @@ local_drawnow (["tikz " gp_opts], opts.name, opts); else error (sprintf ("print:no%soutput", opts.devopt), - "print.m: '%s' output is not available for gnuplot-%s", + "print: '%s' output is not available for gnuplot-%s", upper (opts.devopt), __gnuplot_version__ ()); endif case "svg" @@ -144,7 +144,7 @@ local_drawnow ([term " " gp_opts], opts.name, opts); else error (sprintf ("print:no%soutput", opts.devopt), - "print.m: '%s' output is not available for gnuplot-%s", + "print: '%s' output is not available for gnuplot-%s", upper (opts.devopt), __gnuplot_version__ ()); endif case {"canvas", "cgm", "dxf", "hpgl", "latex", "mf", "gif", ... @@ -153,7 +153,7 @@ local_drawnow ([opts.devopt " " gp_opts], opts.name, opts); else error (sprintf ("print:no%soutput", opts.devopt), - "print.m: '%s' output is not available for gnuplot-%s", + "print: '%s' output is not available for gnuplot-%s", upper (opts.devopt), __gnuplot_version__ ()); endif case "dumb" @@ -187,7 +187,7 @@ endif otherwise error (sprintf ("print:no%soutput", opts.devopt), - "print.m: %s output is not available for the Gnuplot graphics toolkit", + "print: %s output is not available for the Gnuplot graphics toolkit", upper (opts.devopt)); endswitch
--- a/scripts/plot/util/private/__opengl_print__.m Mon Apr 22 21:08:08 2019 -0700 +++ b/scripts/plot/util/private/__opengl_print__.m Mon Apr 22 21:53:52 2019 -0700 @@ -179,7 +179,7 @@ endif otherwise error (sprintf ("print:no%soutput", opts.devopt), - "print.m: %s output is not available for OpenGL toolkits", + "print: %s output is not available for OpenGL toolkits", upper (opts.devopt)); endswitch
--- a/scripts/plot/util/private/__print_parse_opts__.m Mon Apr 22 21:08:08 2019 -0700 +++ b/scripts/plot/util/private/__print_parse_opts__.m Mon Apr 22 21:53:52 2019 -0700 @@ -355,10 +355,10 @@ endif else arg_st.append_to_file = false; - warning ("print.m: appended output requires Ghostscript to be installed"); + warning ("print: appended output requires Ghostscript to be installed"); endif else - warning ("print.m: appended output is not supported for device '%s'", + warning ("print: appended output is not supported for device '%s'", arg_st.devopt); arg_st.append_to_file = false; endif @@ -746,7 +746,7 @@ value *= (72 / 2.54); case "normalized" error ("print:customnormalized", - "print.m: papersize=='<custom>' and paperunits='normalized' may not be combined"); + "print: papersize=='<custom>' and paperunits='normalized' may not be combined"); endswitch endfunction