Sun, 22 Mar 2015 17:33:44 +0100
Fixed a few code style issues.
--- a/PluginRefactoringRope.py Sat Mar 14 14:24:53 2015 +0100 +++ b/PluginRefactoringRope.py Sun Mar 22 17:33:44 2015 +0100 @@ -81,16 +81,16 @@ @return dictionary containing the relevant data """ return { - "ropeAutoCompletionPage" : [ - QCoreApplication.translate("RefactoringRopePlugin", "Rope"), - os.path.join("RefactoringRope", "ConfigurationPage", - "preferences-refactoring.png"), - createAutoCompletionPage, "editorAutocompletionPage", None], - "ropeCallTipsPage" : \ - [QCoreApplication.translate("RefactoringRopePlugin", "Rope"), - os.path.join("RefactoringRope", "ConfigurationPage", - "preferences-refactoring.png"), - createCallTipsPage, "editorCalltipsPage", None], + "ropeAutoCompletionPage": [ + QCoreApplication.translate("RefactoringRopePlugin", "Rope"), + os.path.join("RefactoringRope", "ConfigurationPage", + "preferences-refactoring.png"), + createAutoCompletionPage, "editorAutocompletionPage", None], + "ropeCallTipsPage": [ + QCoreApplication.translate("RefactoringRopePlugin", "Rope"), + os.path.join("RefactoringRope", "ConfigurationPage", + "preferences-refactoring.png"), + createCallTipsPage, "editorCalltipsPage", None], } @@ -118,13 +118,13 @@ self.__initialize() self.__defaults = { - "CodeAssistEnabled" : False, - "MaxFixes" : 10, - "CodeAssistTimeout" : 100, + "CodeAssistEnabled": False, + "MaxFixes": 10, + "CodeAssistTimeout": 100, "ShowQScintillaCompletions": True, - "CodeAssistCalltipsEnabled" : False, - "CalltipsMaxFixes" : 10, + "CodeAssistCalltipsEnabled": False, + "CalltipsMaxFixes": 10, } self.__translator = None @@ -296,10 +296,9 @@ 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 ["CodeAssistEnabled", "CodeAssistCalltipsEnabled", + if key in ["CodeAssistEnabled", "CodeAssistCalltipsEnabled", "ShowQScintillaCompletions"]: return Preferences.toBool(Preferences.Prefs.settings.value( self.PreferencesKey + "/" + key, self.__defaults[key])) @@ -313,7 +312,6 @@ @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) @@ -484,7 +482,7 @@ editor.unsetAutoCompletionHook() editor.userListActivated.disconnect(self.__completionListSelected) - def codeAssist(self, editor, context = False): + def codeAssist(self, editor, context=False): """ Public method to determine the autocompletion proposals.
--- a/RefactoringRope/CodeAssist.py Sat Mar 14 14:24:53 2015 +0100 +++ b/RefactoringRope/CodeAssist.py Sun Mar 22 17:33:44 2015 +0100 @@ -27,11 +27,12 @@ import Globals + class CodeAssist(QObject): """ Class implementing the autocompletion interface to rope. """ - def __init__(self, plugin, parent = None): + def __init__(self, plugin, parent=None): """ Constructor @@ -65,7 +66,7 @@ maxfixes = self.__plugin.getPreferences("MaxFixes") try: proposals = rope.contrib.codeassist.code_assist( - self.__project, source, offset, resource, maxfixes = maxfixes) + self.__project, source, offset, resource, maxfixes=maxfixes) proposals = rope.contrib.codeassist.sorted_proposals(proposals) names = [proposal.name for proposal in proposals] return names @@ -76,9 +77,9 @@ """ Public method to calculate calltips. + @param pos position in the text for the calltip (integer) @param editor reference to the editor object, that called this method QScintilla.Editor) - @param pos position in the text for the calltip (integer) @return list of possible calltips (list of strings) """ filename = editor.getFileName() @@ -93,8 +94,8 @@ line, index = editor.lineIndexFromPosition(pos) offset = len("".join(source.splitlines(True)[:line])) + index cts = rope.contrib.codeassist.get_calltip( - self.__project, source, offset, resource, maxfixes = maxfixes, - remove_self = True) + self.__project, source, offset, resource, maxfixes=maxfixes, + remove_self=True) if cts is not None: cts = [cts] else:
--- a/RefactoringRope/ConfigurationPage/CallTipsRopePage.py Sat Mar 14 14:24:53 2015 +0100 +++ b/RefactoringRope/ConfigurationPage/CallTipsRopePage.py Sun Mar 22 17:33:44 2015 +0100 @@ -11,6 +11,7 @@ ConfigurationPageBase from .Ui_CallTipsRopePage import Ui_CallTipsRopePage + class CallTipsRopePage(ConfigurationPageBase, Ui_CallTipsRopePage): """ Class implementing the Rope Calltips configuration page.
--- a/RefactoringRope/Documentation/source/Plugin_Refactoring_Rope.PluginRefactoringRope.html Sat Mar 14 14:24:53 2015 +0100 +++ b/RefactoringRope/Documentation/source/Plugin_Refactoring_Rope.PluginRefactoringRope.html Sun Mar 22 17:33:44 2015 +0100 @@ -342,7 +342,7 @@ </dd> </dl><a NAME="RefactoringRopePlugin.codeAssist" ID="RefactoringRopePlugin.codeAssist"></a> <h4>RefactoringRopePlugin.codeAssist</h4> -<b>codeAssist</b>(<i>editor, context = False</i>) +<b>codeAssist</b>(<i>editor, context=False</i>) <p> Public method to determine the autocompletion proposals. </p><dl> @@ -390,9 +390,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> @@ -411,9 +408,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>
--- a/RefactoringRope/Documentation/source/Plugin_Refactoring_Rope.RefactoringRope.CodeAssist.html Sat Mar 14 14:24:53 2015 +0100 +++ b/RefactoringRope/Documentation/source/Plugin_Refactoring_Rope.RefactoringRope.CodeAssist.html Sun Mar 22 17:33:44 2015 +0100 @@ -76,7 +76,7 @@ </table> <a NAME="CodeAssist.__init__" ID="CodeAssist.__init__"></a> <h4>CodeAssist (Constructor)</h4> -<b>CodeAssist</b>(<i>plugin, parent = None</i>) +<b>CodeAssist</b>(<i>plugin, parent=None</i>) <p> Constructor </p><dl> @@ -93,13 +93,13 @@ <p> Public method to calculate calltips. </p><dl> -<dt><i>editor</i></dt> +<dt><i>pos</i></dt> +<dd> +position in the text for the calltip (integer) +</dd><dt><i>editor</i></dt> <dd> reference to the editor object, that called this method QScintilla.Editor) -</dd><dt><i>pos</i></dt> -<dd> -position in the text for the calltip (integer) </dd> </dl><dl> <dt>Returns:</dt>