PythonFileAnalyzer implements FileAnalyzer { public static FileAnalyzer createAnalyzer(final File _file) { try (final InputStream is = new FileInputStream(_file)) { return PythonFileAnalyzer.createAnalyzer(is); } catch (IOException e) { log.error( e.getClass().getSimpleName() + " when creating analyzer for file [" + _file.toPath().toAbsolutePath() + "]: " + e.getMessage(), e); } return null; }  @Override String[] getSupportedFileExtensions(); @Override boolean canAnalyze(File _file); @Override void analyze(final File _file); @Override Map<ConstructId, Construct> getConstructs(); @Override boolean containsConstruct(ConstructId _id); @Override Construct getConstruct(ConstructId _id); @Override boolean hasChilds(); @Override Set<FileAnalyzer> getChilds(boolean _recursive); static PythonId getModule(File _file); static FileAnalyzer createAnalyzer(final File _file); static FileAnalyzer createAnalyzer(InputStream _is);  }
@Test public void testPython2() throws FileAnalysisException { final FileAnalyzer fa = PythonFileAnalyzer.createAnalyzer(new File("src/test/resources/python2_syntax.py")); assertTrue(fa instanceof org.eclipse.steady.python.Python335FileAnalyzer); }
@Test public void testAsync() throws FileAnalysisException { final FileAnalyzer fa = PythonFileAnalyzer.createAnalyzer(new File("src/test/resources/async.py")); assertTrue(fa instanceof org.eclipse.steady.python.Python3FileAnalyzer); }