�
��g7 � �� � d dl Z d dlmZ d dlZd dlZ d dlmZmZmZ n# e $ r Y nw xY wd dl
mZ d dlm
Z
ddlmZ dd giZd
� Zd� Zd� Zdd
dddd�d�Z eddd�� � dd�� � ZdS )� N)�join)�STDOUT�CalledProcessError�check_output)�doctest_depends_on)�debug� )�latex)�preview�pygletc �H � t j dk rd}nd}t | d|i|��S )N�nti r �
creationflags)�os�namer )�args�kwargs�
creation_flags �f/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/printing/preview.py�_check_output_no_windowr s3 � �
�w�$���"�
�
��
���E�]�E�f�E�E�E� c �F � t j dt j � | � � d d�� � 5 }t | d� � 5 }t
j ||� � ddd� � n# 1 swxY w Y ddd� � n# 1 swxY w Y ddl}|� � � dk r"ddl
}|� d |j f� � dS |� � � d
k rt j
|j � � dS ddl
}|� d|j f� � dS )a Open fname with the default system viewer.
In practice, it is impossible for python to know when the system viewer is
done. For this reason, we ensure the passed file will not be deleted under
it, and this function does not attempt to block.
zsympy-preview-r F)�prefix�suffix�delete�rbNr �Darwin�open�Windowszxdg-open)�tempfile�NamedTemporaryFiler �path�splitextr �shutil�copyfileobj�platform�system�
subprocess�callr � startfile)�fname�fmt�temp_f�fr&