Fixed a bug creating a project from a repository and implemented a bugfix method for an issue in QsciScintilla.

Thu, 02 Jan 2014 19:40:08 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 02 Jan 2014 19:40:08 +0100
changeset 3164
a027fc190f82
parent 3160
209a07d7e401
child 3165
400234200cd6

Fixed a bug creating a project from a repository and implemented a bugfix method for an issue in QsciScintilla.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Project.Project.html file | annotate | diff | comparison | revisions
Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html file | annotate | diff | comparison | revisions
Project/Project.py file | annotate | diff | comparison | revisions
QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
VCS/ProjectHelper.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Wed Jan 01 14:38:45 2014 +0100
+++ b/APIs/Python3/eric5.api	Thu Jan 02 19:40:08 2014 +0100
@@ -6308,6 +6308,7 @@
 eric5.Project.Project.Project.completeRepopulateItem?7
 eric5.Project.Project.Project.copyDirectory?4(olddn, newdn)
 eric5.Project.Project.Project.createNewProject?4()
+eric5.Project.Project.Project.createProjectManagementDir?4()
 eric5.Project.Project.Project.dbgKeynames?7
 eric5.Project.Project.Project.deleteDirectory?4(dn)
 eric5.Project.Project.Project.deleteFile?4(fn)
@@ -7260,6 +7261,7 @@
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getSelections?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getZoom?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.hasIndicator?4(indicator, pos)
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.hasSelectedText?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.hasSelection?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.hideFindIndicator?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.indentationGuideView?4()
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Wed Jan 01 14:38:45 2014 +0100
+++ b/Documentation/Help/source.qhp	Thu Jan 02 19:40:08 2014 +0100
@@ -8664,6 +8664,7 @@
       <keyword name="Project.closeProject" id="Project.closeProject" ref="eric5.Project.Project.html#Project.closeProject" />
       <keyword name="Project.copyDirectory" id="Project.copyDirectory" ref="eric5.Project.Project.html#Project.copyDirectory" />
       <keyword name="Project.createNewProject" id="Project.createNewProject" ref="eric5.Project.Project.html#Project.createNewProject" />
+      <keyword name="Project.createProjectManagementDir" id="Project.createProjectManagementDir" ref="eric5.Project.Project.html#Project.createProjectManagementDir" />
       <keyword name="Project.deleteDirectory" id="Project.deleteDirectory" ref="eric5.Project.Project.html#Project.deleteDirectory" />
       <keyword name="Project.deleteFile" id="Project.deleteFile" ref="eric5.Project.Project.html#Project.deleteFile" />
       <keyword name="Project.deleteLanguageFile" id="Project.deleteLanguageFile" ref="eric5.Project.Project.html#Project.deleteLanguageFile" />
@@ -9409,6 +9410,7 @@
       <keyword name="QsciScintillaCompat.getSelections" id="QsciScintillaCompat.getSelections" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getSelections" />
       <keyword name="QsciScintillaCompat.getZoom" id="QsciScintillaCompat.getZoom" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getZoom" />
       <keyword name="QsciScintillaCompat.hasIndicator" id="QsciScintillaCompat.hasIndicator" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.hasIndicator" />
+      <keyword name="QsciScintillaCompat.hasSelectedText" id="QsciScintillaCompat.hasSelectedText" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.hasSelectedText" />
       <keyword name="QsciScintillaCompat.hasSelection" id="QsciScintillaCompat.hasSelection" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.hasSelection" />
       <keyword name="QsciScintillaCompat.hideFindIndicator" id="QsciScintillaCompat.hideFindIndicator" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.hideFindIndicator" />
       <keyword name="QsciScintillaCompat.indentationGuideView" id="QsciScintillaCompat.indentationGuideView" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.indentationGuideView" />
--- a/Documentation/Source/eric5.Project.Project.html	Wed Jan 01 14:38:45 2014 +0100
+++ b/Documentation/Source/eric5.Project.Project.html	Thu Jan 02 19:40:08 2014 +0100
@@ -413,6 +413,9 @@
 <td><a href="#Project.createNewProject">createNewProject</a></td>
 <td>Public slot to built a new project.</td>
 </tr><tr>
+<td><a href="#Project.createProjectManagementDir">createProjectManagementDir</a></td>
+<td>Public method to create the project management directory.</td>
+</tr><tr>
 <td><a href="#Project.deleteDirectory">deleteDirectory</a></td>
 <td>Public slot to delete a directory from the project directory.</td>
 </tr><tr>
@@ -1350,6 +1353,13 @@
 </p><p>
         This method displays the new project dialog and initializes
         the project object with the data entered.
+</p><a NAME="Project.createProjectManagementDir" ID="Project.createProjectManagementDir"></a>
+<h4>Project.createProjectManagementDir</h4>
+<b>createProjectManagementDir</b>(<i></i>)
+<p>
+        Public method to create the project management directory.
+</p><p>
+        It does nothing, if it already exists.
 </p><a NAME="Project.deleteDirectory" ID="Project.deleteDirectory"></a>
 <h4>Project.deleteDirectory</h4>
 <b>deleteDirectory</b>(<i>dn</i>)
