PluginApis.py

branch
eric7
changeset 52
c8ea815f673d
parent 50
e5ebd8be9569
child 53
f69d7f9ab8e4
equal deleted inserted replaced
51:9433e3c136f6 52:c8ea815f673d
33 33
34 34
35 def apiFiles(language): 35 def apiFiles(language):
36 """ 36 """
37 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.
38 38
39 @param language language to get APIs for (string) 39 @param language language to get APIs for (string)
40 @return list of API filenames (list of string) 40 @return list of API filenames (list of string)
41 """ 41 """
42 if language in ["Python3", "Python"]: 42 if language in ["Python3", "Python"]:
43 apisDir = os.path.join(os.path.dirname(__file__), "APIs", "Python") 43 apisDir = os.path.join(os.path.dirname(__file__), "APIs", "Python")
44 apis = glob.glob(os.path.join(apisDir, '*.api')) 44 apis = glob.glob(os.path.join(apisDir, "*.api"))
45 45
46 apisDir = os.path.join(os.path.dirname(__file__), "APIs", "Python3") 46 apisDir = os.path.join(os.path.dirname(__file__), "APIs", "Python3")
47 apis.extend(glob.glob(os.path.join(apisDir, '*.api'))) 47 apis.extend(glob.glob(os.path.join(apisDir, "*.api")))
48 return apis 48 return apis
49 else: 49 else:
50 return [] 50 return []
51 51
52 52
53 class PluginApis(QObject): 53 class PluginApis(QObject):
54 """ 54 """
55 Class implementing the Django project plugin. 55 Class implementing the Django project plugin.
56 """ 56 """
57
57 def __init__(self, ui): 58 def __init__(self, ui):
58 """ 59 """
59 Constructor 60 Constructor
60 61
61 @param ui reference to the user interface object (UI.UserInterface) 62 @param ui reference to the user interface object (UI.UserInterface)
62 """ 63 """
63 super().__init__(ui) 64 super().__init__(ui)
64 self.__ui = ui 65 self.__ui = ui
65 66
66 def activate(self): 67 def activate(self):
67 """ 68 """
68 Public method to activate this plugin. 69 Public method to activate this plugin.
69 70
70 @return tuple of None and activation status (boolean) 71 @return tuple of None and activation status (boolean)
71 """ 72 """
72 return None, True 73 return None, True
73 74
74 def deactivate(self): 75 def deactivate(self):
75 """ 76 """
76 Public method to deactivate this plugin. 77 Public method to deactivate this plugin.
77 """ 78 """
78 pass 79 pass

eric ide

mercurial