관리-도구
편집 파일: __init__.cpython-311.pyc
� �܋f� � � � d Z ddlmZ ddlmZ ddlZd� Zd� Zd� Zd� Zd � Z d � Z d� Z ej ej e e� � d� Zd � Z ej ej ee� � d� Zd� Z ej ej ee� � dS )zpylint_flask module� )�MANAGER)�nodesNc � � dS )zpregister is expected by pylint for plugins, but we are creating a transform, not registering a checker. N� )�_s �f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint_flask/__init__.py�registerr s � � �D� c �n � dD ]1}t | |� � rt ||t | |� � � � �2dS )z�Copy information from src to dest Every node in the AST has to have line number information. Get the information from the old stmt.)�lineno� fromlineno�tolineno� col_offset�parentN)�hasattr�setattr�getattr)�src�dest�attrs r �copy_node_infor sL � � )� 4� 4���3���� 4��D�$���T� 2� 2�3�3�3��4� 4r c � � d| _ dS )zAMark a node as transformed so we don't process it multiple times.TN)�pylint_flask_was_transformed��nodes r �mark_transformedr s � �(,�D�%�%�%r c �$ � t | dd� � S )z.Return True if `node` was already transformed.r F)r r s r �is_transformedr s � ��4�7��?�?�?r c � � t j d| � � }|�t d� � �|� d� � }d� |� � }|S )z+Convert a flask.ext.admin into flask_admin.�flask\.ext\.(.*)Nz7Module name `{}` doesn't match`flask.ext` style import.� �flask_{})�re�match�LookupError�group�format)�flask_ext_namer$ � from_name�actual_module_names r �make_non_magical_flask_importr+ $ sY � ��H�(�.�9�9�E��}�� 6� 7� 7� 7����A���I�#�*�*�9�5�5���r c �� � g }| j D ]3\ }}d� |� � }|� ||p|f� � �4t j � � }t | |� � ||_ t |� � |S )z�Translates a flask.ext from-style import into a non-magical import. Translates: from flask.ext import wtf, bcrypt as fcrypt Into: import flask_wtf as wtf, flask_bcrypt as fcrypt r"