Thu, 24 Oct 2013 19:04:41 +0200
Fixed some code style issues.
--- a/AssistantEric/APIsManager.py Sun Oct 13 18:32:15 2013 +0200 +++ b/AssistantEric/APIsManager.py Thu Oct 24 19:04:41 2013 +0200 @@ -11,7 +11,8 @@ import os -from PyQt4.QtCore import QTimer, QThread, QFileInfo, pyqtSignal, QDateTime, QObject, Qt +from PyQt4.QtCore import QTimer, QThread, QFileInfo, pyqtSignal, QDateTime, \ + QObject, Qt try: from PyQt4.QtSql import QSqlDatabase, QSqlQuery except ImportError: @@ -44,8 +45,10 @@ processing = pyqtSignal(int, str) populate_api_stmt = """ - INSERT INTO api (acWord, context, fullContext, signature, fileId, pictureId) - VALUES (:acWord, :context, :fullContext, :signature, :fileId, :pictureId) + INSERT INTO api ( + acWord, context, fullContext, signature, fileId, pictureId) + VALUES ( + :acWord, :context, :fullContext, :signature, :fileId, :pictureId) """ populate_del_api_stmt = """ DELETE FROM api WHERE fileId = :fileId @@ -74,7 +77,8 @@ DELETE FROM file WHERE id = :id """ - def __init__(self, proxy, language, apiFiles, projectPath="", refresh=False): + def __init__(self, proxy, language, apiFiles, projectPath="", + refresh=False): """ Constructor @@ -83,15 +87,16 @@ @param apiFiles list of API files to process (list of strings) @param projectPath path of the project. Only needed, if the APIs are extracted out of the sources of a project. (string) - @param refresh flag indicating a refresh of the APIs of one file (boolean) + @param refresh flag indicating a refresh of the APIs of one file + (boolean) """ QThread.__init__(self) self.setTerminationEnabled(True) - # Get the AC word separators for all of the languages that the editor supports. - # This has to be before we create a new thread, because access to GUI elements - # is not allowed from non-gui threads. + # Get the AC word separators for all of the languages that the editor + # supports. This has to be before we create a new thread, because + # access to GUI elements is not allowed from non-GUI threads. self.__wseps = {} for lang in QScintilla.Lexers.getSupportedLanguages(): lexer = QScintilla.Lexers.getLexer(lang) @@ -142,7 +147,8 @@ finally: db.commit() if self.__projectPath: - modTime = QFileInfo(os.path.join(self.__projectPath, apiFile)).lastModified() + modTime = QFileInfo(os.path.join(self.__projectPath, apiFile))\ + .lastModified() else: modTime = QFileInfo(apiFile).lastModified() basesFile = os.path.splitext(apiFile)[0] + ".bas" @@ -177,7 +183,8 @@ id = Editor.AttributeProtectedID else: id = Editor.AttributePrivateID - api.append('{0}{1}?{2:d}'.format(classNameStr, variable, id)) + api.append('{0}{1}?{2:d}'.format(classNameStr, variable, + id)) return api def __loadApiFile(self, apiFile): @@ -201,14 +208,16 @@ apiGenerator = APIGenerator(module) apis = apiGenerator.genAPI(True, "", True) if os.path.basename(apiFile).startswith("Ui_"): - # it is a forms source file, extract public attributes as well + # it is a forms source file, extract public attributes + # as well apis.extend(self.__classesAttributesApi(module)) try: basesDict = apiGenerator.genBases(True) for baseEntry in basesDict: if basesDict[baseEntry]: bases.append("{0} {1}\n".format( - baseEntry, " ".join(sorted(basesDict[baseEntry])))) + baseEntry, " ".join( + sorted(basesDict[baseEntry])))) except AttributeError: # eric 5.1 doesn't have this method pass @@ -222,7 +231,8 @@ try: basesFile = os.path.splitext(apiFile)[0] + ".bas" if os.path.exists(basesFile): - bases = Utilities.readEncodedFile(basesFile)[0].splitlines(True) + bases = Utilities.readEncodedFile(basesFile)[0]\ + .splitlines(True) except (IOError, UnicodeError): pass language = None @@ -237,8 +247,10 @@ """ Private method to store file info only. - Doing this avoids rereading the file whenever the API is initialized in case - the given file doesn't contain API data. + Doing this avoids rereading the file whenever the API is initialized + in case the given file doesn't contain API data. + + @param apiFile file name of the API file (string) """ db = QSqlDatabase.database(self.__language) db.transaction() @@ -458,8 +470,8 @@ """ Class implementing an API storage entity. - @signal apiPreparationStatus(language, status, file) emitted to indicate the - API preparation status for a language + @signal apiPreparationStatus(language, status, file) emitted to indicate + the API preparation status for a language """ apiPreparationStatus = pyqtSignal(str, int, str) @@ -508,7 +520,8 @@ create_context_idx = """CREATE INDEX context_idx on api (context)""" drop_context_idx = """DROP INDEX IF EXISTS context_idx""" - create_fullContext_idx = """CREATE INDEX fullContext_idx on api (fullContext)""" + create_fullContext_idx = \ + """CREATE INDEX fullContext_idx on api (fullContext)""" drop_fullContext_idx = """DROP INDEX IF EXISTS fullContext_idx""" create_bases_idx = """CREATE INDEX base_idx on bases (class)""" @@ -559,7 +572,7 @@ """ mgmt_insert_stmt = """ INSERT INTO mgmt (format) VALUES ({0:d}) - """.format(DB_VERSION) + """.format(DB_VERSION) def __init__(self, language, parent=None): """ @@ -592,7 +605,8 @@ self.__project.newProject.connect(self.__projectOpened) self.__project.projectClosed.connect(self.__projectClosed) try: - self.__project.projectFormCompiled.connect(self.__projectFormCompiled) + self.__project.projectFormCompiled.connect( + self.__projectFormCompiled) except AttributeError: # older eric5 versions don't have this signal pass @@ -753,10 +767,10 @@ to be completed (string) @keyparam followHierarchy flag indicating to follow the hierarchy of base classes (boolean) - @return list of dictionaries with possible completions (key 'completion' - contains the completion (string), key 'context' - contains the context (string) and key 'pictureId' - contains the ID of the icon to be shown (string)) + @return list of dictionaries with possible completions + (key 'completion' contains the completion (string), + key 'context' contains the context (string) and + key 'pictureId' contains the ID of the icon to be shown (string)) """ completions = [] @@ -811,10 +825,12 @@ Public method to determine the calltips. @param acWord function to get calltips for (string) - @param commas minimum number of commas contained in the calltip (integer) + @param commas minimum number of commas contained in the calltip + (integer) @param context string giving the context (e.g. classname) (string) @param fullContext string giving the full context (string) - @param showContext flag indicating to show the calltip context (boolean) + @param showContext flag indicating to show the calltip context + (boolean) @keyparam followHierarchy flag indicating to follow the hierarchy of base classes (boolean) @return list of calltips (list of string) @@ -870,19 +886,21 @@ else: bases = [] for base in bases: - calltips.extend(self.getCalltips(acWord, commas, context=base, - showContext=showContext, - followHierarchy=True)) + calltips.extend(self.getCalltips( + acWord, commas, context=base, showContext=showContext, + followHierarchy=True)) if context and len(calltips) == 0 and not followHierarchy: # nothing found, try without a context - calltips = self.getCalltips(acWord, commas, showContext=showContext) + calltips = self.getCalltips( + acWord, commas, showContext=showContext) return calltips def __enoughCommas(self, s, commas): """ - Private method to determine, if the given string contains enough commas. + Private method to determine, if the given string contains enough + commas. @param s string to check (string) @param commas number of commas to check for (integer) @@ -911,10 +929,12 @@ """ Private method to get the source files for the project forms. - @keyparam normalized flag indicating a normalized filename is wanted (boolean) + @keyparam normalized flag indicating a normalized filename is wanted + (boolean) @return list of project form sources (list of strings) """ - if self.__project.pdata["PROGLANGUAGE"][0] in ["Python", "Python2", "Python3"]: + if self.__project.pdata["PROGLANGUAGE"][0] in ["Python", "Python2", + "Python3"]: sourceExt = ".py" elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby": sourceExt = ".rb" @@ -927,7 +947,8 @@ dirname, filename = os.path.split(ofn) formSource = os.path.join(dirname, "Ui_" + filename + sourceExt) if normalized: - formSource = os.path.join(self.__project.getProjectPath(), formSource) + formSource = os.path.join( + self.__project.getProjectPath(), formSource) formsSources.append(formSource) return formsSources @@ -946,12 +967,15 @@ elif self.__language == ApisNameProject: apiFiles = self.__project.getSources()[:] apiFiles.extend( - [f for f in self.__getProjectFormSources() if f not in apiFiles]) + [f for f in self.__getProjectFormSources() if + f not in apiFiles]) projectPath = self.__project.getProjectPath() else: apiFiles = Preferences.getEditorAPI(self.__language) - self.__worker = DbAPIsWorker(self, self.__language, apiFiles, projectPath) - self.__worker.processing.connect(self.__processingStatus, Qt.QueuedConnection) + self.__worker = DbAPIsWorker(self, self.__language, apiFiles, + projectPath) + self.__worker.processing.connect( + self.__processingStatus, Qt.QueuedConnection) self.__worker.start() def __processQueue(self): @@ -969,9 +993,10 @@ apiFiles = [apiFiles[0].replace(projectPath + os.sep, "")] else: projectPath = "" - self.__worker = DbAPIsWorker(self, self.__language, apiFiles, projectPath, - refresh=True) - self.__worker.processing.connect(self.__processingStatus, Qt.QueuedConnection) + self.__worker = DbAPIsWorker(self, self.__language, apiFiles, + projectPath, refresh=True) + self.__worker.processing.connect( + self.__processingStatus, Qt.QueuedConnection) self.__worker.start() def getLexer(self): @@ -1002,17 +1027,21 @@ """ if status == WorkerStatusStarted: self.__inPreparation = True - self.apiPreparationStatus.emit(self.__language, WorkerStatusStarted, "") + self.apiPreparationStatus.emit( + self.__language, WorkerStatusStarted, "") elif status == WorkerStatusFinished: self.__inPreparation = False - self.apiPreparationStatus.emit(self.__language, WorkerStatusFinished, "") + self.apiPreparationStatus.emit( + self.__language, WorkerStatusFinished, "") QTimer.singleShot(0, self.__processQueue) elif status == WorkerStatusAborted: self.__inPreparation = False - self.apiPreparationStatus.emit(self.__language, WorkerStatusAborted, "") + self.apiPreparationStatus.emit( + self.__language, WorkerStatusAborted, "") QTimer.singleShot(0, self.__processQueue) elif status == WorkerStatusFile: - self.apiPreparationStatus.emit(self.__language, WorkerStatusFile, filename) + self.apiPreparationStatus.emit( + self.__language, WorkerStatusFile, filename) ######################################################## ## project related stuff below @@ -1022,11 +1051,13 @@ """ Private slot to perform actions after a project has been opened. """ - if self.__project.getProjectLanguage() in ["Python", "Python2", "Python3"]: + if self.__project.getProjectLanguage() in ["Python", "Python2", + "Python3"]: self.__discardFirst = ["self", "cls"] else: self.__discardFirst = [] - self.__lexer = QScintilla.Lexers.getLexer(self.__project.getProjectLanguage()) + self.__lexer = QScintilla.Lexers.getLexer( + self.__project.getProjectLanguage()) self.__openAPIs() def __projectClosed(self): @@ -1094,7 +1125,8 @@ Public method to get an apis object for autocompletion/calltips. This method creates and loads an APIs object dynamically upon request. - This saves memory for languages, that might not be needed at the moment. + This saves memory for languages, that might not be needed at the + moment. @param language the language of the requested api object (string) @return the apis object (APIs) @@ -1154,7 +1186,8 @@ def __apiPreparationCancelled(self, language): """ - Private slot handling the preparation cancelled signal of an API object. + Private slot handling the preparation cancelled signal of an API + object. @param language language of the API (string) """ @@ -1175,14 +1208,15 @@ language = self.trUtf8("Project") if status == WorkerStatusStarted: - self.__showMessage(self.trUtf8("Preparation of '{0}' APIs started.").format( - language)) + self.__showMessage(self.trUtf8( + "Preparation of '{0}' APIs started.").format(language)) elif status == WorkerStatusFile: - self.__showMessage(self.trUtf8("'{0}' APIs: Processing '{1}'").format( + self.__showMessage(self.trUtf8( + "'{0}' APIs: Processing '{1}'").format( language, os.path.basename(filename))) elif status == WorkerStatusFinished: - self.__showMessage(self.trUtf8("Preparation of '{0}' APIs finished.").format( - language)) + self.__showMessage(self.trUtf8( + "Preparation of '{0}' APIs finished.").format(language)) elif status == WorkerStatusAborted: - self.__showMessage(self.trUtf8("Preparation of '{0}' APIs cancelled.").format( - language)) + self.__showMessage(self.trUtf8( + "Preparation of '{0}' APIs cancelled.").format(language))
--- a/AssistantEric/Assistant.py Sun Oct 13 18:32:15 2013 +0200 +++ b/AssistantEric/Assistant.py Thu Oct 24 19:04:41 2013 +0200 @@ -155,7 +155,8 @@ in the current line. @param pos position to get character at (integer) - @param editor reference to the editor object to work with (QScintilla.Editor) + @param editor reference to the editor object to work with + (QScintilla.Editor) @return requested character or "", if there are no more (string) and the next position (i.e. pos - 1) """ @@ -260,7 +261,7 @@ depth = 0 while col > 0 and \ - not pat.match(text[col - 1]): + not pat.match(text[col - 1]): ch = text[col - 1] if ch == ')': depth = 1 @@ -344,16 +345,18 @@ word = "" if word or importCompletion: - completionsList = self.__getCompletions(word, context, prefix, language, - mod, editor, importCompletion, sep) + completionsList = self.__getCompletions( + word, context, prefix, language, mod, editor, + importCompletion, sep) if len(completionsList) == 0 and prefix: # searching with prefix didn't return anything, try without - completionsList = self.__getCompletions(word, context, "", language, - mod, editor, importCompletion, - sep) + completionsList = self.__getCompletions( + word, context, "", language, mod, editor, importCompletion, + sep) if len(completionsList) > 0: completionsList.sort() - editor.showUserList(EditorAutoCompletionListID, completionsList) + editor.showUserList(EditorAutoCompletionListID, + completionsList) def __getCompletions(self, word, context, prefix, language, module, editor, importCompletion, sep): @@ -384,8 +387,8 @@ projectCompletionList = self.__getApiCompletions( api, word, context, prefix, module, editor) - if self.__plugin.getPreferences("AutoCompletionSource") & AcsDocument and \ - not importCompletion: + if self.__plugin.getPreferences("AutoCompletionSource") & AcsDocument \ + and not importCompletion: docCompletionsList = self.__getDocumentCompletions( editor, word, context, sep, prefix, module) @@ -393,7 +396,7 @@ set(apiCompletionsList) .union(set(docCompletionsList)) .union(set(projectCompletionList)) - ) + ) return completionsList def __getApiCompletions(self, api, word, context, prefix, module, editor): @@ -419,14 +422,24 @@ for super in cl.super: if prefix == word: completions.extend( - api.getCompletions(context=super, - followHierarchy=self.__plugin.getPreferences( - "AutoCompletionFollowHierarchy"))) + api.getCompletions( + context=super, + followHierarchy= + self.__plugin.getPreferences( + "AutoCompletionFollowHierarchy" + ) + ) + ) else: completions.extend( - api.getCompletions(start=word, context=super, - followHierarchy=self.__plugin.getPreferences( - "AutoCompletionFollowHierarchy"))) + api.getCompletions( + start=word, context=super, + followHierarchy= + self.__plugin.getPreferences( + "AutoCompletionFollowHierarchy" + ) + ) + ) for completion in completions: if not completion["context"]: entry = completion["completion"] @@ -441,7 +454,8 @@ entry += "?{0}".format(completion["pictureId"]) else: cont = False - re = QRegExp(QRegExp.escape(entry) + "\?\d{,2}") + re = QRegExp( + QRegExp.escape(entry) + "\?\d{,2}") for comp in completionsList: if re.exactMatch(comp): cont = True @@ -462,7 +476,8 @@ completionsList.append(entry) else: if prefix: - completions = api.getCompletions(start=word, context=prefix) + completions = api.getCompletions( + start=word, context=prefix) if not prefix or not completions: # if no completions were returned try without prefix completions = api.getCompletions(start=word) @@ -491,8 +506,8 @@ completionsList.append(entry) return completionsList - def __getDocumentCompletions(self, editor, word, context, sep, prefix, module, - doHierarchy=False): + def __getDocumentCompletions(self, editor, word, context, sep, prefix, + module, doHierarchy=False): """ Private method to determine autocompletion proposals from the document. @@ -529,10 +544,11 @@ else: iconID = Editor.MethodID if hasattr(method, "modifier"): - if (prefix == "cls" and \ + if (prefix == "cls" and method.modifier == method.Class) or \ prefix == "self": - comps.append((method.name, cl.name, iconID)) + comps.append((method.name, cl.name, + iconID)) else: # eric 5.1 cannot differentiate method types comps.append((method.name, cl.name, iconID)) @@ -571,9 +587,10 @@ nword = sup else: nword = word - completionsList.extend(self.__getDocumentCompletions( - editor, nword, context, sep, sup, module, - doHierarchy=True)) + completionsList.extend( + self.__getDocumentCompletions( + editor, nword, context, sep, sup, + module, doHierarchy=True)) break else: @@ -625,9 +642,10 @@ nword = sup else: nword = word - completionsList.extend(self.__getDocumentCompletions( - editor, nword, context, sep, sup, module, - doHierarchy=True)) + completionsList.extend( + self.__getDocumentCompletions( + editor, nword, context, sep, sup, module, + doHierarchy=True)) if not prefixFound: currentPos = editor.currentPosition() @@ -638,8 +656,8 @@ sword = word.encode("utf-8") else: sword = word - res = editor.findFirstTarget(sword, False, - editor.autoCompletionCaseSensitivity(), + res = editor.findFirstTarget( + sword, False, editor.autoCompletionCaseSensitivity(), False, begline=0, begindex=0, ws_=True) while res: start, length = editor.getFoundTarget() @@ -654,7 +672,8 @@ completion += curWord[len(completion):] if completion and completion not in completionsList: completionsList.append( - "{0}?{1}".format(completion, self.__fromDocumentID)) + "{0}?{1}".format( + completion, self.__fromDocumentID)) res = editor.findNextTarget() @@ -687,7 +706,8 @@ @param editor reference to the editor (QScintilla.Editor) @param pos position in the text for the calltip (integer) - @param commas minimum number of commas contained in the calltip (integer) + @param commas minimum number of commas contained in the calltip + (integer) @return list of possible calltips (list of strings) """ language = editor.getLanguage() @@ -699,7 +719,7 @@ pat = re.compile("\w{0}".format(re.escape(wc))) text = editor.text(line) while col > 0 and \ - not pat.match(text[col - 1]): + not pat.match(text[col - 1]): col -= 1 word = editor.getWordLeft(line, col) @@ -757,7 +777,8 @@ @param api reference to the API object to be used (APIsManager.DbAPIs) @param word function to get calltips for (string) - @param commas minimum number of commas contained in the calltip (integer) + @param commas minimum number of commas contained in the calltip + (integer) @param prefix prefix of the word to be completed (string) @param module reference to the scanned module info (Module) @param editor reference to the editor object (QScintilla.Editor) @@ -770,19 +791,22 @@ if line >= cl.lineno and \ (cl.endlineno == -1 or line <= cl.endlineno): for super in cl.super: - calltips.extend(api.getCalltips(word, commas, super, None, - self.__plugin.getPreferences("CallTipsContextShown"), + calltips.extend(api.getCalltips( + word, commas, super, None, + self.__plugin.getPreferences( + "CallTipsContextShown"), followHierarchy=self.__plugin.getPreferences( "CallTipsFollowHierarchy"))) break else: - calltips = api.getCalltips(word, commas, self.__lastContext, - self.__lastFullContext, + calltips = api.getCalltips( + word, commas, self.__lastContext, self.__lastFullContext, self.__plugin.getPreferences("CallTipsContextShown")) return calltips - def __getDocumentCalltips(self, word, prefix, module, editor, doHierarchy=False): + def __getDocumentCalltips(self, word, prefix, module, editor, + doHierarchy=False): """ Private method to determine calltips from the document. @@ -807,15 +831,18 @@ method = cl.methods[word] if hasattr(method, "modifier"): if prefix == "self" or \ - (prefix == "cls" and \ - method.modifier == method.Class): - calltips.append("{0}{1}{2}({3})".format( - cl.name, - sep, - word, - ', '.join(method.parameters[1:]))) + (prefix == "cls" and + method.modifier == method.Class): + calltips.append( + "{0}{1}{2}({3})".format( + cl.name, + sep, + word, + ', '.join(method.parameters[1:] + ))) else: - # eric 5.1 cannot differentiate method types + # eric 5.1 cannot differentiate method + # types calltips.append("{0}{1}{2}({3})".format( cl.name, sep, @@ -824,7 +851,8 @@ for sup in cl.super: calltips.extend(self.__getDocumentCalltips( - word, sup, module, editor, doHierarchy=True)) + word, sup, module, editor, + doHierarchy=True)) break else: @@ -833,9 +861,10 @@ if word in cl.methods: method = cl.methods[word] if doHierarchy or \ - (hasattr(method, "modifier") and \ - method.modifier == method.Class): - # only eric 5.2 and newer can differentiate method types + (hasattr(method, "modifier") and + method.modifier == method.Class): + # only eric 5.2 and newer can differentiate + # method types calltips.append("{0}{1}{2}({3})".format( cl.name, sep,
--- a/AssistantEric/ConfigurationPages/AutoCompletionEricPage.py Sun Oct 13 18:32:15 2013 +0200 +++ b/AssistantEric/ConfigurationPages/AutoCompletionEricPage.py Thu Oct 24 19:04:41 2013 +0200 @@ -11,7 +11,8 @@ from AssistantEric.Assistant import AcsAPIs, AcsDocument, AcsProject -from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase +from Preferences.ConfigurationPages.ConfigurationPageBase import \ + ConfigurationPageBase from .Ui_AutoCompletionEricPage import Ui_AutoCompletionEricPage @@ -47,7 +48,8 @@ """ Public slot to save the Eric Autocompletion configuration. """ - self.__plugin.setPreferences("AutoCompletionEnabled", + self.__plugin.setPreferences( + "AutoCompletionEnabled", self.autocompletionCheckBox.isChecked()) acSource = 0 @@ -59,5 +61,6 @@ acSource |= AcsProject self.__plugin.setPreferences("AutoCompletionSource", acSource) - self.__plugin.setPreferences("AutoCompletionFollowHierarchy", + self.__plugin.setPreferences( + "AutoCompletionFollowHierarchy", self.hierarchyCheckBox.isChecked())
--- a/AssistantEric/ConfigurationPages/CallTipsEricPage.py Sun Oct 13 18:32:15 2013 +0200 +++ b/AssistantEric/ConfigurationPages/CallTipsEricPage.py Thu Oct 24 19:04:41 2013 +0200 @@ -9,7 +9,8 @@ from __future__ import unicode_literals # __IGNORE_WARNING__ -from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase +from Preferences.ConfigurationPages.ConfigurationPageBase import \ + ConfigurationPageBase from .Ui_CallTipsEricPage import Ui_CallTipsEricPage @@ -30,9 +31,9 @@ self.__plugin = plugin # set initial values - self.calltipsCheckBox.setChecked(\ + self.calltipsCheckBox.setChecked( self.__plugin.getPreferences("CalltipsEnabled")) - self.ctContextCheckBox.setChecked(\ + self.ctContextCheckBox.setChecked( self.__plugin.getPreferences("CallTipsContextShown")) self.hierarchyCheckBox.setChecked( self.__plugin.getPreferences("CallTipsFollowHierarchy")) @@ -41,9 +42,12 @@ """ Public slot to save the Eric Calltips configuration. """ - self.__plugin.setPreferences("CalltipsEnabled", + self.__plugin.setPreferences( + "CalltipsEnabled", self.calltipsCheckBox.isChecked()) - self.__plugin.setPreferences("CallTipsContextShown", + self.__plugin.setPreferences( + "CallTipsContextShown", self.ctContextCheckBox.isChecked()) - self.__plugin.setPreferences("CallTipsFollowHierarchy", + self.__plugin.setPreferences( + "CallTipsFollowHierarchy", self.hierarchyCheckBox.isChecked())
--- a/AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.APIsManager.html Sun Oct 13 18:32:15 2013 +0200 +++ b/AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.APIsManager.html Thu Oct 24 19:04:41 2013 +0200 @@ -113,7 +113,8 @@ <h4>APIsManager.__apiPreparationCancelled</h4> <b>__apiPreparationCancelled</b>(<i>language</i>) <p> - Private slot handling the preparation cancelled signal of an API object. + Private slot handling the preparation cancelled signal of an API + object. </p><dl> <dt><i>language</i></dt> <dd> @@ -177,7 +178,8 @@ Public method to get an apis object for autocompletion/calltips. </p><p> This method creates and loads an APIs object dynamically upon request. - This saves memory for languages, that might not be needed at the moment. + This saves memory for languages, that might not be needed at the + moment. </p><dl> <dt><i>language</i></dt> <dd> @@ -204,8 +206,8 @@ <dl> <dt>apiPreparationStatus(language, status, file)</dt> <dd> -emitted to indicate the - API preparation status for a language +emitted to indicate + the API preparation status for a language </dd> </dl> <h3>Derived from</h3> @@ -320,7 +322,8 @@ <h4>DbAPIs.__enoughCommas</h4> <b>__enoughCommas</b>(<i>s, commas</i>) <p> - Private method to determine, if the given string contains enough commas. + Private method to determine, if the given string contains enough + commas. </p><dl> <dt><i>s</i></dt> <dd> @@ -342,7 +345,8 @@ </p><dl> <dt><i>normalized=</i></dt> <dd> -flag indicating a normalized filename is wanted (boolean) +flag indicating a normalized filename is wanted + (boolean) </dd> </dl><dl> <dt>Returns:</dt> @@ -479,7 +483,8 @@ function to get calltips for (string) </dd><dt><i>commas</i></dt> <dd> -minimum number of commas contained in the calltip (integer) +minimum number of commas contained in the calltip + (integer) </dd><dt><i>context</i></dt> <dd> string giving the context (e.g. classname) (string) @@ -488,7 +493,8 @@ string giving the full context (string) </dd><dt><i>showContext</i></dt> <dd> -flag indicating to show the calltip context (boolean) +flag indicating to show the calltip context + (boolean) </dd><dt><i>followHierarchy=</i></dt> <dd> flag indicating to follow the hierarchy of @@ -521,10 +527,10 @@ </dl><dl> <dt>Returns:</dt> <dd> -list of dictionaries with possible completions (key 'completion' - contains the completion (string), key 'context' - contains the context (string) and key 'pictureId' - contains the ID of the icon to be shown (string)) +list of dictionaries with possible completions + (key 'completion' contains the completion (string), + key 'context' contains the context (string) and + key 'pictureId' contains the ID of the icon to be shown (string)) </dd> </dl><a NAME="DbAPIs.getLexer" ID="DbAPIs.getLexer"></a> <h4>DbAPIs.getLexer</h4> @@ -630,7 +636,8 @@ are extracted out of the sources of a project. (string) </dd><dt><i>refresh</i></dt> <dd> -flag indicating a refresh of the APIs of one file (boolean) +flag indicating a refresh of the APIs of one file + (boolean) </dd> </dl><a NAME="DbAPIsWorker.__autoCompletionWordSeparators" ID="DbAPIsWorker.__autoCompletionWordSeparators"></a> <h4>DbAPIsWorker.__autoCompletionWordSeparators</h4> @@ -718,9 +725,14 @@ <p> Private method to store file info only. </p><p> - Doing this avoids rereading the file whenever the API is initialized in case - the given file doesn't contain API data. -</p><a NAME="DbAPIsWorker.abort" ID="DbAPIsWorker.abort"></a> + Doing this avoids rereading the file whenever the API is initialized + in case the given file doesn't contain API data. +</p><dl> +<dt><i>apiFile</i></dt> +<dd> +file name of the API file (string) +</dd> +</dl><a NAME="DbAPIsWorker.abort" ID="DbAPIsWorker.abort"></a> <h4>DbAPIsWorker.abort</h4> <b>abort</b>(<i></i>) <p>
--- a/AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.Assistant.html Sun Oct 13 18:32:15 2013 +0200 +++ b/AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.Assistant.html Thu Oct 24 19:04:41 2013 +0200 @@ -186,7 +186,8 @@ function to get calltips for (string) </dd><dt><i>commas</i></dt> <dd> -minimum number of commas contained in the calltip (integer) +minimum number of commas contained in the calltip + (integer) </dd><dt><i>prefix</i></dt> <dd> prefix of the word to be completed (string) @@ -244,7 +245,8 @@ position to get character at (integer) </dd><dt><i>editor</i></dt> <dd> -reference to the editor object to work with (QScintilla.Editor) +reference to the editor object to work with + (QScintilla.Editor) </dd> </dl><dl> <dt>Returns:</dt> @@ -431,7 +433,8 @@ position in the text for the calltip (integer) </dd><dt><i>commas</i></dt> <dd> -minimum number of commas contained in the calltip (integer) +minimum number of commas contained in the calltip + (integer) </dd> </dl><dl> <dt>Returns:</dt>
--- a/AssistantEric/Documentation/source/Plugin_Assistant_Eric.PluginAssistantEric.html Sun Oct 13 18:32:15 2013 +0200 +++ b/AssistantEric/Documentation/source/Plugin_Assistant_Eric.PluginAssistantEric.html Thu Oct 24 19:04:41 2013 +0200 @@ -165,9 +165,6 @@ <dt><i>key</i></dt> <dd> the key of the value to get -</dd><dt><i>prefClass</i></dt> -<dd> -preferences class used as the storage area </dd> </dl><dl> <dt>Returns:</dt> @@ -186,9 +183,6 @@ </dd><dt><i>value</i></dt> <dd> the value to be set -</dd><dt><i>prefClass</i></dt> -<dd> -preferences class used as the storage area </dd> </dl> <div align="right"><a href="#top">Up</a></div> @@ -199,6 +193,11 @@ <p> Module function to create the autocompletion configuration page. </p><dl> +<dt><i>configDlg</i></dt> +<dd> +reference to the configuration dialog +</dd> +</dl><dl> <dt>Returns:</dt> <dd> reference to the configuration page @@ -212,6 +211,11 @@ <p> Module function to create the calltips configuration page. </p><dl> +<dt><i>configDlg</i></dt> +<dd> +reference to the configuration dialog +</dd> +</dl><dl> <dt>Returns:</dt> <dd> reference to the configuration page
--- a/ChangeLog Sun Oct 13 18:32:15 2013 +0200 +++ b/ChangeLog Thu Oct 24 19:04:41 2013 +0200 @@ -1,5 +1,8 @@ ChangeLog --------- +Version 2.6.1: +- fixed some code style issues + Version 2.6.0: - bug fixes - enhanced reaction upon changes of a project (eric 5.4.x required)
--- a/PluginAssistantEric.py Sun Oct 13 18:32:15 2013 +0200 +++ b/PluginAssistantEric.py Thu Oct 24 19:04:41 2013 +0200 @@ -25,11 +25,12 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "2.6.0" +version = "2.6.1" className = "AssistantEricPlugin" packageName = "AssistantEric" shortDescription = "Alternative autocompletion and calltips provider." -longDescription = """This plugin implements an alternative autocompletion and""" \ +longDescription = \ + """This plugin implements an alternative autocompletion and""" \ """ calltips provider.""" needsRestart = True pyqtApi = 2 @@ -44,6 +45,7 @@ """ Module function to create the autocompletion configuration page. + @param configDlg reference to the configuration dialog @return reference to the configuration page """ global assistantEricPluginObject @@ -57,6 +59,7 @@ """ Module function to create the calltips configuration page. + @param configDlg reference to the configuration dialog @return reference to the configuration page """ global assistantEricPluginObject @@ -73,16 +76,16 @@ @return dictionary containing the relevant data """ return { - "ericAutoCompletionPage": \ - [QApplication.translate("AssistantEricPlugin", "Eric"), - os.path.join("AssistantEric", "ConfigurationPages", - "eric.png"), - createAutoCompletionPage, "editorAutocompletionPage", None], - "ericCallTipsPage": \ - [QApplication.translate("AssistantEricPlugin", "Eric"), - os.path.join("AssistantEric", "ConfigurationPages", - "eric.png"), - createCallTipsPage, "editorCalltipsPage", None], + "ericAutoCompletionPage": [ + QApplication.translate("AssistantEricPlugin", "Eric"), + os.path.join("AssistantEric", "ConfigurationPages", + "eric.png"), + createAutoCompletionPage, "editorAutocompletionPage", None], + "ericCallTipsPage": [ + QApplication.translate("AssistantEricPlugin", "Eric"), + os.path.join("AssistantEric", "ConfigurationPages", + "eric.png"), + createCallTipsPage, "editorCalltipsPage", None], } @@ -203,8 +206,8 @@ if self.__ui is not None: loc = self.__ui.getLocale() if loc and loc != "C": - locale_dir = \ - os.path.join(os.path.dirname(__file__), "AssistantEric", "i18n") + locale_dir = os.path.join( + os.path.dirname(__file__), "AssistantEric", "i18n") translation = "assistant_{0}".format(loc) translator = QTranslator(None) loaded = translator.load(translation, locale_dir) @@ -212,8 +215,8 @@ self.__translator = translator e5App().installTranslator(self.__translator) else: - print("Warning: translation file '{0}' could not be loaded."\ - .format(translation)) + print("Warning: translation file '{0}' could not be" + " loaded.".format(translation)) print("Using default.") def getPreferences(self, key): @@ -221,7 +224,6 @@ Public method to retrieve the various refactoring settings. @param key the key of the value to get - @param prefClass preferences class used as the storage area @return the requested refactoring setting """ if key in ["AutoCompletionEnabled", "AutoCompletionFollowHierarchy", @@ -239,9 +241,9 @@ @param key the key of the setting to be set (string) @param value the value to be set - @param prefClass preferences class used as the storage area """ - Preferences.Prefs.settings.setValue(self.PreferencesKey + "/" + key, value) + Preferences.Prefs.settings.setValue( + self.PreferencesKey + "/" + key, value) if key in ["AutoCompletionEnabled", "CalltipsEnabled"]: self.__object.setEnabled(key, value)
--- a/PluginEricAssistant.e4p Sun Oct 13 18:32:15 2013 +0200 +++ b/PluginEricAssistant.e4p Thu Oct 24 19:04:41 2013 +0200 @@ -225,6 +225,12 @@ <value> <dict> <key> + <string>DocstringType</string> + </key> + <value> + <string>eric</string> + </value> + <key> <string>ExcludeFiles</string> </key> <value> @@ -234,7 +240,7 @@ <string>ExcludeMessages</string> </key> <value> - <string>E24, E501, W293</string> + <string>E24, W293, N802, N803, N807, N808, N821</string> </value> <key> <string>FixCodes</string> @@ -246,7 +252,13 @@ <string>FixIssues</string> </key> <value> - <bool>True</bool> + <bool>False</bool> + </value> + <key> + <string>HangClosing</string> + </key> + <value> + <bool>False</bool> </value> <key> <string>IncludeMessages</string> @@ -255,6 +267,18 @@ <string></string> </value> <key> + <string>MaxLineLength</string> + </key> + <value> + <int>79</int> + </value> + <key> + <string>NoFixCodes</string> + </key> + <value> + <string>E501</string> + </value> + <key> <string>RepeatMessages</string> </key> <value>