Example #1
0
 def _getindent(self, source):
     # figure out indent for given source
     try:
         s = str(source.getstatement(len(source) - 1))
     except KeyboardInterrupt:
         raise
     except:
         try:
             s = str(source[-1])
         except KeyboardInterrupt:
             raise
         except:
             return 0
     return 4 + (len(s) - len(s.lstrip()))
Example #2
0
File: code.py Project: alkorzt/pypy
 def _getindent(self, source):
     # figure out indent for given source 
     try:
         s = str(source.getstatement(len(source)-1))
     except KeyboardInterrupt: 
         raise 
     except:
         try:
             s = str(source[-1])
         except KeyboardInterrupt:
             raise
         except:
             return 0
     return 4 + (len(s) - len(s.lstrip()))
Example #3
0
 def statement(self):
     """ return a py.code.Source object for the current statement """
     source = self.frame.code.fullsource
     return source.getstatement(self.lineno)
Example #4
0
File: code.py Project: alkorzt/pypy
 def statement(self):
     """ return a py.code.Source object for the current statement """
     source = self.frame.code.fullsource
     return source.getstatement(self.lineno)