File: //lib64/python3.9/__pycache__/cgi.cpython-39.opt-1.pyc
a
    �DOg��  �                   @   sV  d Z dZddlmZmZmZ ddlmZ ddlZddl	Z	ddl
Zddlm
Z
 ddlmZ ddlZddlZddlZg d�Zd	adad
d� Zdd
� Zdd� Zdd� Zeadade	jdddfdd�Zd2dd�Zdd� Zdd� Z G dd� d�Z!G dd � d �Z"e	jfd!d"�Z#d3d#d$�Z$e	jfd%d&�Z%d'd(� Z&d)d*� Z'd+d,� Z(d-d.� Z)d/d0� Z*e+d1k�rRe#�  dS )4z�Support module for CGI (Common Gateway Interface) scripts.
This module defines a number of utilities for use by CGI scripts
written in Python.
z2.6�    )�StringIO�BytesIO�
TextIOWrapper)�MappingN)�
FeedParser)�Message)�MiniFieldStorage�FieldStorage�parse�parse_multipart�parse_header�test�print_exception�
print_environ�
print_form�print_directory�print_arguments�print_environ_usage� c                  G   sD   t r*ts*ztt d�aW n ty(   Y n0 ts4tantat| �  dS )a�  Write a log message, if there is a log file.
    Even though this function is called initlog(), you should always
    use log(); log is a variable that is set either to initlog
    (initially), to dolog (once the log file has been opened), or to
    nolog (when logging is disabled).
    The first argument is a format string; the remaining arguments (if
    any) are arguments to the % operator, so e.g.
        log("%s: %s", "a", "b")
    will write "a: b" to the log file, followed by a newline.
    If the global logfp is not None, it should be a file object to
    which log data is written.
    If the global logfp is None, the global logfile may be a string
    giving a filename to open, in append mode.  This file should be
    world writable!!!  If the file can't be opened, logging is
    silently disabled (since there is no safe place where we could
    send an error message).
    �aN)�logfile�logfp�open�OSError�nolog�log�dolog�Zallargs� r   �/usr/lib64/python3.9/cgi.py�initlog8   s    r    c                 G   s   t �| | d � dS )z=Write a log message to the log file.  See initlog() for docs.�
N)r   �write)�fmt�argsr   r   r   r   [   s    r   c                  G   s   dS )z9Dummy function, assigned to log when logging is disabled.Nr   r   r   r   r   r   _   s    r   c                   C   s   da trt��  datadS )zClose the log file.r   N)r   r   �closer    r   r   r   r   r   �closelogc   s
    r&