2008 names for Pygments (boolean) |
2008 names for Pygments (boolean) |
2009 @return language of the editor (string) |
2009 @return language of the editor (string) |
2010 """ |
2010 """ |
2011 if self.apiLanguage == "Guessed" or self.apiLanguage.startswith("Pygments|"): |
2011 if self.apiLanguage == "Guessed" or self.apiLanguage.startswith("Pygments|"): |
2012 lang = self.lexer_.name() |
2012 lang = self.lexer_.name() |
2013 if normalized: # __IGNORE_WARNING_Y102__ |
2013 if normalized and lang in ("Python 2.x", "Python"): |
2014 # adjust some Pygments lexer names |
2014 # adjust some Pygments lexer names |
2015 if lang in ("Python 2.x", "Python"): |
2015 lang = "Python3" |
2016 lang = "Python3" |
|
2017 |
2016 |
2018 else: |
2017 else: |
2019 lang = self.apiLanguage |
2018 lang = self.apiLanguage |
2020 if forPygments: # __IGNORE_WARNING_Y102__ |
2019 if forPygments and lang == "Python3": |
2021 # adjust some names to Pygments lexer names |
2020 # adjust some names to Pygments lexer names |
2022 if lang == "Python3": |
2021 lang = "Python" |
2023 lang = "Python" |
|
2024 return lang |
2022 return lang |
2025 |
2023 |
2026 def getApiLanguage(self): |
2024 def getApiLanguage(self): |
2027 """ |
2025 """ |
2028 Public method to get the API language of the editor. |
2026 Public method to get the API language of the editor. |