Set appropriate folder names.
348192
def generate_folder_names(self):
        """"""
        self.project_dir = os.path.join(prms.Paths.outdatadir, self.project)
        self.batch_dir = os.path.join(self.project_dir, self.name)
        self.raw_dir = os.path.join(self.batch_dir, "raw_data")
344699
def set_current_folder(self, folder):
        """"""
        index = self.fsmodel.setRootPath(folder)
        self.__last_folder = folder
        if self.show_cd_only:
            if self.__original_root_index is None:
                self.__original_root_index = self.rootIndex()
            self.setRootIndex(index)
        return index
535084
def ensure_dirs(filename):
    """"""
    dirname = os.path.dirname(filename)
    if dirname and not os.path.exists(dirname):
        os.makedirs(dirname)
922489
def config_dir_setup(filename):
    
    path = os.path.dirname(filename)
    if not os.path.isdir(path):
        Shell.mkdir(path)
789557
def prepare(self, configuration_folder, args_dict, environment):
        """"""
        self.configuration_folder = configuration_folder
        if not os.path.isdir(configuration_folder):
            raise BadOption("Specified configuration folder is not a directory!", wanted=configuration_folder)
        available = [os.path.join(configuration_folder, name) for name in os.listdir(configuration_folder)]
        available_environments = [os.path.basename(path) for path in available if os.path.isdir(path)]
        available_environments = [e for e in available_environments if not e.startswith('.')]

        # Make sure the environment exists
        if environment and environment not in available_environments:
            raise BadOption("Specified environment doesn't exist", available=available_environments, wanted=environment)

        if environment:
            environment_files = [os.path.join(configuration_folder, "accounts.yaml")]
            for root, dirs, files in os.walk(os.path.join(configuration_folder, environment)):
                environment_files.extend(os.path.join(root, filename) for filename in files)

            with tempfile.NamedTemporaryFile() as fle:
                contents = json.dumps({"includes": environment_files})
                fle.write(contents.encode('utf-8'))
                fle.flush()
                args_dict['aws_syncr']['environment'] = os.path.split(environment)[-1]
                super(Collector, self).prepare(fle.name, args_dict)
173055
def directory_files(path):
    """"""

    for entry in os.scandir(path):
        if not entry.name.startswith('.') and entry.is_file():
            yield entry.name
1327373
def bind_path_fallback(self, name, folder):
        """"""
        if not len(name) or name[0] != '/' or name[-1] != '/':
            raise ValueError(
                "name must start and end with '/': {0}".format(name))
        self._folder_masks.append((name, folder))
974990
def setup_dir(self):
        """"""
        cd = self.opts.cd or self.config['crony'].get('directory')
        if cd:
            self.logger.debug(f'Adding cd to {cd}')
            self.cmd = f'cd {cd} && {self.cmd}'
584842
def bind_path(self, name, folder):
        """"""
        if not len(name) or name[0] != '/' or name[-1] != '/':
            raise ValueError(
                "name must start and end with '/': {0}".format(name))
        self._folder_masks.insert(0, (name, folder))
656101
public function setFilename($filename)
    {
        if (is_array($filename) && isset($filename['name'])) {
            $this->filename = $filename['name'];
        } else {
            $this->filename = $filename;
        }
    }
357659
def setup_directories(base_dir, subdirs):
  """"""
  base_dir = os.path.expanduser(base_dir)
  tf.gfile.MakeDirs(base_dir)

  all_dirs = {}
  for subdir in subdirs:
    if isinstance(subdir, six.string_types):
      subdir_tuple = (subdir,)
    else:
      subdir_tuple = subdir
    dir_name = os.path.join(base_dir, *subdir_tuple)
    tf.gfile.MakeDirs(dir_name)
    all_dirs[subdir] = dir_name
  return all_dirs
404342
private function renamePathsForCreatedFiles(): void
    {
        foreach ($this->filesCreated as $key => $realPath) {
            $this->filesCreated[$key] = $this->pathHelper->renamePathBasenameSingularOrPlural(
                $realPath,
                $this->singularNamespacedName,
                $this->pluralNamespacedName
            );
        }
    }
721011
def _set_flag(self, flag):
        """"""
        self.folder._invalidate_cache()
        # TODO::: turn the flag off when it's already on
        def replacer(m):
            return "%s/%s.%s%s" % (
                joinpath(self.folder.base, self.folder.folder, "cur"),
                m.group("key"),
                m.group("hostname"),
                ":2,%s" % (
                    "%s%s" % (m.group("flags"), flag) if m.group("flags") \
                        else flag
                    )
                )
        newfilename = self.msgpathre.sub(replacer, self.filename)
        self.filesystem.rename(self.filename, newfilename)
        self.filename = newfilename
470131
def _update_dirs_on_base(self):
        ''''''
        if self._dirs['base'] != None:
            for d in self._predefined_dir_names:
                dstr = d
                #if d == "s2":
                #    dstr = '.'+d
                self._dirs[d] = os.path.join(self._dirs['base'], dstr)
477430
def set_folder(self, folder):
        
        self.folder = folder
        self.templates.directories[0] = folder
        self.app.root_path = folder
660537
def set_up_dirs(proc_name, output_dir=None, work_dir=None, log_dir=None):
    
    output_dir = safe_mkdir(adjust_path(output_dir or join(os.getcwd(), proc_name)), 'output_dir')
    debug('Saving results into ' + output_dir)

    work_dir = safe_mkdir(work_dir or join(output_dir, 'work'), 'working directory')
    info('Using work directory ' + work_dir)

    log_fpath = set_up_log(log_dir or safe_mkdir(join(work_dir, 'log')), proc_name + '.log')

    return output_dir, work_dir, log_fpath
305258
public void setLocation(final String fileNames) {
        List<String> list = new ArrayList<String>();
        list.add(fileNames);
        setLocations(list);
    }