Returns project source folders
551957
def get_source_folders(self):
        """"""
        if self.root is None:
            return []
        result = list(self._custom_source_folders)
        result.extend(self.pycore._find_source_folders(self.root))
        return result
488224
private function getInfoSourceFiles(): void
  {
    $this->logVerbose('Get resource files info.');

    // Get the base dir of the sources.
    $dir = $this->getProject()->getReference($this->sourcesFilesetId)->getDir($this->getProject());

    foreach ($this->sourceFileNames as $theFileName)
    {
      $filename                          = $dir.'/'.$theFileName;
      $real_path                         = realpath($filename);
      $this->sourceFilesInfo[$real_path] = $filename;
    }

    $suc = ksort($this->sourceFilesInfo);
    if ($suc===false) $this->logError("ksort failed.");
  }
202033
def project_top_dir(self, *args) -> str:
        
        return os.path.join(self.project_dir, *args)
1174670
def get_default_project_directory():
    

    server_config = Config.instance().get_section_config("Server")
    path = os.path.expanduser(server_config.get("projects_path", "~/GNS3/projects"))
    path = os.path.normpath(path)
    try:
        os.makedirs(path, exist_ok=True)
    except OSError as e:
        raise aiohttp.web.HTTPInternalServerError(text="Could not create project directory: {}".format(e))
    return path
141514
def get_generated_project_files(self, tool):
        

        exporter = ToolsSupported().get_tool(tool)
        return exporter(self.generated_files[tool], self.settings).get_generated_project_files()
641737
def hlp_source_under(folder):
    
    # walk the folder and find the __init__.py entries for packages.
    packages = []
    package_dir = dict()
    for root, dirs, files in os.walk(folder):
        for file in files:
            if file != '__init__.py':
                continue
            full = os.path.dirname(os.path.join(root, file))
            relative = os.path.relpath(full, folder)
            packages.append(relative)
            package_dir[relative] = full
    # we use pprint because we want the order to always remain the same
    return 'packages={0},\npackage_dir={1}'.format(sorted(packages), pprint.pformat(package_dir))
1283533
def library_directories(self) -> typing.List[str]:
        
        def listify(value):
            return [value] if isinstance(value, str) else list(value)

        # If this is a project running remotely remove external library
        # folders as the remote shared libraries folder will contain all
        # of the necessary dependencies
        is_local_project = not self.is_remote_project
        folders = [
            f
            for f in listify(self.settings.fetch('library_folders', ['libs']))
            if is_local_project or not f.startswith('..')
        ]

        # Include the remote shared library folder as well
        folders.append('../__cauldron_shared_libs')

        # Include the project directory as well
        folders.append(self.source_directory)

        return [
            environ.paths.clean(os.path.join(self.source_directory, folder))
            for folder in folders
        ]
194403
def get_c_sources(folder, include_headers=False):
    """"""
    allowed_extensions = [".c", ".C", ".cc", ".cpp", ".cxx", ".c++"]
    if include_headers:
        allowed_extensions += [".h", ".hpp"]
    sources = []
    for root, _, files in os.walk(folder):
        for name in files:
            ext = os.path.splitext(name)[1]
            if name == "types.cc":
                # Make sure `types.cc` is compiled first, as it has multiple
                # useful static assertions.
                sources.insert(0, os.path.join(root, name))
            elif ext in allowed_extensions:
                sources.append(os.path.join(root, name))
    return sources
995127
def find_sources(self):
        
        app_configs = apps.get_app_configs()
        for app_config in app_configs:
            ignore_dirs = []
            for root, dirs, files in os.walk(app_config.path):
                if [True for idir in ignore_dirs if root.startswith(idir)]:
                    continue
                if '__init__.py' not in files:
                    ignore_dirs.append(root)
                    continue
                for filename in files:
                    basename, ext = os.path.splitext(filename)
                    if ext != '.py':
                        continue
                    yield os.path.abspath(os.path.join(root, filename))
1372747
def _get_project_types(self):
        """"""
        project_types = get_available_project_types()
        projects = []

        for project in project_types:
            projects.append(project.PROJECT_TYPE_NAME)

        return projects
721126
function getOldProjectName(projectDir) {
  var files = [];
  try {
    files = fs.readdirSync(projectDir);
  } catch (err) {
    return '';
  }

  var projectFile = '';
  files.forEach(function(fileName) {
    if (path.extname(fileName) === '.xcodeproj') {
      projectFile = path.basename(fileName, '.xcodeproj');
    }
  });

  return projectFile;
}
1264195
def get_pkglist():
    

    dists = Distributions()
    projects = []
    for (dist, _active) in dists.get_distributions("all"):
        if dist.project_name not in projects:
            projects.append(dist.project_name)
    return projects
488995
def get_package_sources(self):
        """"""
        # Checkout local modules
        for config in self.sources.get('local', []):
            self.fetch_local_package(config=config)
        # Checkout S3 repositories specified in config
        for config in self.sources.get('s3', []):
            self.fetch_s3_package(config=config)
        # Checkout git repositories specified in config
        for config in self.sources.get('git', []):
            self.fetch_git_package(config=config)
30983
def get_program_files_dir():
    
    ProgramFiles = bjam.variable("ProgramFiles")
    if ProgramFiles:
        ProgramFiles = ' '.join(ProgramFiles)
    else:
        ProgramFiles = "c:\\Program Files"
    return ProgramFiles
390641
def get_template_dirs(self):
        
        def if_not_empty(dir):
            if not os.path.exists(dir):
                return
            for root, dirs, files in os.walk(dir):
                if dirs:
                    return True
                for f in files:
                    if f != 'readme.txt':
                        return True
                    
        template_dirs = [os.path.join(self.project_dir, x) for x in settings.GLOBAL.TEMPLATE_DIRS or []]
        taglibs_dirs = []
        for p in reversed(self.apps):
            app_path = get_app_dir(p)
            path = os.path.join(app_path, 'templates')
            if if_not_empty(path):
                template_dirs.append(path)

            path = os.path.join(app_path, 'taglibs')
            if if_not_empty(path):
                taglibs_dirs.append(path)

        Dispatcher.template_dirs = template_dirs
        Dispatcher.taglibs_dirs = taglibs_dirs
249080
def folder(self) -> typing.Union[str, None]:
        

        if 'folder' in self.data:
            return self.data.get('folder')
        elif self.project_folder:
            if callable(self.project_folder):
                return self.project_folder()
            else:
                return self.project_folder
        return None
264908
def get_projects(machine):
    

    query = Project.active.all()
    return [x.pid for x in query]