Dropped support for eric 5.0.x.

Sat, 30 Jul 2011 10:46:53 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 30 Jul 2011 10:46:53 +0200
changeset 30
8f4d794d8ee0
parent 29
402d146da2f1
child 31
ed537ef44f85

Dropped support for eric 5.0.x.

AssistantEric/APIsManager.py file | annotate | diff | comparison | revisions
AssistantEric/Assistant.py file | annotate | diff | comparison | revisions
AssistantEric/ConfigurationPages/AutoCompletionEricPage.py file | annotate | diff | comparison | revisions
AssistantEric/ConfigurationPages/CallTipsEricPage.py file | annotate | diff | comparison | revisions
AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.APIsManager.html file | annotate | diff | comparison | revisions
AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.Assistant.html file | annotate | diff | comparison | revisions
AssistantEric/Documentation/source/Plugin_Assistant_Eric.PluginAssistantEric.html file | annotate | diff | comparison | revisions
ChangeLog file | annotate | diff | comparison | revisions
PluginAssistantEric.py file | annotate | diff | comparison | revisions
PluginEricAssistant.e4p file | annotate | diff | comparison | revisions
__init__.py file | annotate | diff | comparison | revisions
--- a/AssistantEric/APIsManager.py	Sun May 22 11:33:46 2011 +0200
+++ b/AssistantEric/APIsManager.py	Sat Jul 30 10:46:53 2011 +0200
@@ -9,7 +9,8 @@
 
 import os
 
-from PyQt4.QtCore import *
+from PyQt4.QtCore import QTimer, QThread, QFileInfo, pyqtSignal, QCoreApplication, \
+     QEvent, QDateTime, QObject, Qt
 from PyQt4.QtSql import QSqlDatabase, QSqlQuery
 
 from E5Gui.E5Application import e5App
@@ -27,12 +28,13 @@
 
 ApisNameProject = "__Project__"
 
+
 class DbAPIsWorker(QThread):
     """
     Class implementing a worker thread to prepare the API database.
     """
     populate_api_stmt = """
-        INSERT INTO api (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 = """
@@ -55,7 +57,7 @@
         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
         
@@ -71,7 +73,7 @@
         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 
+        # 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():
@@ -138,9 +140,9 @@
         if self.__language == ApisNameProject:
             try:
                 module = Utilities.ModuleParser.readModule(
-                    os.path.join(self.__projectPath, apiFile), 
-                    basename = self.__projectPath + os.sep, 
-                    caching = False)
+                    os.path.join(self.__projectPath, apiFile),
+                    basename=self.__projectPath + os.sep,
+                    caching=False)
                 language = module.getType()
                 if language:
                     apiGenerator = APIGenerator(module)
@@ -325,13 +327,14 @@
         else:
             QCoreApplication.postEvent(self.__proxy, QEvent(QEvent.Type(WorkerFinished)))
 
+
 class DbAPIs(QObject):
     """
     Class implementing an API storage entity.
     
     @signal apiPreparationFinished() emitted after the API preparation has finished
     @signal apiPreparationStarted() emitted after the API preparation has started
-    @signal apiPreparationCancelled() emitted after the API preparation has been 
+    @signal apiPreparationCancelled() emitted after the API preparation has been
             cancelled
     """
     apiPreparationFinished = pyqtSignal()
@@ -348,9 +351,9 @@
     
     create_api_stmt = """
         CREATE TABLE api
-        (acWord TEXT, 
-         context TEXT, 
-         fullContext TEXT, 
+        (acWord TEXT,
+         context TEXT,
+         fullContext TEXT,
          signature TEXT,
          fileId INTEGER,
          pictureId INTEGER,
@@ -385,12 +388,12 @@
     """
 
     ac_stmt = """
-        SELECT DISTINCT acWord, fullContext, pictureId FROM api 
+        SELECT DISTINCT acWord, fullContext, pictureId FROM api
         WHERE acWord GLOB :acWord
         ORDER BY acWord
     """
     ac_context_stmt = """
-        SELECT DISTINCT acWord, fullContext, pictureId FROM api 
+        SELECT DISTINCT acWord, fullContext, pictureId FROM api
         WHERE context = :context
         ORDER BY acWord
     """
@@ -415,18 +418,16 @@
         INSERT INTO mgmt (format) VALUES ({0:d})
     """.format(DB_VERSION)
     
-    def __init__(self, language, newStyle, parent = None):
+    def __init__(self, language, parent=None):
         """
         Constructor
         
         @param language language of the APIs object (string)
