§
    nŸr]ã  ã                   óP   — d Z  G d„ d¦  «        ZddlmZ d„ Z G d„ d¦  «        ZdS )	a‚  gp_macosx -- an interface to the command line version of gnuplot 
used under Mac OS X.

The only difference between this interface and gp_unix is that
default_term is 'aqua'.

This file implements a low-level interface to gnuplot.  This file
should be imported through gp.py, which in turn should be imported via
'import Gnuplot' rather than using these low-level interfaces
directly.

c                   ó:   — e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZdS )ÚGnuplotOptsz|The configuration options for gnuplot on Mac OS X.

    See the gp_unix.py for documentation on all of the parameters.

    ÚgnuplotNé    é   Úaquaz| lpr)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úgnuplot_commandÚrecognizes_persistÚprefer_persistÚrecognizes_binary_splotÚprefer_inline_dataÚsupport_fifoÚprefer_fifo_dataÚdefault_termÚdefault_lprÚprefer_enhanced_postscript© ó    ú3/usr/lib/python3/dist-packages/Gnuplot/gp_macosx.pyr   r      sU   € € € € € ðð ð  €OØÐØ€NØÐØÐð €LØÐà€LØ€KØ!"ÐÐÐr   r   r   )Úpopenc                  ó  — t           j        €vddl} t          dt           j        z  d¦  «        }|                     ¦   «         }|                     ¦   «          | p|                      |d         d¦  «        dk    t           _        t           j        S )aË  Determine whether gnuplot recognizes the option '-persist'.

    If the configuration variable 'recognizes_persist' is set (i.e.,
    to something other than 'None'), return that value.  Otherwise,
    try to determine whether the installed version of gnuplot
    recognizes the -persist option.  (If it doesn't, it should emit an
    error message with '-persist' in the first line.)  Then set
    'recognizes_persist' accordingly for future reference.

    Nr   zecho | %s -persist 2>&1Úrz-persistéÿÿÿÿ)r   r   Ústringr   r   Ú	readlinesÚcloseÚfind)r   ÚgÚresponses      r   Útest_persistr#   2   sz   € õ Ô%Ð-ØˆˆˆÝÐ+­kÔ.IÑIÈ3ÑOÔOˆØ—;’;‘=”=ˆØ	�Š‰	Œ	ˆ	àˆ\ÐJ˜vŸ{š{¨8°A¬;¸
ÑCÔCÀrÒIõ 	Ô&åÔ)Ð)r   c                   ó,   — e Zd ZdZdd„Zd„ Zd„ Zd„ ZdS )ÚGnuplotProcessa^  Unsophisticated interface to a running gnuplot program.

    This represents a running gnuplot program and the means to
    communicate with it at a primitive level (i.e., pass it commands
    or data).  When the object is destroyed, the gnuplot program exits
    (unless the 'persist' option was set).  The communication is
    one-way; gnuplot's text output just goes to stdout with no attempt
    to check it for error messages.

    Members:

        'gnuplot' -- the pipe to the gnuplot command.

    Methods:

        '__init__' -- start up the program.

        '__call__' -- pass an arbitrary string to the gnuplot program,
            followed by a newline.

        'write' -- pass an arbitrary string to the gnuplot program.

        'flush' -- cause pending output to be written immediately.

        'close' -- close the connection to gnuplot.

    Nc                 ó(  — |€t           j        }|r@t          ¦   «         st          d¦  «        ‚t	          dt           j        z  d¦  «        | _        nt	          t           j        d¦  «        | _        | j        j        | _        | j        j        | _        dS )a  Start a gnuplot process.

        Create a 'GnuplotProcess' object.  This starts a gnuplot
        program and prepares to write commands to it.

        Keyword arguments:

          'persist=1' -- start gnuplot with the '-persist' option,
              (which leaves the plot window on the screen even after
              the gnuplot program ends, and creates a new plot window
              each time the terminal type is set to 'x11').  This
              option is not available on older versions of gnuplot.

        NzB-persist does not seem to be supported by your version of gnuplot!z%s -persistÚw)	r   r   r#   ÚRuntimeErrorr   r   r   ÚwriteÚflush)ÚselfÚpersists     r   Ú__init__zGnuplotProcess.__init__e   s‘   € ð  ˆ?Ý!Ô0ˆGØð 	CÝ‘>”>ð 6Ý"ð $5ñ 6ô 6ð 6å  µÔ1LÑ!LØ!$ñ&ô &ˆDŒLˆLõ !¥Ô!<¸cÑBÔBˆDŒLð ”\Ô'ˆŒ
Ø”\Ô'ˆŒ
ˆ
ˆ
r   c                 óX   — | j         �"| j                              ¦   «          d | _         d S d S ©N)r   r   ©r+   s    r   r   zGnuplotProcess.close„   s1   € ØŒ<Ð#ØŒL×ÒÑ Ô Ð ØˆDŒLˆLˆLð $Ð#r   c                 ó.   — |                       ¦   «          d S r/   )r   r0   s    r   Ú__del__zGnuplotProcess.__del__‰   s   € Ø�
Š
‰Œˆˆˆr   c                 ó^   — |                       |dz   ¦  «         |                      ¦   «          dS )z6Send a command string to gnuplot, followed by newline.ú
N)r)   r*   )r+   Úss     r   Ú__call__zGnuplotProcess.__call__Œ   s+   € ð 	�
Š
�1�t‘8ÑÔÐØ�
Š
‰Œˆˆˆr   r/   )r   r	   r
   r   r-   r   r2   r6   r   r   r   r%   r%   H   s_   € € € € € ðð ð8(ð (ð (ð (ð> ð  ð  ð
ð ð ðð ð ð ð r   r%   N)r   r   Úosr   r#   r%   r   r   r   ú<module>r8      s–   ððð ð#ð #ð #ð #ð #ñ #ô #ð #ð0 Ð Ð Ð Ð Ð ð*ð *ð *ð,Hð Hð Hð Hð Hñ Hô Hð Hð Hð Hr   