AssistantEric/APIsManager.py

changeset 84
67197c1f11eb
parent 77
e96c89dd66a7
child 86
11088ce2312f
equal deleted inserted replaced
83:b447f89da620 84:67197c1f11eb
9 9
10 from __future__ import unicode_literals # __IGNORE_WARNING__ 10 from __future__ import unicode_literals # __IGNORE_WARNING__
11 11
12 import os 12 import os
13 13
14 from PyQt4.QtCore import QTimer, QThread, QFileInfo, pyqtSignal, QDateTime, QObject, Qt 14 from PyQt4.QtCore import QTimer, QThread, QFileInfo, pyqtSignal, QDateTime, \
15 QObject, Qt
15 try: 16 try:
16 from PyQt4.QtSql import QSqlDatabase, QSqlQuery 17 from PyQt4.QtSql import QSqlDatabase, QSqlQuery
17 except ImportError: 18 except ImportError:
18 # just ignore it because the main plug-in file will deal with it 19 # just ignore it because the main plug-in file will deal with it
19 pass 20 pass
42 (one of WorkerStatus..., string) 43 (one of WorkerStatus..., string)
43 """ 44 """
44 processing = pyqtSignal(int, str) 45 processing = pyqtSignal(int, str)
45 46
46 populate_api_stmt = """ 47 populate_api_stmt = """
47 INSERT INTO api (acWord, context, fullContext, signature, fileId, pictureId) 48 INSERT INTO api (
48 VALUES (:acWord, :context, :fullContext, :signature, :fileId, :pictureId) 49 acWord, context, fullContext, signature, fileId, pictureId)
50 VALUES (
51 :acWord, :context, :fullContext, :signature, :fileId, :pictureId)
49 """ 52 """
50 populate_del_api_stmt = """ 53 populate_del_api_stmt = """
51 DELETE FROM api WHERE fileId = :fileId 54 DELETE FROM api WHERE fileId = :fileId
52 """ 55 """
53 populate_bases_stmt = """ 56 populate_bases_stmt = """
72 """ 75 """
73 file_delete_id_stmt = """ 76 file_delete_id_stmt = """
74 DELETE FROM file WHERE id = :id 77 DELETE FROM file WHERE id = :id
75 """ 78 """
76 79
77 def __init__(self, proxy, language, apiFiles, projectPath="", refresh=False): 80 def __init__(self, proxy, language, apiFiles, projectPath="",
81 refresh=False):
78 """ 82 """
79 Constructor 83 Constructor
80 84
81 @param proxy reference to the object that is proxied (DbAPIs) 85 @param proxy reference to the object that is proxied (DbAPIs)
82 @param language language of the APIs object (string) 86 @param language language of the APIs object (string)
83 @param apiFiles list of API files to process (list of strings) 87 @param apiFiles list of API files to process (list of strings)
84 @param projectPath path of the project. Only needed, if the APIs 88 @param projectPath path of the project. Only needed, if the APIs
85 are extracted out of the sources of a project. (string) 89 are extracted out of the sources of a project. (string)
86 @param refresh flag indicating a refresh of the APIs of one file (boolean) 90 @param refresh flag indicating a refresh of the APIs of one file
91 (boolean)
87 """ 92 """
88 QThread.__init__(self) 93 QThread.__init__(self)
89 94
90 self.setTerminationEnabled(True) 95 self.setTerminationEnabled(True)
91 96
92 # Get the AC word separators for all of the languages that the editor supports. 97 # Get the AC word separators for all of the languages that the editor
93 # This has to be before we create a new thread, because access to GUI elements 98 # supports. This has to be before we create a new thread, because
94 # is not allowed from non-gui threads. 99 # access to GUI elements is not allowed from non-GUI threads.
95 self.__wseps = {} 100 self.__wseps = {}
96 for lang in QScintilla.Lexers.getSupportedLanguages(): 101 for lang in QScintilla.Lexers.getSupportedLanguages():
97 lexer = QScintilla.Lexers.getLexer(lang) 102 lexer = QScintilla.Lexers.getLexer(lang)
98 if lexer is not None: 103 if lexer is not None:
99 self.__wseps[lang] = lexer.autoCompletionWordSeparators() 104 self.__wseps[lang] = lexer.autoCompletionWordSeparators()
140 loadTime = QDateTime(1970, 1, 1, 0, 0) 145 loadTime = QDateTime(1970, 1, 1, 0, 0)
141 del query 146 del query
142 finally: 147 finally:
143 db.commit() 148 db.commit()
144 if self.__projectPath: 149 if self.__projectPath:
145 modTime = QFileInfo(os.path.join(self.__projectPath, apiFile)).lastModified() 150 modTime = QFileInfo(os.path.join(self.__projectPath, apiFile))\
151 .lastModified()
146 else: 152 else:
147 modTime = QFileInfo(apiFile).lastModified() 153 modTime = QFileInfo(apiFile).lastModified()
148 basesFile = os.path.splitext(apiFile)[0] + ".bas" 154 basesFile = os.path.splitext(apiFile)[0] + ".bas"
149 if os.path.exists(basesFile): 155 if os.path.exists(basesFile):
150 modTimeBases = QFileInfo(basesFile).lastModified() 156 modTimeBases = QFileInfo(basesFile).lastModified()
175 id = Editor.AttributeID 181 id = Editor.AttributeID
176 elif _class.attributes[variable].isProtected(): 182 elif _class.attributes[variable].isProtected():
177 id = Editor.AttributeProtectedID 183 id = Editor.AttributeProtectedID
178 else: 184 else:
179 id = Editor.AttributePrivateID 185 id = Editor.AttributePrivateID
180 api.append('{0}{1}?{2:d}'.format(classNameStr, variable, id)) 186 api.append('{0}{1}?{2:d}'.format(classNameStr, variable,
187 id))
181 return api 188 return api
182 189
183 def __loadApiFile(self, apiFile): 190 def __loadApiFile(self, apiFile):
184 """ 191 """
185 Private method to read a raw API file into the database. 192 Private method to read a raw API file into the database.
199 if language: 206 if language:
200 from DocumentationTools.APIGenerator import APIGenerator 207 from DocumentationTools.APIGenerator import APIGenerator
201 apiGenerator = APIGenerator(module) 208 apiGenerator = APIGenerator(module)
202 apis = apiGenerator.genAPI(True, "", True) 209 apis = apiGenerator.genAPI(True, "", True)
203 if os.path.basename(apiFile).startswith("Ui_"): 210 if os.path.basename(apiFile).startswith("Ui_"):
204 # it is a forms source file, extract public attributes as well 211 # it is a forms source file, extract public attributes
212 # as well
205 apis.extend(self.__classesAttributesApi(module)) 213 apis.extend(self.__classesAttributesApi(module))
206 try: 214 try:
207 basesDict = apiGenerator.genBases(True) 215 basesDict = apiGenerator.genBases(True)
208 for baseEntry in basesDict: 216 for baseEntry in basesDict:
209 if basesDict[baseEntry]: 217 if basesDict[baseEntry]:
210 bases.append("{0} {1}\n".format( 218 bases.append("{0} {1}\n".format(
211 baseEntry, " ".join(sorted(basesDict[baseEntry])))) 219 baseEntry, " ".join(
220 sorted(basesDict[baseEntry]))))
212 except AttributeError: 221 except AttributeError:
213 # eric 5.1 doesn't have this method 222 # eric 5.1 doesn't have this method
214 pass 223 pass
215 except (IOError, ImportError): 224 except (IOError, ImportError):
216 pass 225 pass
220 except (IOError, UnicodeError): 229 except (IOError, UnicodeError):
221 pass 230 pass
222 try: 231 try:
223 basesFile = os.path.splitext(apiFile)[0] + ".bas" 232 basesFile = os.path.splitext(apiFile)[0] + ".bas"
224 if os.path.exists(basesFile): 233 if os.path.exists(basesFile):
225 bases = Utilities.readEncodedFile(basesFile)[0].splitlines(True) 234 bases = Utilities.readEncodedFile(basesFile)[0]\
235 .splitlines(True)
226 except (IOError, UnicodeError): 236 except (IOError, UnicodeError):
227 pass 237 pass
228 language = None 238 language = None
229 239
230 if len(apis) > 0: 240 if len(apis) > 0:
235 245
236 def __storeFileInfoOnly(self, apiFile): 246 def __storeFileInfoOnly(self, apiFile):
237 """ 247 """
238 Private method to store file info only. 248 Private method to store file info only.
239 249
240 Doing this avoids rereading the file whenever the API is initialized in case 250 Doing this avoids rereading the file whenever the API is initialized
241 the given file doesn't contain API data. 251 in case the given file doesn't contain API data.
252
253 @param apiFile file name of the API file (string)
242 """ 254 """
243 db = QSqlDatabase.database(self.__language) 255 db = QSqlDatabase.database(self.__language)
244 db.transaction() 256 db.transaction()
245 try: 257 try:
246 query = QSqlQuery(db) 258 query = QSqlQuery(db)
456 468
457 class DbAPIs(QObject): 469 class DbAPIs(QObject):
458 """ 470 """
459 Class implementing an API storage entity. 471 Class implementing an API storage entity.
460 472
461 @signal apiPreparationStatus(language, status, file) emitted to indicate the 473 @signal apiPreparationStatus(language, status, file) emitted to indicate
462 API preparation status for a language 474 the API preparation status for a language
463 """ 475 """
464 apiPreparationStatus = pyqtSignal(str, int, str) 476 apiPreparationStatus = pyqtSignal(str, int, str)
465 477
466 DB_VERSION = 4 478 DB_VERSION = 4
467 479
506 drop_acWord_idx = """DROP INDEX IF EXISTS acWord_idx""" 518 drop_acWord_idx = """DROP INDEX IF EXISTS acWord_idx"""
507 519
508 create_context_idx = """CREATE INDEX context_idx on api (context)""" 520 create_context_idx = """CREATE INDEX context_idx on api (context)"""
509 drop_context_idx = """DROP INDEX IF EXISTS context_idx""" 521 drop_context_idx = """DROP INDEX IF EXISTS context_idx"""
510 522
511 create_fullContext_idx = """CREATE INDEX fullContext_idx on api (fullContext)""" 523 create_fullContext_idx = \
524 """CREATE INDEX fullContext_idx on api (fullContext)"""
512 drop_fullContext_idx = """DROP INDEX IF EXISTS fullContext_idx""" 525 drop_fullContext_idx = """DROP INDEX IF EXISTS fullContext_idx"""
513 526
514 create_bases_idx = """CREATE INDEX base_idx on bases (class)""" 527 create_bases_idx = """CREATE INDEX base_idx on bases (class)"""
515 drop_bases_idx = """DROP INDEX IF EXISTS base_idx""" 528 drop_bases_idx = """DROP INDEX IF EXISTS base_idx"""
516 529
557 format_select_stmt = """ 570 format_select_stmt = """
558 SELECT format FROM mgmt 571 SELECT format FROM mgmt
559 """ 572 """
560 mgmt_insert_stmt = """ 573 mgmt_insert_stmt = """
561 INSERT INTO mgmt (format) VALUES ({0:d}) 574 INSERT INTO mgmt (format) VALUES ({0:d})
562 """.format(DB_VERSION) 575 """.format(DB_VERSION)
563 576
564 def __init__(self, language, parent=None): 577 def __init__(self, language, parent=None):
565 """ 578 """
566 Constructor 579 Constructor
567 580
590 self.__project = e5App().getObject("Project") 603 self.__project = e5App().getObject("Project")
591 self.__project.projectOpened.connect(self.__projectOpened) 604 self.__project.projectOpened.connect(self.__projectOpened)
592 self.__project.newProject.connect(self.__projectOpened) 605 self.__project.newProject.connect(self.__projectOpened)
593 self.__project.projectClosed.connect(self.__projectClosed) 606 self.__project.projectClosed.connect(self.__projectClosed)
594 try: 607 try:
595 self.__project.projectFormCompiled.connect(self.__projectFormCompiled) 608 self.__project.projectFormCompiled.connect(
609 self.__projectFormCompiled)
596 except AttributeError: 610 except AttributeError:
597 # older eric5 versions don't have this signal 611 # older eric5 versions don't have this signal
598 pass 612 pass
599 try: 613 try:
600 self.__project.projectChanged.connect(self.__projectChanged) 614 self.__project.projectChanged.connect(self.__projectChanged)
751 completed (string) 765 completed (string)
752 @keyparam context string giving the context (e.g. classname) 766 @keyparam context string giving the context (e.g. classname)
753 to be completed (string) 767 to be completed (string)
754 @keyparam followHierarchy flag indicating to follow the hierarchy of 768 @keyparam followHierarchy flag indicating to follow the hierarchy of
755 base classes (boolean) 769 base classes (boolean)
756 @return list of dictionaries with possible completions (key 'completion' 770 @return list of dictionaries with possible completions
757 contains the completion (string), key 'context' 771 (key 'completion' contains the completion (string),
758 contains the context (string) and key 'pictureId' 772 key 'context' contains the context (string) and
759 contains the ID of the icon to be shown (string)) 773 key 'pictureId' contains the ID of the icon to be shown (string))
760 """ 774 """
761 completions = [] 775 completions = []
762 776
763 db = QSqlDatabase.database(self.__language) 777 db = QSqlDatabase.database(self.__language)
764 if db.isOpen() and not self.__inPreparation: 778 if db.isOpen() and not self.__inPreparation:
809 showContext=True, followHierarchy=False): 823 showContext=True, followHierarchy=False):
810 """ 824 """
811 Public method to determine the calltips. 825 Public method to determine the calltips.
812 826
813 @param acWord function to get calltips for (string) 827 @param acWord function to get calltips for (string)
814 @param commas minimum number of commas contained in the calltip (integer) 828 @param commas minimum number of commas contained in the calltip
829 (integer)
815 @param context string giving the context (e.g. classname) (string) 830 @param context string giving the context (e.g. classname) (string)
816 @param fullContext string giving the full context (string) 831 @param fullContext string giving the full context (string)
817 @param showContext flag indicating to show the calltip context (boolean) 832 @param showContext flag indicating to show the calltip context
833 (boolean)
818 @keyparam followHierarchy flag indicating to follow the hierarchy of 834 @keyparam followHierarchy flag indicating to follow the hierarchy of
819 base classes (boolean) 835 base classes (boolean)
820 @return list of calltips (list of string) 836 @return list of calltips (list of string)
821 """ 837 """
822 calltips = [] 838 calltips = []
868 if query.next(): 884 if query.next():
869 bases = query.value(0).split() 885 bases = query.value(0).split()
870 else: 886 else:
871 bases = [] 887 bases = []
872 for base in bases: 888 for base in bases:
873 calltips.extend(self.getCalltips(acWord, commas, context=base, 889 calltips.extend(self.getCalltips(
874 showContext=showContext, 890 acWord, commas, context=base, showContext=showContext,
875 followHierarchy=True)) 891 followHierarchy=True))
876 892
877 if context and len(calltips) == 0 and not followHierarchy: 893 if context and len(calltips) == 0 and not followHierarchy:
878 # nothing found, try without a context 894 # nothing found, try without a context
879 calltips = self.getCalltips(acWord, commas, showContext=showContext) 895 calltips = self.getCalltips(
896 acWord, commas, showContext=showContext)
880 897
881 return calltips 898 return calltips
882 899
883 def __enoughCommas(self, s, commas): 900 def __enoughCommas(self, s, commas):
884 """ 901 """
885 Private method to determine, if the given string contains enough commas. 902 Private method to determine, if the given string contains enough
903 commas.
886 904
887 @param s string to check (string) 905 @param s string to check (string)
888 @param commas number of commas to check for (integer) 906 @param commas number of commas to check for (integer)
889 @return flag indicating, that there are enough commas (boolean) 907 @return flag indicating, that there are enough commas (boolean)
890 """ 908 """
909 927
910 def __getProjectFormSources(self, normalized=False): 928 def __getProjectFormSources(self, normalized=False):
911 """ 929 """
912 Private method to get the source files for the project forms. 930 Private method to get the source files for the project forms.
913 931
914 @keyparam normalized flag indicating a normalized filename is wanted (boolean) 932 @keyparam normalized flag indicating a normalized filename is wanted
933 (boolean)
915 @return list of project form sources (list of strings) 934 @return list of project form sources (list of strings)
916 """ 935 """
917 if self.__project.pdata["PROGLANGUAGE"][0] in ["Python", "Python2", "Python3"]: 936 if self.__project.pdata["PROGLANGUAGE"][0] in ["Python", "Python2",
937 "Python3"]:
918 sourceExt = ".py" 938 sourceExt = ".py"
919 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby": 939 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby":
920 sourceExt = ".rb" 940 sourceExt = ".rb"
921 else: 941 else:
922 return [] 942 return []
925 for fn in self.__project.pdata["FORMS"]: 945 for fn in self.__project.pdata["FORMS"]:
926 ofn = os.path.splitext(fn)[0] 946 ofn = os.path.splitext(fn)[0]
927 dirname, filename = os.path.split(ofn) 947 dirname, filename = os.path.split(ofn)
928 formSource = os.path.join(dirname, "Ui_" + filename + sourceExt) 948 formSource = os.path.join(dirname, "Ui_" + filename + sourceExt)
929 if normalized: 949 if normalized:
930 formSource = os.path.join(self.__project.getProjectPath(), formSource) 950 formSource = os.path.join(
951 self.__project.getProjectPath(), formSource)
931 formsSources.append(formSource) 952 formsSources.append(formSource)
932 return formsSources 953 return formsSources
933 954
934 def prepareAPIs(self, rawList=None): 955 def prepareAPIs(self, rawList=None):
935 """ 956 """
944 if rawList: 965 if rawList:
945 apiFiles = rawList[:] 966 apiFiles = rawList[:]
946 elif self.__language == ApisNameProject: 967 elif self.__language == ApisNameProject:
947 apiFiles = self.__project.getSources()[:] 968 apiFiles = self.__project.getSources()[:]
948 apiFiles.extend( 969 apiFiles.extend(
949 [f for f in self.__getProjectFormSources() if f not in apiFiles]) 970 [f for f in self.__getProjectFormSources() if
971 f not in apiFiles])
950 projectPath = self.__project.getProjectPath() 972 projectPath = self.__project.getProjectPath()
951 else: 973 else:
952 apiFiles = Preferences.getEditorAPI(self.__language) 974 apiFiles = Preferences.getEditorAPI(self.__language)
953 self.__worker = DbAPIsWorker(self, self.__language, apiFiles, projectPath) 975 self.__worker = DbAPIsWorker(self, self.__language, apiFiles,
954 self.__worker.processing.connect(self.__processingStatus, Qt.QueuedConnection) 976 projectPath)
977 self.__worker.processing.connect(
978 self.__processingStatus, Qt.QueuedConnection)
955 self.__worker.start() 979 self.__worker.start()
956 980
957 def __processQueue(self): 981 def __processQueue(self):
958 """ 982 """
959 Private slot to process the queue of files to load. 983 Private slot to process the queue of files to load.
967 if self.__language == ApisNameProject: 991 if self.__language == ApisNameProject:
968 projectPath = self.__project.getProjectPath() 992 projectPath = self.__project.getProjectPath()
969 apiFiles = [apiFiles[0].replace(projectPath + os.sep, "")] 993 apiFiles = [apiFiles[0].replace(projectPath + os.sep, "")]
970 else: 994 else:
971 projectPath = "" 995 projectPath = ""
972 self.__worker = DbAPIsWorker(self, self.__language, apiFiles, projectPath, 996 self.__worker = DbAPIsWorker(self, self.__language, apiFiles,
973 refresh=True) 997 projectPath, refresh=True)
974 self.__worker.processing.connect(self.__processingStatus, Qt.QueuedConnection) 998 self.__worker.processing.connect(
999 self.__processingStatus, Qt.QueuedConnection)
975 self.__worker.start() 1000 self.__worker.start()
976 1001
977 def getLexer(self): 1002 def getLexer(self):
978 """ 1003 """
979 Public method to return a reference to our lexer object. 1004 Public method to return a reference to our lexer object.
1000 @param status preparation status (integer, one of WorkerStatus...) 1025 @param status preparation status (integer, one of WorkerStatus...)
1001 @param filename name of the file being processed (string) 1026 @param filename name of the file being processed (string)
1002 """ 1027 """
1003 if status == WorkerStatusStarted: 1028 if status == WorkerStatusStarted:
1004 self.__inPreparation = True 1029 self.__inPreparation = True
1005 self.apiPreparationStatus.emit(self.__language, WorkerStatusStarted, "") 1030 self.apiPreparationStatus.emit(
1031 self.__language, WorkerStatusStarted, "")
1006 elif status == WorkerStatusFinished: 1032 elif status == WorkerStatusFinished:
1007 self.__inPreparation = False 1033 self.__inPreparation = False
1008 self.apiPreparationStatus.emit(self.__language, WorkerStatusFinished, "") 1034 self.apiPreparationStatus.emit(
1035 self.__language, WorkerStatusFinished, "")
1009 QTimer.singleShot(0, self.__processQueue) 1036 QTimer.singleShot(0, self.__processQueue)
1010 elif status == WorkerStatusAborted: 1037 elif status == WorkerStatusAborted:
1011 self.__inPreparation = False 1038 self.__inPreparation = False
1012 self.apiPreparationStatus.emit(self.__language, WorkerStatusAborted, "") 1039 self.apiPreparationStatus.emit(
1040 self.__language, WorkerStatusAborted, "")
1013 QTimer.singleShot(0, self.__processQueue) 1041 QTimer.singleShot(0, self.__processQueue)
1014 elif status == WorkerStatusFile: 1042 elif status == WorkerStatusFile:
1015 self.apiPreparationStatus.emit(self.__language, WorkerStatusFile, filename) 1043 self.apiPreparationStatus.emit(
1044 self.__language, WorkerStatusFile, filename)
1016 1045
1017 ######################################################## 1046 ########################################################
1018 ## project related stuff below 1047 ## project related stuff below
1019 ######################################################## 1048 ########################################################
1020 1049
1021 def __projectOpened(self): 1050 def __projectOpened(self):
1022 """ 1051 """
1023 Private slot to perform actions after a project has been opened. 1052 Private slot to perform actions after a project has been opened.
1024 """ 1053 """
1025 if self.__project.getProjectLanguage() in ["Python", "Python2", "Python3"]: 1054 if self.__project.getProjectLanguage() in ["Python", "Python2",
1055 "Python3"]:
1026 self.__discardFirst = ["self", "cls"] 1056 self.__discardFirst = ["self", "cls"]
1027 else: 1057 else:
1028 self.__discardFirst = [] 1058 self.__discardFirst = []
1029 self.__lexer = QScintilla.Lexers.getLexer(self.__project.getProjectLanguage()) 1059 self.__lexer = QScintilla.Lexers.getLexer(
1060 self.__project.getProjectLanguage())
1030 self.__openAPIs() 1061 self.__openAPIs()
1031 1062
1032 def __projectClosed(self): 1063 def __projectClosed(self):
1033 """ 1064 """
1034 Private slot to perform actions after a project has been closed. 1065 Private slot to perform actions after a project has been closed.
1092 def getAPIs(self, language): 1123 def getAPIs(self, language):
1093 """ 1124 """
1094 Public method to get an apis object for autocompletion/calltips. 1125 Public method to get an apis object for autocompletion/calltips.
1095 1126
1096 This method creates and loads an APIs object dynamically upon request. 1127 This method creates and loads an APIs object dynamically upon request.
1097 This saves memory for languages, that might not be needed at the moment. 1128 This saves memory for languages, that might not be needed at the
1129 moment.
1098 1130
1099 @param language the language of the requested api object (string) 1131 @param language the language of the requested api object (string)
1100 @return the apis object (APIs) 1132 @return the apis object (APIs)
1101 """ 1133 """
1102 try: 1134 try:
1152 self.__showMessage(self.trUtf8("Preparation of '{0}' APIs started.") 1184 self.__showMessage(self.trUtf8("Preparation of '{0}' APIs started.")
1153 .format(language)) 1185 .format(language))
1154 1186
1155 def __apiPreparationCancelled(self, language): 1187 def __apiPreparationCancelled(self, language):
1156 """ 1188 """
1157 Private slot handling the preparation cancelled signal of an API object. 1189 Private slot handling the preparation cancelled signal of an API
1190 object.
1158 1191
1159 @param language language of the API (string) 1192 @param language language of the API (string)
1160 """ 1193 """
1161 if language == ApisNameProject: 1194 if language == ApisNameProject:
1162 language = self.trUtf8("Project") 1195 language = self.trUtf8("Project")
1173 """ 1206 """
1174 if language == ApisNameProject: 1207 if language == ApisNameProject:
1175 language = self.trUtf8("Project") 1208 language = self.trUtf8("Project")
1176 1209
1177 if status == WorkerStatusStarted: 1210 if status == WorkerStatusStarted:
1178 self.__showMessage(self.trUtf8("Preparation of '{0}' APIs started.").format( 1211 self.__showMessage(self.trUtf8(
1179 language)) 1212 "Preparation of '{0}' APIs started.").format(language))
1180 elif status == WorkerStatusFile: 1213 elif status == WorkerStatusFile:
1181 self.__showMessage(self.trUtf8("'{0}' APIs: Processing '{1}'").format( 1214 self.__showMessage(self.trUtf8(
1215 "'{0}' APIs: Processing '{1}'").format(
1182 language, os.path.basename(filename))) 1216 language, os.path.basename(filename)))
1183 elif status == WorkerStatusFinished: 1217 elif status == WorkerStatusFinished:
1184 self.__showMessage(self.trUtf8("Preparation of '{0}' APIs finished.").format( 1218 self.__showMessage(self.trUtf8(
1185 language)) 1219 "Preparation of '{0}' APIs finished.").format(language))
1186 elif status == WorkerStatusAborted: 1220 elif status == WorkerStatusAborted:
1187 self.__showMessage(self.trUtf8("Preparation of '{0}' APIs cancelled.").format( 1221 self.__showMessage(self.trUtf8(
1188 language)) 1222 "Preparation of '{0}' APIs cancelled.").format(language))

eric ide

mercurial