-        @param newStyle flag indicating usage of new style signals (bool)
         @param parent reference to the parent object (QObject)
         """
         QObject.__init__(self, parent)
         self.setObjectName("DbAPIs_{0}".format(language))
         
-        self.__newStyle = newStyle
         self.__inPreparation = False
         self.__worker = None
         self.__workerQueue = []
@@ -444,14 +445,9 @@
         self.__lexer = None
         
         self.__project = e5App().getObject("Project")
-        if self.__newStyle:
-            self.__project.projectOpened.connect(self.__projectOpened)
-            self.__project.newProject.connect(self.__projectOpened)
-            self.__project.projectClosed.connect(self.__projectClosed)
-        else:
-            self.connect(self.__project, SIGNAL("projectOpened"), self.__projectOpened)
-            self.connect(self.__project, SIGNAL("newProject"), self.__projectOpened)
-            self.connect(self.__project, SIGNAL("projectClosed"), self.__projectClosed)
+        self.__project.projectOpened.connect(self.__projectOpened)
+        self.__project.newProject.connect(self.__projectOpened)
+        self.__project.projectClosed.connect(self.__projectClosed)
         if self.__project.isOpen():
             self.__projectOpened()
     
@@ -476,7 +472,7 @@
         @return name of the database file (string)
         """
         if self.__language == ApisNameProject:
