Utilities/ModuleParser.py

changeset 841
0d379ff260df
parent 791
9ec2ac20e54e
child 945
8cd4d08fa9f6
child 1352
0d0d42ee74c4
equal deleted inserted replaced
840:7d86780fea93 841:0d379ff260df
21 import imp 21 import imp
22 import re 22 import re
23 23
24 import Utilities 24 import Utilities
25 from functools import reduce 25 from functools import reduce
26 import Preferences
26 27
27 __all__ = ["Module", "Class", "Function", "RbModule", "readModule"] 28 __all__ = ["Module", "Class", "Function", "RbModule", "readModule"]
28 29
29 TABWIDTH = 4 30 TABWIDTH = 4
30 31
1070 Public method to get the type of the module's source. 1071 Public method to get the type of the module's source.
1071 1072
1072 @return type of the modules's source (string) 1073 @return type of the modules's source (string)
1073 """ 1074 """
1074 if self.type in [imp.PY_SOURCE, PTL_SOURCE]: 1075 if self.type in [imp.PY_SOURCE, PTL_SOURCE]:
1075 type = "Python" 1076 py3ExtList = Preferences.getDebugger("Python3Extensions").split()
1077 if self.file.endswith(tuple(py3ExtList)):
1078 type = "Python3"
1079 else:
1080 type = "Python2"
1076 elif self.type == RB_SOURCE: 1081 elif self.type == RB_SOURCE:
1077 type = "Ruby" 1082 type = "Ruby"
1078 else: 1083 else:
1079 type = "" 1084 type = ""
1080 return type 1085 return type

eric ide

mercurial