home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python2.6 / lib2to3 / fixes / fix_funcattrs.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.1 KB  |  16 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. '''Fix function attribute names (f.func_x -> f.__x__).'''
  5. from  import fixer_base
  6. from fixer_util import Name
  7.  
  8. class FixFuncattrs(fixer_base.BaseFix):
  9.     PATTERN = "\n    power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals'\n                                  | 'func_name' | 'func_defaults' | 'func_code'\n                                  | 'func_dict') > any* >\n    "
  10.     
  11.     def transform(self, node, results):
  12.         attr = results['attr'][0]
  13.         attr.replace(Name('__%s__' % attr.value[5:], prefix = attr.get_prefix()))
  14.  
  15.  
  16.