343 for |
343 for |
344 @type QScintilla.Editor.Editor |
344 @type QScintilla.Editor.Editor |
345 """ |
345 """ |
346 language = editor.getLanguage() |
346 language = editor.getLanguage() |
347 if language not in self.__editorLanguageMapping: |
347 if language not in self.__editorLanguageMapping: |
|
348 self.__documentationViewer.documentationReady( |
|
349 self.tr("Language '{0}' is not supported.").format(language)) |
348 return |
350 return |
349 idString = self.__editorLanguageMapping[language] |
351 idString = self.__editorLanguageMapping[language] |
350 |
352 |
351 filename = editor.getFileName() |
353 filename = editor.getFileName() |
352 source = editor.text() |
354 source = editor.text() |
378 |
380 |
379 if "Error" not in result: |
381 if "Error" not in result: |
380 documentationDict = result["DocumentationDict"] |
382 documentationDict = result["DocumentationDict"] |
381 if documentationDict: |
383 if documentationDict: |
382 if "module" in documentationDict: |
384 if "module" in documentationDict: |
383 documentationDict["note"] = \ |
385 if Preferences.getDocuViewer("ShowInfoAsMarkdown"): |
384 self.tr("Present in {0} module").format( |
386 documentationDict["note"] = \ |
385 documentationDict["module"]) |
387 self.tr("Present in _{0}_ module", |
|
388 "Note with markdown syntax")\ |
|
389 .format(documentationDict["module"]) |
|
390 else: |
|
391 documentationDict["note"] = \ |
|
392 self.tr("Present in '{0}' module", |
|
393 "Note as plain text")\ |
|
394 .format(documentationDict["module"]) |
386 del documentationDict["module"] |
395 del documentationDict["module"] |
387 docu = documentationDict |
396 docu = documentationDict |
388 |
397 |
389 self.__documentationViewer.documentationReady(docu) |
398 self.__documentationViewer.documentationReady(docu) |
390 |
399 |