Finished the project specific API code. APIs

Sat, 03 Dec 2016 15:05:49 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 03 Dec 2016 15:05:49 +0100
branch
APIs
changeset 5358
2584d0a08bf4
parent 5352
ddcf6fd8c316
child 5359
396145256ada
child 5360
856b3b70cea9

Finished the project specific API code.

APIs/Python3/eric6.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/eric6.QScintilla.Editor.html file | annotate | diff | comparison | revisions
Documentation/Source/eric6.QScintilla.Lexers.__init__.html file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/EditorAPIsPage.py file | annotate | diff | comparison | revisions
QScintilla/APIsManager.py file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
QScintilla/Lexers/__init__.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric6.api	Thu Dec 01 19:22:06 2016 +0100
+++ b/APIs/Python3/eric6.api	Sat Dec 03 15:05:49 2016 +0100
@@ -7267,6 +7267,7 @@
 eric6.QScintilla.Editor.Editor.focusInEvent?4(event)
 eric6.QScintilla.Editor.Editor.focusOutEvent?4(event)
 eric6.QScintilla.Editor.Editor.gestureEvent?4(evt)
+eric6.QScintilla.Editor.Editor.getApiLanguage?4()
 eric6.QScintilla.Editor.Editor.getBookmarkLines?4()
 eric6.QScintilla.Editor.Editor.getBookmarks?4()
 eric6.QScintilla.Editor.Editor.getBreakpointLines?4()
@@ -7789,6 +7790,7 @@
 eric6.QScintilla.Lexers.getLexer?4(language, parent=None, pyname="")
 eric6.QScintilla.Lexers.getOpenFileFiltersList?4(includeAll=False, asString=False, withAdditional=True)
 eric6.QScintilla.Lexers.getSaveFileFiltersList?4(includeAll=False, asString=False, withAdditional=True)
+eric6.QScintilla.Lexers.getSupportedApiLanguages?4()
 eric6.QScintilla.Lexers.getSupportedLanguages?4()
 eric6.QScintilla.Lexers.registerLexer?4(name, displayString, filenameSample, getLexerFunc, openFilters=[], saveFilters=[], defaultAssocs=[], iconFileName="")
 eric6.QScintilla.Lexers.unregisterLexer?4(name)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Thu Dec 01 19:22:06 2016 +0100
+++ b/Documentation/Help/source.qhp	Sat Dec 03 15:05:49 2016 +0100
@@ -5016,6 +5016,7 @@
       <keyword name="Editor.focusInEvent" id="Editor.focusInEvent" ref="eric6.QScintilla.Editor.html#Editor.focusInEvent" />
       <keyword name="Editor.focusOutEvent" id="Editor.focusOutEvent" ref="eric6.QScintilla.Editor.html#Editor.focusOutEvent" />
       <keyword name="Editor.gestureEvent" id="Editor.gestureEvent" ref="eric6.QScintilla.Editor.html#Editor.gestureEvent" />
+      <keyword name="Editor.getApiLanguage" id="Editor.getApiLanguage" ref="eric6.QScintilla.Editor.html#Editor.getApiLanguage" />
       <keyword name="Editor.getBookmarkLines" id="Editor.getBookmarkLines" ref="eric6.QScintilla.Editor.html#Editor.getBookmarkLines" />
       <keyword name="Editor.getBookmarks" id="Editor.getBookmarks" ref="eric6.QScintilla.Editor.html#Editor.getBookmarks" />
       <keyword name="Editor.getBreakpointLines" id="Editor.getBreakpointLines" ref="eric6.QScintilla.Editor.html#Editor.getBreakpointLines" />
@@ -16443,6 +16444,7 @@
       <keyword name="getServersPath" id="getServersPath" ref="eric6.Plugins.VcsPlugins.vcsPySvn.SvnUtilities.html#getServersPath" />
       <keyword name="getServersPath" id="getServersPath" ref="eric6.Plugins.VcsPlugins.vcsSubversion.SvnUtilities.html#getServersPath" />
       <keyword name="getShell" id="getShell" ref="eric6.Preferences.__init__.html#getShell" />
+      <keyword name="getSupportedApiLanguages" id="getSupportedApiLanguages" ref="eric6.QScintilla.Lexers.__init__.html#getSupportedApiLanguages" />
       <keyword name="getSupportedFormats" id="getSupportedFormats" ref="eric6.QScintilla.Exporters.__init__.html#getSupportedFormats" />
       <keyword name="getSupportedLanguages" id="getSupportedLanguages" ref="eric6.QScintilla.Lexers.__init__.html#getSupportedLanguages" />
       <keyword name="getSymlinkIcon" id="getSymlinkIcon" ref="eric6.UI.PixmapCache.html#getSymlinkIcon" />
--- a/Documentation/Source/eric6.QScintilla.Editor.html	Thu Dec 01 19:22:06 2016 +0100
+++ b/Documentation/Source/eric6.QScintilla.Editor.html	Sat Dec 03 15:05:49 2016 +0100
@@ -764,6 +764,9 @@
 <td><a href="#Editor.gestureEvent">gestureEvent</a></td>
 <td>Protected method handling gesture events.</td>
 </tr><tr>
