§
    nŸr]°  ã                   ó€   — d Z  G d„ d¦  «        ZddlZddlmZ ddlmZ d„ Z G d„ d	e¦  «        Z G d
„ d¦  «        ZdS )a  gp_java -- an interface to gnuplot used under Jython/Java.

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

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 )ÚGnuplotOptsao  The configuration options for gnuplot on generic platforms.

    Store the options in a class to make them easy to import and
    modify en masse.  If you want to modify the options from the
    command line or within a running program, do something like the
    following::

        import Gnuplot
        Gnuplot.GnuplotOpts.gnuplot_command = '/bin/mygnuplot'

    Úgnuploté   é    Úx11z| lprN)Ú__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© ó    ú1/usr/lib/python3/dist-packages/Gnuplot/gp_java.pyr   r      sS   € € € € € ð
ð 
ð  €OØÐØ€NØÐØÐØ€LØÐØ€LØ€KØ!"ÐÐÐr   r   r   N)ÚThread)ÚRuntimec                  ó   — t           j        S )zADetermine whether gnuplot recognizes the option '-persist'.

    )r   r   r   r   r   Útest_persistr   3   s   € õ
 Ô)Ð)r   c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚOutputProcessorzKIn a separate thread, read from one InputStream and output to a file.

    c                 óv   — || _         || _        t          j        | |¦  «         |                      d¦  «         d S )Nr   )ÚinputÚoutputr   Ú__init__Ú	setDaemon)ÚselfÚnamer    r!   s       r   r"   zOutputProcessor.__init__@   s:   € ØˆŒ
ØˆŒåŒ˜˜dÑ#Ô#Ð#Ø�Š�qÑÔÐÐÐr   c                 ó‚   — 	 | j                              t          | j                             ¦   «         ¦  «        ¦  «         Œ?©N)r!   ÚwriteÚchrr    Úread©r$   s    r   ÚrunzOutputProcessor.runG   s6   € ð	6ØŒK×Ò�c $¤*§/¢/Ñ"3Ô"3Ñ4Ô4Ñ5Ô5Ð5ð	6r   N)r   r	   r
   r   r"   r,   r   r   r   r   r   ;   s<   € € € € € ðð ðð ð ð6ð 6ð 6ð 6ð 6r   r   c                   ó8   — e Zd ZdZd	d„Zd„ Z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:


    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.

    Nc                 ó‚  — |€t           j        }t           j        g}|r2t          ¦   «         st	          d¦  «        ‚|                     d¦  «         t          t          j        ¦   «         d¦  «        } ||¦  «        | _	        t          d| j	                             ¦   «         t          j        ¦  «        | _        | j                             ¦   «          t          d| j	                             ¦   «         t          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-persistÚexecz!gnuplot standard output processorz gnuplot standard error processor)r   r   r   r   ÚRuntimeErrorÚappendÚgetattrr   Ú
getRuntimeÚprocessr   ÚgetInputStreamÚsysÚstdoutÚoutprocessorÚstartÚgetErrorStreamÚstderrÚerrprocessorÚgetOutputStreamr   )r$   ÚpersistÚcommandÚexec_methods       r   r"   zGnuplotProcess.__init__f   s  € ð  ˆ?Ý!Ô0ˆGÝÔ.Ð/ˆØð 	'Ý‘>”>ð 6Ý"ð $5ñ 6ô 6ð 6à�NŠN˜:Ñ&Ô&Ð&õ �gÔ0Ñ2Ô2°FÑ;Ô;ˆØ"�{ 7Ñ+Ô+ˆŒå+Ø/ØŒL×'Ò'Ñ)Ô)­3¬:ñô ˆÔð 	Ô×ÒÑ!Ô!Ð!Ý+Ø.ØŒL×'Ò'Ñ)Ô)­3¬:ñô ˆÔð 	Ô×ÒÑ!Ô!Ð!à”|×3Ò3Ñ5Ô5ˆŒˆˆr   c                 óX   — | j         �"| j                              ¦   «          d | _         d S d S r'   )r   Úcloser+   s    r   rC   zGnuplotProcess.close•   s1   € àŒ<Ð#ØŒL×ÒÑ Ô Ð ØˆDŒLˆLˆLð $Ð#r   c                 ó.   — |                       ¦   «          d S r'   )rC   r+   s    r   Ú__del__zGnuplotProcess.__del__›   s   € Ø�
Š
‰Œˆˆˆr   c                 ó:   — | j                              |¦  «         d S r'   )r   r(   ©r$   Úss     r   r(   zGnuplotProcess.writež   s   € ØŒ×Ò˜1ÑÔÐÐÐr   c                 ó8   — | j                              ¦   «          d S r'   )r   Úflushr+   s    r   rJ   zGnuplotProcess.flush¡   s   € ØŒ×ÒÑÔÐÐÐr   c                 ó^   — |                       |dz   ¦  «         |                      ¦   «          dS )z6Send a command string to gnuplot, followed by newline.ú
N)r(   rJ   rG   s     r   Ú__call__zGnuplotProcess.__call__¤   s+   € ð 	�
Š
�1�t‘8ÑÔÐØ�
Š
‰Œˆˆˆr   r'   )
r   r	   r
   r   r"   rC   rE   r(   rJ   rM   r   r   r   r.   r.   L   s~   € € € € € ðð ð2-6ð -6ð -6ð -6ð^ ð  ð  ðð ð ðð ð ðð ð ðð ð ð ð r   r.   )	r   r   r7   Ú	java.langr   r   r   r   r.   r   r   r   ú<module>rO      sÛ   ððð ð#ð #ð #ð #ð #ñ #ô #ð #ð4 €
€
€
à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ð*ð *ð *ð6ð 6ð 6ð 6ð 6�fñ 6ô 6ð 6ð"\ð \ð \ð \ð \ñ \ô \ð \ð \ð \r   