QScintilla/Editor.py

branch
maintenance
changeset 5680
b93cb6353cc0
parent 5633
1a767ca5bbf3
parent 5631
d0beabfaad42
child 5730
6422afc7adc4
diff -r 884cd9c9ce05 -r b93cb6353cc0 QScintilla/Editor.py
--- a/QScintilla/Editor.py	Thu Mar 23 18:58:56 2017 +0100
+++ b/QScintilla/Editor.py	Fri Apr 07 18:33:59 2017 +0200
@@ -1273,7 +1273,7 @@
         @return name of the selected pygments lexer (string)
         """
         from pygments.lexers import get_all_lexers
-        lexerList = sorted([l[0] for l in get_all_lexers()])
+        lexerList = sorted(l[0] for l in get_all_lexers())
         try:
             lexerSel = lexerList.index(
                 self.getLanguage(normalized=False, forPygments=True))
@@ -3002,9 +3002,9 @@
         if self.fileName:
             filterPattern = "(*{0})".format(
                 os.path.splitext(self.fileName)[1])
-            for filter in Lexers.getSaveFileFiltersList(True):
-                if filterPattern in filter:
-                    defaultFilter = filter
+            for fileFilter in Lexers.getSaveFileFiltersList(True):
+                if filterPattern in fileFilter:
+                    defaultFilter = fileFilter
                     break
             else:
                 defaultFilter = Preferences.getEditor("DefaultSaveFilter")
@@ -4647,14 +4647,14 @@
         elif self.autoCompletionSource() != QsciScintilla.AcsNone:
             self.autoCompleteQScintilla()
     
-    def __completionListSelected(self, id, txt):
+    def __completionListSelected(self, listId, txt):
         """
         Private slot to handle the selection from the completion list.
         
-        @param id the ID of the user list (should be 1) (integer)
+        @param listId the ID of the user list (should be 1 or 2) (integer)
         @param txt the selected text (string)
         """
-        if id == EditorAutoCompletionListID:
+        if listId == EditorAutoCompletionListID:
             lst = txt.split()
             if len(lst) > 1:
                 txt = lst[0]
@@ -4674,7 +4674,7 @@
                     txt = txt[len(wLeft):]
             self.insert(txt)
             self.setCursorPosition(line, col + len(txt))
-        elif id == TemplateCompletionListID:
+        elif listId == TemplateCompletionListID:
             self.__applyTemplate(txt, self.getLanguage())
     
     def canProvideDynamicAutoCompletion(self):
@@ -7337,12 +7337,12 @@
         """
         self.__inSharedEdit = True
         self.__savedText = self.text()
-        hash = str(
+        hashStr = str(
             QCryptographicHash.hash(
                 Utilities.encode(self.__savedText, self.encoding)[0],
                 QCryptographicHash.Sha1).toHex(),
             encoding="utf-8")
-        self.__send(Editor.StartEditToken, hash)
+        self.__send(Editor.StartEditToken, hashStr)
     
     def sendSharedEdit(self):
         """
@@ -7432,12 +7432,12 @@
             self.__inRemoteSharedEdit = True
             self.setReadOnly(True)
             self.__updateReadOnly()
-            hash = str(
+            hashStr = str(
                 QCryptographicHash.hash(
                     Utilities.encode(self.text(), self.encoding)[0],
                     QCryptographicHash.Sha1).toHex(),
                 encoding="utf-8")
-            if hash != argsString:
+            if hashStr != argsString:
                 # text is different to the remote site, request to sync it
                 self.__isSyncing = True
                 self.__send(Editor.RequestSyncToken, argsString)
@@ -7515,13 +7515,13 @@
         @param argsString string containing the command parameters (string)
         """
         if self.__inSharedEdit:
-            hash = str(
+            hashStr = str(
                 QCryptographicHash.hash(
                     Utilities.encode(self.__savedText, self.encoding)[0],
                     QCryptographicHash.Sha1).toHex(),
                 encoding="utf-8")
             
-            if hash == argsString:
+            if hashStr == argsString:
                 self.__send(Editor.SyncToken, self.__savedText)
     
     def __processSyncCommand(self, argsString):

eric ide

mercurial