Pytocs.TypeInference.AnalyzerImpl.locateModule C# (CSharp) Method

locateModule() public method

Find the path that contains modname. Used to find the starting point of locating a qname.
public locateModule ( string headName ) : string
headName string first module name segment
return string
        public string locateModule(string headName)
        {
            List<string> loadPath = getLoadPath();
            foreach (string p in loadPath)
            {
                string startDir = FileSystem.CombinePath(p, headName);
                string initFile = FileSystem.CombinePath(startDir, "__init__.py");

                if (FileSystem.FileExists(initFile))
                {
                    return p;
                }

                string startFile = FileSystem.CombinePath(startDir , suffix);
                if (FileSystem.FileExists(startFile))
                {
                    return p;
                }
            }
            return null;
        }