コード例 #1
0
ファイル: code.py プロジェクト: Coder206/servo
 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()))
コード例 #2
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()))
コード例 #3
0
 def statement(self):
     """ py.code.Source object for the current statement """
     source = self.frame.code.fullsource
     return source.getstatement(self.lineno)
コード例 #4
0
ファイル: code.py プロジェクト: Coder206/servo
 def statement(self):
     """ py.code.Source object for the current statement """
     source = self.frame.code.fullsource
     return source.getstatement(self.lineno)