-            return os.path.join(self.__project.getProjectManagementDir(), 
+            return os.path.join(self.__project.getProjectManagementDir(),
                                 "project-apis.db")
         else:
             apiDir = os.path.join(Utilities.getConfigDir(), "APIs")
@@ -589,11 +585,11 @@
                 db.commit()
         return prepared
     
-    def getCompletions(self, start = None, context = None):
+    def getCompletions(self, start=None, context=None):
         """
         Public method to determine the possible completions.
         
-        @keyparam start string giving the start of the word to be 
+        @keyparam start string giving the start of the word to be
             completed (string)
         @keyparam context string giving the context (e.g. classname)
             to be completed (string)
@@ -622,17 +618,17 @@
                 if query is not None:
                     query.exec_()
                     while query.next():
-                        completions.append({"completion" : query.value(0), 
-                                            "context" : query.value(1), 
-                                            "pictureId" : query.value(2)})
+                        completions.append({"completion": query.value(0),
+                                            "context": query.value(1),
+                                            "pictureId": query.value(2)})
                     del query
             finally:
                 db.commit()
         
         return completions
     
-    def getCalltips(self, acWord, commas, context = None, fullContext = None, 
-                    showContext = True):
+    def getCalltips(self, acWord, commas, context=None, fullContext=None,
+                    showContext=True):
         """
         Public method to determine the calltips.
         
@@ -685,7 +681,7 @@
             
             if context and len(calltips) == 0:
                 # nothing found, try without a context
-                calltips = self.getCalltips(acWord, commas, showContext = showContext)
+                calltips = self.getCalltips(acWord, commas, showContext=showContext)
         
         return calltips
     
@@ -716,7 +712,7 @@
         # prepare the database if neccessary
         self.prepareAPIs()
     
-    def prepareAPIs(self, rawList = None):
+    def prepareAPIs(self, rawList=None):
         """
         Public method to prepare the APIs if neccessary.
         
@@ -750,8 +746,8 @@
                 apiFiles = [apiFiles[0].replace(projectPath + os.sep, "")]
             else:
                 projectPath = ""
-            self.__worker = DbAPIsWorker(self, self.__language, apiFiles, projectPath, 
-                                         refresh = True)
+            self.__worker = DbAPIsWorker(self, self.__language, apiFiles, projectPath,
+                                         refresh=True)
             self.__worker.start()
     
     def getLexer(self):
@@ -781,27 +777,18 @@
         """
         if evt.type() == WorkerStarted:
             self.__inPreparation = True
-            if self.__newStyle:
-                self.apiPreparationStarted.emit()
-            else:
-                self.emit(SIGNAL('apiPreparationStarted()'))
+            self.apiPreparationStarted.emit()
             return True
         
         elif evt.type() == WorkerFinished:
             self.__inPreparation = False
-            if self.__newStyle:
-                self.apiPreparationFinished.emit()
-            else:
-                self.emit(SIGNAL('apiPreparationFinished()'))
+            self.apiPreparationFinished.emit()
             QTimer.singleShot(0, self.__processQueue)
             return True
         
         elif evt.type() == WorkerAborted:
             self.__inPreparation = False
-            if self.__newStyle:
-                self.apiPreparationCancelled.emit()
-            else:
-                self.emit(SIGNAL('apiPreparationCancelled()'))
+            self.apiPreparationCancelled.emit()
             QTimer.singleShot(0, self.__processQueue)
             return True
         
@@ -839,23 +826,21 @@
             self.__workerQueue.append(filename)
             self.__processQueue()
 
+
 class APIsManager(QObject):
     """
     Class implementing the APIsManager class, which is the central store for
     API information used by autocompletion and calltips.
     """
-    def __init__(self, newStyle, parent = None):
+    def __init__(self, parent=None):
         """
         Constructor
         
-        @param newStyle flag indicating usage of new style signals (bool)
         @param parent reference to the parent object (QObject)
         """
         QObject.__init__(self, parent)
         self.setObjectName("APIsManager")
         
-        self.__newStyle = newStyle
-        
         # initialize the apis dictionary
         self.__apis = {}
     
@@ -870,7 +855,7 @@
         """
         Public method to get an apis object for autocompletion/calltips.
         
-        This method creates and loads an APIs object dynamically upon request. 
+        This method creates and loads an APIs object dynamically upon request.
         This saves memory for languages, that might not be needed at the moment.
         
         @param language the language of the requested api object (string)
@@ -882,7 +867,7 @@
             if language in QScintilla.Lexers.getSupportedLanguages() or \
                language == ApisNameProject:
                 # create the api object
-                self.__apis[language] = DbAPIs(language, self.__newStyle)
+                self.__apis[language] = DbAPIs(language)
                 return self.__apis[language]
             else:
                 return None
--- a/AssistantEric/Assistant.py	Sun May 22 11:33:46 2011 +0200
+++ b/AssistantEric/Assistant.py	Sat Jul 30 10:46:53 2011 +0200
@@ -10,7 +10,7 @@
 
 import re
 
-from PyQt4.QtCore import *
+from PyQt4.QtCore import QRegExp, QObject
 
 from E5Gui.E5Application import e5App
 
@@ -20,33 +20,32 @@
 
 import Preferences
 
-AcsAPIs     = 0x0001
+AcsAPIs = 0x0001
 AcsDocument = 0x0002
-AcsProject  = 0x0004
-AcsOther    = 0x1000
+AcsProject = 0x0004
+AcsOther = 0x1000
+
 
 class Assistant(QObject):
     """
     Class implementing the autocompletion and calltips system.
     """
-    def __init__(self, plugin, newStyle, parent = None):
+    def __init__(self, plugin, parent=None):
         """
         Constructor
         
         @param plugin reference to the plugin object
-        @param newStyle flag indicating usage of new style signals (bool)
         @param parent parent (QObject)
         """
         QObject.__init__(self, parent)
         
         self.__plugin = plugin
-        self.__newStyle = newStyle
         self.__ui = parent
         self.__project = e5App().getObject("Project")
         self.__viewmanager = e5App().getObject("ViewManager")
         self.__pluginManager = e5App().getObject("PluginManager")
         
-        self.__apisManager = APIsManager(self.__newStyle, self)
+        self.__apisManager = APIsManager(self)
         
         self.__editors = []
         self.__completingContext = False
@@ -59,24 +58,12 @@
         """
         Public method to perform actions upon activation.
         """
-        if self.__newStyle:
-            self.__pluginManager.shutdown.connect(self.__shutdown)
-            
-            self.__ui.preferencesChanged.connect(self.__preferencesChanged)
-            
-            self.__viewmanager.editorOpenedEd.connect(self.__editorOpened)
-            self.__viewmanager.editorClosedEd.connect(self.__editorClosed)
-        else:
-            self.connect(self.__pluginManager, SIGNAL("shutdown()"), 
-                         self.__shutdown)
-            
-            self.connect(self.__ui, SIGNAL('preferencesChanged'), 
-                         self.__preferencesChanged)
-            
-            self.connect(self.__viewmanager, SIGNAL("editorOpenedEd"), 
-                         self.__editorOpened)
-            self.connect(self.__viewmanager, SIGNAL("editorClosedEd"), 
-                         self.__editorClosed)
+        self.__pluginManager.shutdown.connect(self.__shutdown)
+        
+        self.__ui.preferencesChanged.connect(self.__preferencesChanged)
+        
+        self.__viewmanager.editorOpenedEd.connect(self.__editorOpened)
+        self.__viewmanager.editorClosedEd.connect(self.__editorClosed)
         
         # preload the project APIs object
         self.__apisManager.getAPIs(ApisNameProject)
@@ -88,24 +75,12 @@
         """
         Public method to perform actions upon deactivation.
         """
-        if self.__newStyle:
-            self.__pluginManager.shutdown.disconnect(self.__shutdown)
-            
-            self.__ui.preferencesChanged.disconnect(self.__preferencesChanged)
-            
-            self.__viewmanager.editorOpenedEd.disconnect(self.__editorOpened)
-            self.__viewmanager.editorClosedEd.disconnect(self.__editorClosed)
-        else:
-            self.disconnect(self.__pluginManager, SIGNAL("shutdown()"), 
-                            self.__shutdown)
-            
-            self.disconnect(self.__ui, SIGNAL('preferencesChanged'), 
-                            self.__preferencesChanged)
-            
-            self.disconnect(self.__viewmanager, SIGNAL("editorOpenedEd"), 
-                            self.__editorOpened)
-            self.disconnect(self.__viewmanager, SIGNAL("editorClosedEd"), 
-                            self.__editorClosed)
+        self.__pluginManager.shutdown.disconnect(self.__shutdown)
+        
+        self.__ui.preferencesChanged.disconnect(self.__preferencesChanged)
+        
+        self.__viewmanager.editorOpenedEd.disconnect(self.__editorOpened)
+        self.__viewmanager.editorClosedEd.disconnect(self.__editorClosed)
         
         self.__shutdown()
     
@@ -141,12 +116,8 @@
             self.__setAutoCompletionHook(editor)
         if self.__plugin.getPreferences("CalltipsEnabled"):
             self.__setCalltipsHook(editor)
-        if self.__newStyle:
-            editor.editorSaved.connect(
-                self.__apisManager.getAPIs(ApisNameProject).editorSaved)
-        else:
-            self.connect(editor, SIGNAL("editorSaved"), 
-                         self.__apisManager.getAPIs(ApisNameProject).editorSaved)
+        editor.editorSaved.connect(
+            self.__apisManager.getAPIs(ApisNameProject).editorSaved)
         self.__editors.append(editor)
         
         # preload the api to give the manager a chance to prepare the database
@@ -162,12 +133,8 @@
         @param editor reference to the editor (QScintilla.Editor)
         """
         if editor in self.__editors:
-            if self.__newStyle:
-                editor.editorSaved.disconnect(
-                    self.__apisManager.getAPIs(ApisNameProject).editorSaved)
-            else:
-                self.disconnect(editor, SIGNAL("editorSaved"), 
-                                self.__apisManager.getAPIs(ApisNameProject).editorSaved)
+            editor.editorSaved.disconnect(
+                self.__apisManager.getAPIs(ApisNameProject).editorSaved)
             self.__editors.remove(editor)
             if editor.autoCompletionHook() == self.autocomplete:
                 self.__unsetAutoCompletionHook(editor)
@@ -203,7 +170,7 @@
         return ch, pos
     
     #################################
-    ## autocompletion methods below  
+    ## autocompletion methods below
     #################################
     
     def __completionListSelected(self, id, txt):
@@ -246,11 +213,7 @@
         
         @param editor reference to the editor (QScintilla.Editor)
         """
-        if self.__newStyle:
-            editor.userListActivated.connect(self.__completionListSelected)
-        else:
-            self.connect(editor, SIGNAL('userListActivated(int, const QString)'),
-                         self.__completionListSelected)
+        editor.userListActivated.connect(self.__completionListSelected)
         editor.setAutoCompletionHook(self.autocomplete)
     
     def __unsetAutoCompletionHook(self, editor):
@@ -260,11 +223,7 @@
         @param editor reference to the editor (QScintilla.Editor)
         """
         editor.unsetAutoCompletionHook()
-        if self.__newStyle:
-            editor.userListActivated.disconnect(self.__completionListSelected)
-        else:
-            self.disconnect(editor, SIGNAL('userListActivated(int, const QString)'),
-                            self.__completionListSelected)
+        editor.userListActivated.disconnect(self.__completionListSelected)
     
     def autocomplete(self, editor, context):
         """
@@ -307,7 +266,7 @@
                 if ch == ')':
                     depth = 1
                     
-                    # ignore everything back to the start of the 
+                    # ignore everything back to the start of the
                     # corresponding parenthesis
                     col -= 1
                     while col > 0:
@@ -364,7 +323,7 @@
         completionsList = []
         if api is not None:
             if context:
-                completions = api.getCompletions(context = word)
+                completions = api.getCompletions(context=word)
                 for completion in completions:
                     entry = completion["completion"]
                     if completion["pictureId"]:
@@ -372,13 +331,13 @@
                     if entry not in completionsList:
                         completionsList.append(entry)
             else:
-                completions = api.getCompletions(start = word)
+                completions = api.getCompletions(start=word)
                 for completion in completions:
                     if not completion["context"]:
                         entry = completion["completion"]
                     else:
                         entry = "{0} ({1})".format(
-                            completion["completion"], 
+                            completion["completion"],
                             completion["context"]
                         )
                         if entry in completionsList:
@@ -417,9 +376,9 @@
             sword = word.encode("utf-8")
         else:
             sword = word
-        res = editor.findFirstTarget(sword, False, 
-            editor.autoCompletionCaseSensitivity(), 
-            False, begline = 0, begindex = 0, ws_ = True)
+        res = editor.findFirstTarget(sword, False,
+            editor.autoCompletionCaseSensitivity(),
+            False, begline=0, begindex=0, ws_=True)
         while res:
             start, length = editor.getFoundTarget()
             pos = start + length
@@ -429,7 +388,7 @@
                 else:
                     completion = word
                 line, index = editor.lineIndexFromPosition(pos)
-                curWord = editor.getWord(line, index, useWordChars = False)
+                curWord = editor.getWord(line, index, useWordChars=False)
                 completion += curWord[len(completion):]
                 if completion and completion not in completionsList:
                     completionsList.append(
@@ -441,7 +400,7 @@
         return completionsList
     
     ###########################
-    ## calltips methods below  
+    ## calltips methods below
     ###########################
     
     def __setCalltipsHook(self, editor):
@@ -488,14 +447,14 @@
         if self.__plugin.getPreferences("AutoCompletionSource") & AcsAPIs:
             api = self.__apisManager.getAPIs(language)
             if api is not None:
-                apiCalltips = api.getCalltips(word, commas, self.__lastContext, 
-                    self.__lastFullContext, 
+                apiCalltips = api.getCalltips(word, commas, self.__lastContext,
+                    self.__lastFullContext,
                     self.__plugin.getPreferences("CallTipsContextShown"))
         
         if self.__plugin.getPreferences("AutoCompletionSource") & AcsProject:
             api = self.__apisManager.getAPIs(ApisNameProject)
-            projectCalltips = api.getCalltips(word, commas, self.__lastContext, 
-                self.__lastFullContext, 
+            projectCalltips = api.getCalltips(word, commas, self.__lastContext,
+                self.__lastFullContext,
                 self.__plugin.getPreferences("CallTipsContextShown"))
         
         return sorted(set(apiCalltips).union(set(projectCalltips)))
--- a/AssistantEric/ConfigurationPages/AutoCompletionEricPage.py	Sun May 22 11:33:46 2011 +0200
+++ b/AssistantEric/ConfigurationPages/AutoCompletionEricPage.py	Sat Jul 30 10:46:53 2011 +0200
@@ -12,6 +12,7 @@
 from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase
 from .Ui_AutoCompletionEricPage import Ui_AutoCompletionEricPage
 
+
 class AutoCompletionEricPage(ConfigurationPageBase, Ui_AutoCompletionEricPage):
     """
     Class implementing the Eric Autocompletion configuration page.
@@ -41,7 +42,7 @@
         """
         Public slot to save the Eric Autocompletion configuration.
         """
-        self.__plugin.setPreferences("AutoCompletionEnabled", 
+        self.__plugin.setPreferences("AutoCompletionEnabled",
             int(self.autocompletionCheckBox.isChecked()))
         
         acSource = 0
--- a/AssistantEric/ConfigurationPages/CallTipsEricPage.py	Sun May 22 11:33:46 2011 +0200
+++ b/AssistantEric/ConfigurationPages/CallTipsEricPage.py	Sat Jul 30 10:46:53 2011 +0200
@@ -10,6 +10,7 @@
 from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase
 from .Ui_CallTipsEricPage import Ui_CallTipsEricPage
 
+
 class CallTipsEricPage(ConfigurationPageBase, Ui_CallTipsEricPage):
     """
     Class implementing the Eric Calltips configuration page.
@@ -36,7 +37,7 @@
         """
         Public slot to save the Eric Calltips configuration.
         """
-        self.__plugin.setPreferences("CalltipsEnabled", 
+        self.__plugin.setPreferences("CalltipsEnabled",
             int(self.calltipsCheckBox.isChecked()))
-        self.__plugin.setPreferences("CallTipsContextShown", 
+        self.__plugin.setPreferences("CallTipsContextShown",
             int(self.ctContextCheckBox.isChecked()))
--- a/AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.APIsManager.html	Sun May 22 11:33:46 2011 +0200
+++ b/AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.APIsManager.html	Sat Jul 30 10:46:53 2011 +0200
@@ -76,14 +76,11 @@
 </table>
 <a NAME="APIsManager.__init__" ID="APIsManager.__init__"></a>
 <h4>APIsManager (Constructor)</h4>
-<b>APIsManager</b>(<i>newStyle, parent = None</i>)
+<b>APIsManager</b>(<i>parent=None</i>)
 <p>
         Constructor
 </p><dl>
-<dt><i>newStyle</i></dt>
-<dd>
-flag indicating usage of new style signals (bool)
-</dd><dt><i>parent</i></dt>
+<dt><i>parent</i></dt>
 <dd>
 reference to the parent object (QObject)
 </dd>
@@ -98,7 +95,7 @@
 <p>
         Public method to get an apis object for autocompletion/calltips.
 </p><p>
-        This method creates and loads an APIs object dynamically upon request. 
+        This method creates and loads an APIs object dynamically upon request.
         This saves memory for languages, that might not be needed at the moment.
 </p><dl>
 <dt><i>language</i></dt>
@@ -211,16 +208,13 @@
 </table>
 <a NAME="DbAPIs.__init__" ID="DbAPIs.__init__"></a>
 <h4>DbAPIs (Constructor)</h4>
-<b>DbAPIs</b>(<i>language, newStyle, parent = None</i>)
+<b>DbAPIs</b>(<i>language, parent=None</i>)
 <p>
         Constructor
 </p><dl>
 <dt><i>language</i></dt>
 <dd>
 language of the APIs object (string)
-</dd><dt><i>newStyle</i></dt>
-<dd>
-flag indicating usage of new style signals (bool)
 </dd><dt><i>parent</i></dt>
 <dd>
 reference to the parent object (QObject)
@@ -355,7 +349,7 @@
 </dd>
 </dl><a NAME="DbAPIs.getCalltips" ID="DbAPIs.getCalltips"></a>
 <h4>DbAPIs.getCalltips</h4>
-<b>getCalltips</b>(<i>acWord, commas, context = None, fullContext = None, showContext = True</i>)
+<b>getCalltips</b>(<i>acWord, commas, context=None, fullContext=None, showContext=True</i>)
 <p>
         Public method to determine the calltips.
 </p><dl>
@@ -382,7 +376,7 @@
 </dd>
 </dl><a NAME="DbAPIs.getCompletions" ID="DbAPIs.getCompletions"></a>
 <h4>DbAPIs.getCompletions</h4>
-<b>getCompletions</b>(<i>start = None, context = None</i>)
+<b>getCompletions</b>(<i>start=None, context=None</i>)
 <p>
         Public method to determine the possible completions.
 </p><dl>
@@ -415,7 +409,7 @@
 </dd>
 </dl><a NAME="DbAPIs.prepareAPIs" ID="DbAPIs.prepareAPIs"></a>
 <h4>DbAPIs.prepareAPIs</h4>
-<b>prepareAPIs</b>(<i>rawList = None</i>)
+<b>prepareAPIs</b>(<i>rawList=None</i>)
 <p>
         Public method to prepare the APIs if neccessary.
 </p><dl>
@@ -467,7 +461,7 @@
 </table>
 <a NAME="DbAPIsWorker.__init__" ID="DbAPIsWorker.__init__"></a>
 <h4>DbAPIsWorker (Constructor)</h4>
-<b>DbAPIsWorker</b>(<i>proxy, language, apiFiles, projectPath = "", refresh = False</i>)
+<b>DbAPIsWorker</b>(<i>proxy, language, apiFiles, projectPath="", refresh=False</i>)
 <p>
         Constructor
 </p><dl>
--- a/AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.Assistant.html	Sun May 22 11:33:46 2011 +0200
+++ b/AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.Assistant.html	Sat Jul 30 10:46:53 2011 +0200
@@ -112,16 +112,13 @@
 </table>
 <a NAME="Assistant.__init__" ID="Assistant.__init__"></a>
 <h4>Assistant (Constructor)</h4>
-<b>Assistant</b>(<i>plugin, newStyle, parent = None</i>)
+<b>Assistant</b>(<i>plugin, parent=None</i>)
 <p>
         Constructor
 </p><dl>
 <dt><i>plugin</i></dt>
 <dd>
 reference to the plugin object
-</dd><dt><i>newStyle</i></dt>
-<dd>
-flag indicating usage of new style signals (bool)
 </dd><dt><i>parent</i></dt>
 <dd>
 parent (QObject)
--- a/AssistantEric/Documentation/source/Plugin_Assistant_Eric.PluginAssistantEric.html	Sun May 22 11:33:46 2011 +0200
+++ b/AssistantEric/Documentation/source/Plugin_Assistant_Eric.PluginAssistantEric.html	Sat Jul 30 10:46:53 2011 +0200
@@ -72,6 +72,9 @@
 <td><a href="#AssistantEricPlugin.__checkQSql">__checkQSql</a></td>
 <td>Private method to perform some checks on QSql.</td>
 </tr><tr>
+<td><a href="#AssistantEricPlugin.__checkUiVersion">__checkUiVersion</a></td>
+<td>Private method to check, if the IDE has a suitable version.</td>
+</tr><tr>
 <td><a href="#AssistantEricPlugin.__initialize">__initialize</a></td>
 <td>Private slot to (re)initialize the plugin.</td>
 </tr><tr>
@@ -114,6 +117,16 @@
 <dd>
 flag indicating QSql is ok (boolean)
 </dd>
+</dl><a NAME="AssistantEricPlugin.__checkUiVersion" ID="AssistantEricPlugin.__checkUiVersion"></a>
+<h4>AssistantEricPlugin.__checkUiVersion</h4>
+<b>__checkUiVersion</b>(<i></i>)
+<p>
+        Private method to check, if the IDE has a suitable version.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+flag indicating a suitable version (boolean)
+</dd>
 </dl><a NAME="AssistantEricPlugin.__initialize" ID="AssistantEricPlugin.__initialize"></a>
 <h4>AssistantEricPlugin.__initialize</h4>
 <b>__initialize</b>(<i></i>)
--- a/ChangeLog	Sun May 22 11:33:46 2011 +0200
+++ b/ChangeLog	Sat Jul 30 10:46:53 2011 +0200
@@ -1,5 +1,9 @@
 ChangeLog
 ---------
+Version 2.2.0:
+- bug fixes
+- dropped support for eric 5.0.x
+
 Version 2.1.2:
 - bug fixes
 
--- a/PluginAssistantEric.py	Sun May 22 11:33:46 2011 +0200
+++ b/PluginAssistantEric.py	Sat Jul 30 10:46:53 2011 +0200
@@ -23,7 +23,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "2.1.2"
+version = "2.2.0"
 className = "AssistantEricPlugin"
 packageName = "AssistantEric"
 shortDescription = "Alternative autocompletion and calltips provider."
@@ -37,6 +37,7 @@
 
 assistantEricPluginObject = None
 
+
 def createAutoCompletionPage(configDlg):
     """
     Module function to create the autocompletion configuration page.
@@ -49,6 +50,7 @@
     page = AutoCompletionEricPage(assistantEricPluginObject)
     return page
     
+
 def createCallTipsPage(configDlg):
     """
     Module function to create the calltips configuration page.
@@ -61,6 +63,7 @@
     page = CallTipsEricPage(assistantEricPluginObject)
     return page
     
+
 def getConfigData():
     """
     Module function returning data as required by the configuration dialog.
@@ -68,18 +71,19 @@
     @return dictionary containing the relevant data
     """
     return {
-        "ericAutoCompletionPage" : \
-            [QApplication.translate("AssistantEricPlugin", "Eric"), 
-             os.path.join("AssistantEric", "ConfigurationPages", 
+        "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", 
+        "ericCallTipsPage": \
+            [QApplication.translate("AssistantEricPlugin", "Eric"),
+             os.path.join("AssistantEric", "ConfigurationPages",
                           "eric.png"),
              createCallTipsPage, "editorCalltipsPage", None],
     }
 
+
 def prepareUninstall():
     """
     Module function to prepare for an uninstallation.
@@ -87,6 +91,7 @@
     assistant = AssistantEricPlugin(None)
     assistant.prepareUninstall()
     
+
 class AssistantEricPlugin(QObject):
     """
     Class implementing the Eric assistant plugin.
@@ -101,13 +106,11 @@
         self.__ui = ui
         self.__initialize()
         
-        self.__newStyle = ui.versionIsNewer("5.0.99", "20100811")
-        
         self.__defaults = {
-            "AutoCompletionEnabled" : False, 
-            "AutoCompletionSource" : AcsAPIs | AcsProject, 
-            "CalltipsEnabled" : False, 
-            "CallTipsContextShown" : 1, 
+            "AutoCompletionEnabled": False,
+            "AutoCompletionSource": AcsAPIs | AcsProject,
+            "CalltipsEnabled": False,
+            "CallTipsContextShown": 1,
         }
         
         self.__translator = None
@@ -119,6 +122,19 @@
         """
         self.__object = None
     
+    def __checkUiVersion(self):
+        """
+        Private method to check, if the IDE has a suitable version.
+        
+        @return flag indicating a suitable version (boolean)
+        """
+        global error
+        
+        suitable = self.__ui.versionIsNewer("5.0.99", "20100811")
+        if not suitable:
+            error = self.trUtf8("Your version of eric5 is not supported.")
+        return suitable
+    
     def __checkQSql(self):
         """
         Private method to perform some checks on QSql.
@@ -149,7 +165,8 @@
         global error
         error = ""     # clear previous error
         
-        if not self.__checkQSql():
+        if not self.__checkUiVersion() or \
+           not self.__checkQSql():
             return None, False
         
         global assistantEricPluginObject
@@ -157,7 +174,7 @@
         
         from AssistantEric.Assistant import Assistant
         
-        self.__object = Assistant(self, self.__newStyle, self.__ui)
+        self.__object = Assistant(self, self.__ui)
         e5App().registerPluginObject("AssistantEric", self.__object)
         
         self.__object.activate()
--- a/PluginEricAssistant.e4p	Sun May 22 11:33:46 2011 +0200
+++ b/PluginEricAssistant.e4p	Sat Jul 30 10:46:53 2011 +0200
@@ -7,7 +7,7 @@
   <ProgLanguage mixed="0">Python3</ProgLanguage>
   <ProjectType>E4Plugin</ProjectType>
   <Description>Plugin implementing an alternative autocompletion and calltips provider.</Description>
-  <Version>2.0.0</Version>
+  <Version>2.2.x</Version>
   <Author>Detlev Offenbach</Author>
   <Email>detlev@die-offenbachs.de</Email>
   <TranslationPattern>AssistantEric/i18n/assistant_%language%.ts</TranslationPattern>
@@ -142,8 +142,8 @@
     <FiletypeAssociation pattern="*.idl" type="INTERFACES"/>
     <FiletypeAssociation pattern="*.qm" type="TRANSLATIONS"/>
     <FiletypeAssociation pattern="*.ptl" type="SOURCES"/>
+    <FiletypeAssociation pattern="Ui_*" type="__IGNORE__"/>
     <FiletypeAssociation pattern="*.pyw" type="SOURCES"/>
-    <FiletypeAssociation pattern="Ui_*" type="__IGNORE__"/>
     <FiletypeAssociation pattern="*.ui.h" type="FORMS"/>
     <FiletypeAssociation pattern="*.ts" type="TRANSLATIONS"/>
     <FiletypeAssociation pattern="*.py" type="SOURCES"/>
@@ -212,4 +212,53 @@
       </dict>
     </DocumentationParams>
   </Documentation>
+  <Checkers>
+    <CheckersParams>
+      <dict>
+        <key>
+          <string>Pep8Checker</string>
+        </key>
+        <value>
+          <dict>
+            <key>
+              <string>ExcludeFiles</string>
+            </key>
+            <value>
+              <string> */Ui_*.py</string>
+            </value>
+            <key>
+              <string>ExcludeMessages</string>
+            </key>
+            <value>
+              <string>E24, E501, W293</string>
+            </value>
+            <key>
+              <string>FixCodes</string>
+            </key>
+            <value>
+              <string></string>
+            </value>
+            <key>
+              <string>FixIssues</string>
+            </key>
+            <value>
+              <bool>True</bool>
+            </value>
+            <key>
+              <string>IncludeMessages</string>
+            </key>
+            <value>
+              <string></string>
+            </value>
+            <key>
+              <string>RepeatMessages</string>
+            </key>
+            <value>
+              <bool>True</bool>
+            </value>
+          </dict>
+        </value>
+      </dict>
+    </CheckersParams>
+  </Checkers>
 </Project>
--- a/__init__.py	Sun May 22 11:33:46 2011 +0200
+++ b/__init__.py	Sat Jul 30 10:46:53 2011 +0200
@@ -5,4 +5,4 @@
 
 """
 Package implementing the eric5 assistant plugin.
-"""
\ No newline at end of file
+"""

eric ide

mercurial