Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../usr/lib64/python2..../lib2to3/fixes
File: fix_funcattrs.py
"""Fix function attribute names (f.func_x -> f.__x__)."""
[0] Fix | Delete
# Author: Collin Winter
[1] Fix | Delete
[2] Fix | Delete
# Local imports
[3] Fix | Delete
from .. import fixer_base
[4] Fix | Delete
from ..fixer_util import Name
[5] Fix | Delete
[6] Fix | Delete
[7] Fix | Delete
class FixFuncattrs(fixer_base.BaseFix):
[8] Fix | Delete
BM_compatible = True
[9] Fix | Delete
[10] Fix | Delete
PATTERN = """
[11] Fix | Delete
power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals'
[12] Fix | Delete
| 'func_name' | 'func_defaults' | 'func_code'
[13] Fix | Delete
| 'func_dict') > any* >
[14] Fix | Delete
"""
[15] Fix | Delete
[16] Fix | Delete
def transform(self, node, results):
[17] Fix | Delete
attr = results["attr"][0]
[18] Fix | Delete
attr.replace(Name((u"__%s__" % attr.value[5:]),
[19] Fix | Delete
prefix=attr.prefix))
[20] Fix | Delete
[21] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function