QScintilla/TypingCompleters/CompleterPython.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3011
18292228c724
child 3060
5883ce99ee12
--- a/QScintilla/TypingCompleters/CompleterPython.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/QScintilla/TypingCompleters/CompleterPython.py	Fri Oct 18 23:00:41 2013 +0200
@@ -60,7 +60,8 @@
         """
         Public slot called to reread the configuration parameters.
         """
-        self.setEnabled(Preferences.getEditorTyping("Python/EnabledTypingAids"))
+        self.setEnabled(
+            Preferences.getEditorTyping("Python/EnabledTypingAids"))
         self.__insertClosingBrace = \
             Preferences.getEditorTyping("Python/InsertClosingBrace")
         self.__indentBrace = \
@@ -93,7 +94,8 @@
         @param charNumber value of the character entered (integer)
         """
         char = chr(charNumber)
-        if char not in ['(', ')', '{', '}', '[', ']', ' ', ',', "'", '"', '\n', ':']:
+        if char not in ['(', ')', '{', '}', '[', ']', ' ', ',', "'", '"',
+                        '\n', ':']:
             return  # take the short route
         
         line, col = self.editor.getCursorPosition()
@@ -137,7 +139,8 @@
                     self.editor.removeSelectedText()
         
         # space
-        # insert import, dedent to if for elif, dedent to try for except, dedent def
+        # insert import, dedent to if for elif, dedent to try for except,
+        # dedent def
         elif char == ' ':
             txt = self.editor.text(line)[:col]
             if self.__insertImport and self.__importRX.exactMatch(txt):
@@ -219,7 +222,8 @@
                             index -= 1
                         if openCount > closeCount and lastOpenIndex > col:
                             self.editor.insert(' ' * (lastOpenIndex - col + 1))
-                            self.editor.setCursorPosition(line, lastOpenIndex + 1)
+                            self.editor.setCursorPosition(
+                                line, lastOpenIndex + 1)
     
     def __dedentToIf(self):
         """
@@ -307,7 +311,8 @@
             if self.__py24StyleTry:
                 if (self.__exceptcRX.indexIn(txt) == 0 or \
                     self.__exceptRX.indexIn(txt) == 0 or \
-                    self.__finallyRX.indexIn(txt) == 0) and edInd <= indentation:
+                    self.__finallyRX.indexIn(txt) == 0) and \
+                        edInd <= indentation:
                     indentation = edInd - 1
                 elif self.__tryRX.indexIn(txt) == 0 and edInd <= indentation:
                     self.editor.cancelList()
@@ -318,7 +323,8 @@
                     indentation = edInd - 1
                 elif (self.__tryRX.indexIn(txt) == 0 or \
                       self.__exceptcRX.indexIn(txt) == 0 or \
-                      self.__exceptRX.indexIn(txt) == 0) and edInd <= indentation:
+                      self.__exceptRX.indexIn(txt) == 0) and \
+                        edInd <= indentation:
                     self.editor.cancelList()
                     self.editor.setIndentation(line, edInd)
                     break
@@ -326,8 +332,8 @@
     
     def __dedentDefStatement(self):
         """
-        Private method to dedent the line of the def statement to a previous def
-        statement or class statement.
+        Private method to dedent the line of the def statement to a previous
+        def statement or class statement.
         """
         line, col = self.editor.getCursorPosition()
         indentation = self.editor.indentation(line)
@@ -403,7 +409,7 @@
     
     def __inComment(self, line, col):
         """
-        Private method to check, if the cursor is inside a comment
+        Private method to check, if the cursor is inside a comment.
         
         @param line current line (integer)
         @param col current position within line (integer)
@@ -420,7 +426,8 @@
     
     def __inDoubleQuotedString(self):
         """
-        Private method to check, if the cursor is within a double quoted string.
+        Private method to check, if the cursor is within a double quoted
+        string.
         
         @return flag indicating, if the cursor is inside a double
             quoted string (boolean)
@@ -429,16 +436,19 @@
     
     def __inTripleDoubleQuotedString(self):
         """
-        Private method to check, if the cursor is within a triple double quoted string.
+        Private method to check, if the cursor is within a triple double
+        quoted string.
         
         @return flag indicating, if the cursor is inside a triple double
             quoted string (boolean)
         """
-        return self.editor.currentStyle() == QsciLexerPython.TripleDoubleQuotedString
+        return self.editor.currentStyle() == \
+            QsciLexerPython.TripleDoubleQuotedString
     
     def __inSingleQuotedString(self):
         """
-        Private method to check, if the cursor is within a single quoted string.
+        Private method to check, if the cursor is within a single quoted
+        string.
         
         @return flag indicating, if the cursor is inside a single
             quoted string (boolean)
@@ -447,9 +457,11 @@
     
     def __inTripleSingleQuotedString(self):
         """
-        Private method to check, if the cursor is within a triple single quoted string.
+        Private method to check, if the cursor is within a triple single
+        quoted string.
         
         @return flag indicating, if the cursor is inside a triple single
             quoted string (boolean)
         """
-        return self.editor.currentStyle() == QsciLexerPython.TripleSingleQuotedString
+        return self.editor.currentStyle() == \
+            QsciLexerPython.TripleSingleQuotedString

eric ide

mercurial