Your IP : 216.73.216.196
B
���]�F � @ s d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlmZ ddl
m
Z
yddlmZ ddlmZ W n ek
r� ddlmZ Y nX dZd Zd
Zy<ejdkr�ej�d�Zn ej�e�d
�p�ej�d�d�ZW n ek
�r dZY nX dZej�ej�e�d�Z dZ!ddd�Z"dZ#e$dddg�Z%e$ej&dg �e% Z'e$dddddg�Z(e$ddd d!ddg�Z)e)�*d"d#d$d%dd&g�Z+e$d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:g�Z,e$d;�Z-e$e j.e j/g�Z/e/�*e j0e j1g�Z2e2�*e j3e j4g�Z5d<d=d>d?gZ6e�7d@�Z8e�7dA�Z9e�7dB�Z:e�7dC�Z;e�7dD�Z<e�7dE�Z=e�7dF�Z>e�7dG�Z?e�7dH�Z@e�7dI�ZAe�7dJd$�e'� �ZBe�7dK�ZCe�7dL�ZDe�7dM�ZEe �FdNgjG��Hd�dO dNkZIdPdQ� ZJdRdS� ZKdTdU� ZLdVdW� ZMdXdY� ZNdZd[� ZOd\d]� ZPd^d_� ZQd`da� ZRdbdc� ZSddde� ZTdfdg� ZUdhdi� ZVdjdk� ZWdldm� ZXdndo� ZYdpdq� ZZdrds� Z[dtdu� Z\dvdw� Z]dxdy� Z^dzd{� Z_d|d}� Z`d~d� Zad�d�� Zbd�d�� Zcd�d�� Zdd�d�� Zed�d�� Zfd�d�� Zgejhd�k �r�d�d�� Zie�7d��jjZkejljmZnnd�d�� ZieojkZkd�d�� Zne�7d�ejp�jqZrd�d�� Zsd�d�� Ztd�d�d��Zuejvfd�d��Zwd�d�d��Zxd�d�� ZyeI�rJeyfd�d��Zyi i i d��Zzd�d�� Z{d�d�d��Z|d�d�� Z}e}� G d�d�� d�e~�ZG d�d�� d�e~�Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e~�Z�defd�d��Z�d�d�� Z�d�d�d��Z�d�d�d��Z�d�d�� Z�e�d�k�re�� dS )�a�
Check Python source code formatting, according to PEP 8.
For usage and a list of options, try this:
$ python pycodestyle.py -h
This program and its regression test suite live here:
https://github.com/pycqa/pycodestyle
Groups of errors and warnings:
E errors
W warnings
100 indentation
200 whitespace
300 blank lines
400 imports
500 line length
600 deprecation
700 statements
900 syntax error
� )�with_statementN)�OptionParser)�fnmatch)�RawConfigParser)�
TextIOWrapperz2.0.0z'.svn,CVS,.bzr,.hg,.git,__pycache__,.toxz!E121,E123,E126,E226,E24,E704,W503�win32z~\.pep8ZXDG_CONFIG_HOMEz ~/.configZpep8)z setup.cfgztox.ini� testsuite�O z+%(path)s:%(row)d:%(col)d: %(code)s %(text)sz%%(path)s:%(row)d: [%(code)s] %(text)s)�defaultZpylinti �False�None�True�printz>>z**�*�+�-�/z//�^�&�|z<<�%z**=z*=z/=z//=z+=z-=z!=z<>�<�>z%=z^=z&=z|=z==z<=z>=z<<=z>>=�=z �directories�filesz
logical lineszphysical linesz([ \t]*)zraise\s+\w+\s*,zraise\s+\w+\s*,.*,\s*\w+\s*$z\b[A-Z]\d{3}\bz u?r?["\']z[[({] | []}),;:]z[,;:]\s*(?: |\t)z?(\bNone|\bFalse|\bTrue)?\s*([=!]=)\s*(?(1)|(None|False|True))\bz!\b(not)\s+[^][)(}{ ]+\s+(in|is)\szE(?:[=!]=|is(?:\s+not)?)\s*type(?:s.\w+Type|\s*\(\s*([^)]*[^ )])\s*\))z(\s*)\b(?:%s)\b(\s*)z'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)z
\blambda\bz*^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$z#
� c C s: t �| ��d�}x$t|�D ]\}}||kr|dfS qW dS )aI Never mix tabs and spaces.
The most popular way of indenting Python is with spaces only. The
second-most popular way is with tabs only. Code indented with a mixture
of tabs and spaces should be converted to using spaces exclusively. When
invoking the Python command line interpreter with the -t option, it issues
warnings about code that illegally mixes tabs and spaces. When using -tt
these warnings become errors. These options are highly recommended!
Okay: if a == 0:\n a = 1\n b = 1
E101: if a == 0:\n a = 1\n\tb = 1
r z/E101 indentation contains mixed spaces and tabsN)�INDENT_REGEX�match�group� enumerate)�
physical_line�indent_char�indent�offset�char� r&