--- a/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Wed Jan 01 14:38:45 2014 +0100
+++ b/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Thu Jan 02 19:40:08 2014 +0100
@@ -223,6 +223,9 @@
 <td><a href="#QsciScintillaCompat.hasIndicator">hasIndicator</a></td>
 <td>Public method to test for the existence of an indicator.</td>
 </tr><tr>
+<td><a href="#QsciScintillaCompat.hasSelectedText">hasSelectedText</a></td>
+<td>Public method to indicate the presence of selected text.</td>
+</tr><tr>
 <td><a href="#QsciScintillaCompat.hasSelection">hasSelection</a></td>
 <td>Public method to check for a selection.</td>
 </tr><tr>
@@ -941,6 +944,18 @@
 <dd>
 flag indicating the existence of the indicator (boolean)
 </dd>
+</dl><a NAME="QsciScintillaCompat.hasSelectedText" ID="QsciScintillaCompat.hasSelectedText"></a>
+<h4>QsciScintillaCompat.hasSelectedText</h4>
+<b>hasSelectedText</b>(<i></i>)
+<p>
+        Public method to indicate the presence of selected text.
+</p><p>
+        This is an overriding method to cope with a bug in QsciScintilla.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+flag indicating the presence of selected text (boolean)
+</dd>
 </dl><a NAME="QsciScintillaCompat.hasSelection" ID="QsciScintillaCompat.hasSelection"></a>
 <h4>QsciScintillaCompat.hasSelection</h4>
 <b>hasSelection</b>(<i></i>)
--- a/Project/Project.py	Wed Jan 01 14:38:45 2014 +0100
+++ b/Project/Project.py	Thu Jan 02 19:40:08 2014 +0100
@@ -2081,16 +2081,12 @@
                         os.makedirs(tpd)
                 
                 # create management directory if not present
-                mgmtDir = self.getProjectManagementDir()
-                if not os.path.exists(mgmtDir):
-                    os.makedirs(mgmtDir)
+                self.createProjectManagementDir()
                 
                 self.saveProject()
             else:
                 # create management directory if not present
-                mgmtDir = self.getProjectManagementDir()
-                if not os.path.exists(mgmtDir):
-                    os.makedirs(mgmtDir)
+                self.createProjectManagementDir()
                 
                 try:
                     ms = os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0])
@@ -2514,9 +2510,7 @@
                     QApplication.processEvents()
                     
                     # create the management directory if not present
-                    mgmtDir = self.getProjectManagementDir()
-                    if not os.path.exists(mgmtDir):
-                        os.mkdir(mgmtDir)
+                    self.createProjectManagementDir()
                     
                     # read a user specific project file
                     self.__readUserProperties()
@@ -2701,9 +2695,7 @@
             
             if ok:
                 # create management directory if not present
-                mgmtDir = self.getProjectManagementDir()
-                if not os.path.exists(mgmtDir):
-                    os.makedirs(mgmtDir)
+                self.createProjectManagementDir()
                 
                 # now save the tasks
                 self.writeTasks()
@@ -3071,6 +3063,17 @@
         else:
             return os.path.join(self.ppath, ".eric5project")
         
+    def createProjectManagementDir(self):
+        """
+        Public method to create the project management directory.
+        
+        It does nothing, if it already exists.
+        """
+        # create management directory if not present
+        mgmtDir = self.getProjectManagementDir()
+        if not os.path.exists(mgmtDir):
+            os.makedirs(mgmtDir)
+        
     def getHash(self):
         """
         Public method to get the project hash.
--- a/QScintilla/QsciScintillaCompat.py	Wed Jan 01 14:38:45 2014 +0100
+++ b/QScintilla/QsciScintillaCompat.py	Thu Jan 02 19:40:08 2014 +0100
@@ -488,6 +488,16 @@
         """
         return self.getSelection()[0] != -1
     
+    def hasSelectedText(self):
+        """
+        Public method to indicate the presence of selected text.
+        
+        This is an overriding method to cope with a bug in QsciScintilla.
+        
+        @return flag indicating the presence of selected text (boolean)
+        """
+        return bool(self.selectedText())
+    
     def selectionIsRectangle(self):
         """
         Public method to check, if the current selection is rectangular.
--- a/VCS/ProjectHelper.py	Wed Jan 01 14:38:45 2014 +0100
+++ b/VCS/ProjectHelper.py	Thu Jan 02 19:40:08 2014 +0100
@@ -258,6 +258,7 @@
                                 except IndexError:
                                     ms = ""
                                 self.project.newProjectAddFiles(ms)
+                                self.project.createProjectManagementDir()
                                 self.project.saveProject()
                                 self.project.openProject(self.project.pfile)
                                 if not export:

eric ide

mercurial