관리-도구
편집 파일: fix_print.cpython-37.pyc
B �A�[8 � @ s\ d Z ddlmZmZmZ ddlmZ ddlmZm Z m Z mZ e�d�Z G dd� dej�ZdS ) a, Fixer for print. Change: "print" into "print()" "print ..." into "print(...)" "print(...)" not changed "print ... ," into "print(..., end=' ')" "print >>x, ..." into "print(..., file=x)" No changes are applied if print_function is imported from __future__ � )�patcomp�pytree� fixer_base)�token)�Name�Call�Comma�Stringz8atom< '(' [arith_expr|atom|power|term|STRING|NAME] ')' >c @ s$ e Zd ZdZdZdd� Zdd� ZdS )�FixPrintTzP simple_stmt< any* bare='print' any* > | print_stmt c C s� |st �|�d�}|r4|�ttd�g |jd�� d S |jd td�ksJt �|jdd � }t|�dkrvt� |d �rvd S d } }}|r�|d t � kr�|d d� }d}|r�|d t�t jd�kr�t|�d ks�t �|d �� }|d d � }dd� |D �}|�rd |d _|d k �s"|d k �s"|d k �rz|d k �rB| �|dtt|��� |d k �rb| �|dtt|��� |d k �rz| �|d|� ttd�|�} |j| _| S )NZbare�print)�prefixr � ���� z>>� � c S s g | ]}|� � �qS � )�clone)�.0�argr r �L/opt/alt/python37/lib/python3.7/site-packages/libfuturize/fixes/fix_print.py� <listcomp>A s z&FixPrint.transform.<locals>.<listcomp>� �sep�end�file)�AssertionError�get�replacer r r �children�len�parend_expr�matchr r �Leafr � RIGHTSHIFTr � add_kwargr �repr) �self�node�resultsZ bare_print�argsr r r Zl_argsZn_stmtr r r � transform$ s>