PluginApis.py

changeset 28
d772634a378a
parent 27
fb49ef163b34
child 30
30eb69e6049c
equal deleted inserted replaced
27:fb49ef163b34 28:d772634a378a
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the APIs plugin. 7 Module implementing the APIs plugin.
8 """ 8 """
9
10 from __future__ import unicode_literals
11 9
12 import os 10 import os
13 import glob 11 import glob
14 12
15 from PyQt5.QtCore import QObject 13 from PyQt5.QtCore import QObject
17 # Start-of-Header 15 # Start-of-Header
18 name = "APIs Plugin" 16 name = "APIs Plugin"
19 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 17 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
20 autoactivate = True 18 autoactivate = True
21 deactivateable = True 19 deactivateable = True
22 version = "2.1.0" 20 version = "3.0.0"
23 className = "PluginApis" 21 className = "PluginApis"
24 packageName = "APIs" 22 packageName = "APIs"
25 shortDescription = "API files for auto-completion and call tips." 23 shortDescription = "API files for auto-completion and call tips."
26 longDescription = \ 24 longDescription = (
27 """This plug-in provides API files for auto-completion""" \ 25 """This plug-in provides API files for auto-completion"""
28 """ and call tips that are often missing from distribution packages.""" 26 """ and call tips that are often missing from distribution packages."""
27 )
29 needsRestart = False 28 needsRestart = False
30 pyqtApi = 2 29 pyqtApi = 2
31 python2Compatible = True
32 # End-of-Header 30 # End-of-Header
33 31
34 error = "" 32 error = ""
35 33
36 34
39 Module function to return the API files made available by this plugin. 37 Module function to return the API files made available by this plugin.
40 38
41 @param language language to get APIs for (string) 39 @param language language to get APIs for (string)
42 @return list of API filenames (list of string) 40 @return list of API filenames (list of string)
43 """ 41 """
44 if language in ["Python3", "Python2", "Python"]: 42 if language in ["Python3", "Python"]:
45 apisDir = \ 43 apisDir = os.path.join(os.path.dirname(__file__), "APIs", "Python")
46 os.path.join(os.path.dirname(__file__), "APIs", "Python")
47 apis = glob.glob(os.path.join(apisDir, '*.api')) 44 apis = glob.glob(os.path.join(apisDir, '*.api'))
48 if language == "Python3": 45
49 apisDir = \ 46 apisDir = os.path.join(os.path.dirname(__file__), "APIs", "Python3")
50 os.path.join(os.path.dirname(__file__), "APIs", "Python3") 47 apis.extend(glob.glob(os.path.join(apisDir, '*.api')))
51 apis.extend(glob.glob(os.path.join(apisDir, '*.api'))) 48 return apis
52 else:
53 apisDir = \
54 os.path.join(os.path.dirname(__file__), "APIs", "Python2")
55 apis.extend(glob.glob(os.path.join(apisDir, '*.api')))
56 else: 49 else:
57 apis = [] 50 return []
58 return apis
59 51
60 52
61 class PluginApis(QObject): 53 class PluginApis(QObject):
62 """ 54 """
63 Class implementing the Django project plugin. 55 Class implementing the Django project plugin.

eric ide

mercurial