158 flags = Utilities.extractFlags(source) |
158 flags = Utilities.extractFlags(source) |
159 ext = os.path.splitext(file)[1] |
159 ext = os.path.splitext(file)[1] |
160 if ("FileType" in flags and |
160 if ("FileType" in flags and |
161 flags["FileType"] in ["Python", "Python2"]) or \ |
161 flags["FileType"] in ["Python", "Python2"]) or \ |
162 file in py2files or \ |
162 file in py2files or \ |
163 (ext in [".py", ".pyw"] and \ |
163 (ext in [".py", ".pyw"] and |
164 Preferences.getProject("DeterminePyFromProject") and \ |
164 Preferences.getProject("DeterminePyFromProject") and |
165 self.__project.isOpen() and \ |
165 self.__project.isOpen() and |
166 self.__project.isProjectFile(file) and \ |
166 self.__project.isProjectFile(file) and |
167 self.__project.getProjectLanguage() in ["Python", |
167 self.__project.getProjectLanguage() in ["Python", |
168 "Python2"]): |
168 "Python2"]): |
169 nok, fname, line, error = self.__py2check(file) |
169 nok, fname, line, error = self.__py2check(file) |
170 else: |
170 else: |
171 from . import Tabnanny |
171 from . import Tabnanny |