22 |
22 |
23 @signal apiPreparationFinished() emitted after the API preparation has finished |
23 @signal apiPreparationFinished() emitted after the API preparation has finished |
24 @signal apiPreparationCancelled() emitted after the API preparation has been cancelled |
24 @signal apiPreparationCancelled() emitted after the API preparation has been cancelled |
25 @signal apiPreparationStarted() emitted after the API preparation has started |
25 @signal apiPreparationStarted() emitted after the API preparation has started |
26 """ |
26 """ |
|
27 apiPreparationFinished = pyqtSignal() |
|
28 apiPreparationCancelled = pyqtSignal() |
|
29 apiPreparationStarted = pyqtSignal() |
|
30 |
27 def __init__(self, language, forPreparation = False, parent = None): |
31 def __init__(self, language, forPreparation = False, parent = None): |
28 """ |
32 """ |
29 Constructor |
33 Constructor |
30 |
34 |
31 @param language language of the APIs object (string) |
35 @param language language of the APIs object (string) |
44 self.__apifiles.sort() |
48 self.__apifiles.sort() |
45 if self.__lexer is None: |
49 if self.__lexer is None: |
46 self.__apis = None |
50 self.__apis = None |
47 else: |
51 else: |
48 self.__apis = QsciAPIs(self.__lexer) |
52 self.__apis = QsciAPIs(self.__lexer) |
49 self.connect(self.__apis, SIGNAL("apiPreparationFinished()"), |
53 self.__apis.apiPreparationFinished.connect(self.__apiPreparationFinished) |
50 self.__apiPreparationFinished) |
54 self.__apis.apiPreparationCancelled.connect(self.__apiPreparationCancelled) |
51 self.connect(self.__apis, SIGNAL("apiPreparationCancelled()"), |
55 self.__apis.apiPreparationStarted.connect(self.__apiPreparationStarted) |
52 self.__apiPreparationCancelled) |
|
53 self.connect(self.__apis, SIGNAL("apiPreparationStarted()"), |
|
54 self.__apiPreparationStarted) |
|
55 self.__loadAPIs() |
56 self.__loadAPIs() |
56 |
57 |
57 def __loadAPIs(self): |
58 def __loadAPIs(self): |
58 """ |
59 """ |
59 Private method to load the APIs. |
60 Private method to load the APIs. |
90 """ |
91 """ |
91 Private method called to save an API, after it has been prepared. |
92 Private method called to save an API, after it has been prepared. |
92 """ |
93 """ |
93 self.__apis.savePrepared() |
94 self.__apis.savePrepared() |
94 self.__inPreparation = False |
95 self.__inPreparation = False |
95 self.emit(SIGNAL('apiPreparationFinished()')) |
96 self.apiPreparationFinished.emit() |
96 |
97 |
97 def __apiPreparationCancelled(self): |
98 def __apiPreparationCancelled(self): |
98 """ |
99 """ |
99 Private method called, after the API preparation process has been cancelled. |
100 Private method called, after the API preparation process has been cancelled. |
100 """ |
101 """ |
101 self.__inPreparation = False |
102 self.__inPreparation = False |
102 self.emit(SIGNAL('apiPreparationCancelled()')) |
103 self.apiPreparationCancelled.emit() |
103 |
104 |
104 def __apiPreparationStarted(self): |
105 def __apiPreparationStarted(self): |
105 """ |
106 """ |
106 Private method called, when the API preparation process started. |
107 Private method called, when the API preparation process started. |
107 """ |
108 """ |
108 self.__inPreparation = True |
109 self.__inPreparation = True |
109 self.emit(SIGNAL('apiPreparationStarted()')) |
110 self.apiPreparationStarted.emit() |
110 |
111 |
111 def prepareAPIs(self, ondemand = False, rawList = None): |
112 def prepareAPIs(self, ondemand = False, rawList = None): |
112 """ |
113 """ |
113 Public method to prepare the APIs if necessary. |
114 Public method to prepare the APIs if necessary. |
114 |
115 |