| Server IP : 118.27.122.248 / Your IP : 216.73.217.130 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python36/lib64/python3.6/Tools/scripts/__pycache__/ |
Upload File : |
3 x2_� � @ s\ d Z ddlZddlZddlZddlZdd� Zdd� Zdd� Zd d � Ze dkrXej e� � dS )a finddiv - a grep-like tool that looks for division operators. Usage: finddiv [-l] file_or_directory ... For directory arguments, all files in the directory whose name ends in .py are processed, and subdirectories are processed recursively. This actually tokenizes the files to avoid false hits in comments or strings literals. By default, this prints all lines containing a / or /= operator, in grep -n style. With the -l option specified, it prints the filename of files that contain at least one / or /= operator. � Nc C s� yt j tjdd � d�\} }W n* t jk rH } zt|� dS d }~X nX |sZtd� dS d}x0| D ](\}}|dkr�tt� d S |dkrdd}qdW d }x|D ]}t||�}|p�|}q�W |S )N� Zlh� z&at least one file argument is requiredr z-hz-l)�getopt�sys�argv�error�usage�print�__doc__�process) Zopts�args�msg� listnames�o�a�exit�filename�x� r �:/opt/alt/python36/lib64/python3.6/Tools/scripts/finddiv.py�main s( r c C sJ t jjdt jd | f � t jjdt jd � t jjdt jd � d S )Nz%s: %s r zUsage: %s [-l] file ... z"Try `%s -h' for more information. )r �stderr�writer )r r r r r - s r c C s� t jj| �rt| |�S yt| �}W n0 tk rR } ztjjd| � dS d }~X nX t j |j�}d }xR|D ]J\}}\}} } }|dkrj|r�t| � P ||krj|}td| ||f dd� qjW |j � d S ) NzCan't open: %s r �/�/=z%s:%d:%s� )�end)r r )�os�path�isdir� processdir�open�IOErrorr r r �tokenize�generate_tokens�readliner �close)r r �fpr �gZlastrow�type�token�row�colr �liner r r r 2 s$ r c C s� yt j| �}W n0 tk r> } ztjjd| � dS d }~X nX g }xB|D ]:}t jj| |�}t jj|�j d�szt jj |�rJ|j|� qJW |jt jjd� d }x|D ]}t ||�}|p�|}q�W |S )NzCan't list directory: %s r z.py)�key)r �listdir�OSErrorr r r r �join�normcase�endswithr �append�sortr ) �dirr �namesr �files�name�fnr r r r r r F s r �__main__)r r r r r# r r r r �__name__r r r r r �<module> s