eric6/UI/BrowserModel.py

changeset 8131
f2129bb79269
parent 8109
486984bb52e3
child 8142
43248bafe9b2
child 8143
2c730d5fd177
equal deleted inserted replaced
8130:5fe4ff181b68 8131:f2129bb79269
619 moduleName = parentItem.moduleName() 619 moduleName = parentItem.moduleName()
620 fileName = parentItem.fileName() 620 fileName = parentItem.fileName()
621 try: 621 try:
622 dictionary = Utilities.ClassBrowsers.readmodule( 622 dictionary = Utilities.ClassBrowsers.readmodule(
623 moduleName, [parentItem.dirName()], 623 moduleName, [parentItem.dirName()],
624 parentItem.isPython3File()) 624 parentItem.isPython3File() or parentItem.isCythonFile())
625 except ImportError: 625 except ImportError:
626 return 626 return
627 627
628 keys = list(dictionary.keys()) 628 keys = list(dictionary.keys())
629 if len(keys) > 0: 629 if len(keys) > 0:
1158 if self.isPython3File(): 1158 if self.isPython3File():
1159 pixName = "filePython" 1159 pixName = "filePython"
1160 self._populated = False 1160 self._populated = False
1161 self._lazyPopulation = True 1161 self._lazyPopulation = True
1162 self._moduleName = os.path.basename(finfo) 1162 self._moduleName = os.path.basename(finfo)
1163 elif self.isCythonFile():
1164 pixName = "lexerCython"
1165 self._populated = False
1166 self._lazyPopulation = True
1167 self._moduleName = os.path.basename(finfo)
1163 elif self.isRubyFile(): 1168 elif self.isRubyFile():
1164 pixName = "fileRuby" 1169 pixName = "fileRuby"
1165 self._populated = False 1170 self._populated = False
1166 self._lazyPopulation = True 1171 self._lazyPopulation = True
1167 self._moduleName = os.path.basename(finfo) 1172 self._moduleName = os.path.basename(finfo)
1268 1273
1269 def isPython3File(self): 1274 def isPython3File(self):
1270 """ 1275 """
1271 Public method to check, if this file is a Python3 script. 1276 Public method to check, if this file is a Python3 script.
1272 1277
1273 @return flag indicating a Python file (boolean) 1278 @return flag indicating a Python3 file
1279 @rtype bool
1274 """ 1280 """
1275 return ( 1281 return (
1276 self.fileext in Preferences.getPython("Python3Extensions") or 1282 self.fileext in Preferences.getPython("Python3Extensions") or
1277 (self.fileext == "" and self.sourceLanguage == "Python3") 1283 (self.fileext == "" and self.sourceLanguage == "Python3")
1284 )
1285
1286 def isCythonFile(self):
1287 """
1288 Public method to check, if this file is a Cython file.
1289
1290 @return flag indicating a Cython file
1291 @rtype bool
1292 """
1293 return (
1294 self.fileext in (".pyx", ".pxd", ".pxi") or
1295 (self.fileext == "" and self.sourceLanguage == "Cython")
1278 ) 1296 )
1279 1297
1280 def isRubyFile(self): 1298 def isRubyFile(self):
1281 """ 1299 """
1282 Public method to check, if this file is a Ruby script. 1300 Public method to check, if this file is a Ruby script.

eric ide

mercurial