+<td><a href="#Editor.getApiLanguage">getApiLanguage</a></td>
+<td>Public method to get the API language of the editor.</td>
+</tr><tr>
 <td><a href="#Editor.getBookmarkLines">getBookmarkLines</a></td>
 <td>Public method to get the lines containing a bookmark.</td>
 </tr><tr>
@@ -3043,6 +3046,21 @@
 <dd>
 reference to the gesture event (QGestureEvent
 </dd>
+</dl><a NAME="Editor.getApiLanguage" ID="Editor.getApiLanguage"></a>
+<h4>Editor.getApiLanguage</h4>
+<b>getApiLanguage</b>(<i></i>)
+<p>
+        Public method to get the API language of the editor.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+API language
+</dd>
+</dl><dl>
+<dt>Return Type:</dt>
+<dd>
+str
+</dd>
 </dl><a NAME="Editor.getBookmarkLines" ID="Editor.getBookmarkLines"></a>
 <h4>Editor.getBookmarkLines</h4>
 <b>getBookmarkLines</b>(<i></i>)
--- a/Documentation/Source/eric6.QScintilla.Lexers.__init__.html	Thu Dec 01 19:22:06 2016 +0100
+++ b/Documentation/Source/eric6.QScintilla.Lexers.__init__.html	Sat Dec 03 15:05:49 2016 +0100
@@ -52,6 +52,9 @@
 <td><a href="#getSaveFileFiltersList">getSaveFileFiltersList</a></td>
 <td>Module function to get the file filter list for a save file operation.</td>
 </tr><tr>
+<td><a href="#getSupportedApiLanguages">getSupportedApiLanguages</a></td>
+<td>Module function to get a list of supported API languages.</td>
+</tr><tr>
 <td><a href="#getSupportedLanguages">getSupportedLanguages</a></td>
 <td>Module function to get a dictionary of supported lexer languages.</td>
 </tr><tr>
@@ -196,6 +199,24 @@
 </dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr /><hr />
+<a NAME="getSupportedApiLanguages" ID="getSupportedApiLanguages"></a>
+<h2>getSupportedApiLanguages</h2>
+<b>getSupportedApiLanguages</b>(<i></i>)
+<p>
+    Module function to get a list of supported API languages.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+list of supported API languages
+</dd>
+</dl><dl>
+<dt>Return Type:</dt>
+<dd>
+list of str
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr /><hr />
 <a NAME="getSupportedLanguages" ID="getSupportedLanguages"></a>
 <h2>getSupportedLanguages</h2>
 <b>getSupportedLanguages</b>(<i></i>)
--- a/Preferences/ConfigurationPages/EditorAPIsPage.py	Thu Dec 01 19:22:06 2016 +0100
+++ b/Preferences/ConfigurationPages/EditorAPIsPage.py	Sat Dec 03 15:05:49 2016 +0100
@@ -53,10 +53,9 @@
         import QScintilla.Lexers
         self.apis = {}
         apiLanguages = sorted(
-            [''] + list(QScintilla.Lexers.getSupportedLanguages().keys()))
+            [''] + list(QScintilla.Lexers.getSupportedApiLanguages()))
         for lang in apiLanguages:
-            if lang != "Guessed":
-                self.apiLanguageComboBox.addItem(lang)
+            self.apiLanguageComboBox.addItem(lang)
         apiProjectTypes = sorted(
             [("", "")] +
             [(trans, ptype) for ptype, trans in
--- a/QScintilla/APIsManager.py	Thu Dec 01 19:22:06 2016 +0100
+++ b/QScintilla/APIsManager.py	Sat Dec 03 15:05:49 2016 +0100
@@ -287,7 +287,7 @@
             try:
                 return self.__apis[(language, projectType)]
             except KeyError:
-                if language in Lexers.getSupportedLanguages():
+                if language in Lexers.getSupportedApiLanguages():
                     # create the api object
                     self.__apis[(language, projectType)] = \
                         APIs(language, projectType=projectType)
--- a/QScintilla/Editor.py	Thu Dec 01 19:22:06 2016 +0100
+++ b/QScintilla/Editor.py	Sat Dec 03 15:05:49 2016 +0100
@@ -1640,6 +1640,15 @@
                 elif lang == "Python3":
                     lang = "Python 3"
         return lang
+    
+    def getApiLanguage(self):
+        """
+        Public method to get the API language of the editor.
+        
+        @return API language
+        @rtype str
+        """
+        return self.apiLanguage
         
     def __bindCompleter(self, filename):
         """
--- a/QScintilla/Lexers/__init__.py	Thu Dec 01 19:22:06 2016 +0100
+++ b/QScintilla/Lexers/__init__.py	Sat Dec 03 15:05:49 2016 +0100
@@ -174,6 +174,17 @@
     return supportedLanguages
 
 
+def getSupportedApiLanguages():
+    """
+    Module function to get a list of supported API languages.
+    
+    @return list of supported API languages
+    @rtype list of str
+    """
+    return [lang for lang in getSupportedLanguages().keys()
+            if lang != "Guessed" and not lang.startswith("Pygments|")]
+
+
 def getLanguageIcon(language, pixmap):
     """
     Module function to get an icon for a language.

eric ide

mercurial