Install data_files in the /etc directory.
972299
def _create_data_files_directory(symlink=False):
        """"""
        current_directory = os.path.abspath(os.path.dirname(__file__))

        etc_kytos = os.path.join(BASE_ENV, ETC_KYTOS)

        if not os.path.exists(etc_kytos):
            os.makedirs(etc_kytos)

        src = os.path.join(current_directory, KYTOS_SKEL_PATH)
        dst = os.path.join(BASE_ENV, KYTOS_SKEL_PATH)

        if os.path.exists(dst):
            if not os.listdir(dst):
                # Path already exists but it's empty, so we'll populate it
                # We remove it first to avoid an exception from copytree
                os.rmdir(dst)
                shutil.copytree(src, dst)
        else:
            # It doesn't exist yet, so we should symlink or copy contents
            if symlink:
                os.symlink(src, dst)
            else:
                shutil.copytree(src, dst)
278857
def plugins(all, plugins_dir):
    ""
    app = Datasette([], plugins_dir=plugins_dir)
    click.echo(json.dumps(app.plugins(all), indent=4))
926885
protected function install()
    {
        // Version-specific.
        $this->maybeRunVsUpgrades();

        // Misc installers.
        $this->createDbTables();
        $this->otherInstallRoutines();
        $this->doFlushRewriteRules();
        $this->maybeEnqueueNotices();

        // History/options.
        $this->updateHistory();
        $this->updateOptions();
    }
835562
def build_dir():
    '''
    
    '''
    tag_arr = ['add', 'edit', 'view', 'list', 'infolist']
    path_arr = [os.path.join(CRUD_PATH, x) for x in tag_arr]
    for wpath in path_arr:
        if os.path.exists(wpath):
            continue
        os.makedirs(wpath)
137354
def _setup_directories(self):
        
        dirs = [self._data_dir]
        dirs += [os.path.join(self._data_dir, name) for name
                 in self.DATA_SUBDIRS]

        for path in dirs:
            if not os.path.isdir(path):
                try:
                    os.makedirs(path)  # recursive mkdir
                    os.chmod(path, 0755)  # rwxr-xr-x

                except OSError:
                    raise errors.DirectorySetupFail()

        return True
1216678
def install_file_legacy(path, sudo=False, from_path=None, **substitutions):
    '''
    '''
    # source paths 'from_custom' and 'from_common'
    from_path = from_path or path
    # remove beginning '/' (if any), eg '/foo/bar' -> 'foo/bar'
    from_tail = join('files', from_path.lstrip(os.sep))
    if from_path.startswith('~/'):
        from_tail = join('files', 'home', 'USERNAME',
                         from_path[2:])  # without beginning '~/'
    from_common = join(FABFILE_DATA_DIR, from_tail)
    from_custom = join(FABSETUP_CUSTOM_DIR, from_tail)

    # target path 'to_' (path or tempfile)
    for subst in ['SITENAME', 'USER', 'ADDON', 'TASK']:
        sitename = substitutions.get(subst, False)
        if sitename:
            path = path.replace(subst, sitename)
    to_ = path
    if sudo:
        to_ = join(os.sep, 'tmp', 'fabsetup_' + os.path.basename(path))
    path_dir = dirname(path)

    # copy file
    if isfile(from_custom):
        run(flo('mkdir -p  {path_dir}'))
        put(from_custom, to_)
    elif isfile(from_custom + '.template'):
        _install_file_from_template_legacy(from_custom + '.template', to_=to_,
                                    **substitutions)
    elif isfile(from_common):
        run(flo('mkdir -p  {path_dir}'))
        put(from_common, to_)
    else:
        _install_file_from_template_legacy(from_common + '.template', to_=to_,
                                    **substitutions)
    if sudo:
        run(flo('sudo mv --force  {to_}  {path}'))
1330394
def setup(self):
        """"""
        if not isinstance(self.filePath, str):
            raise TypeError("File path is not a string!")
        if self.controller is None:
            raise ValueError("Command controller hasn't been specified!")
1127559
def install(cls, type_, name, src, *args, **kwargs):
        """"""
        data = kwargs.pop('data', None)
        if data is None:
            data = {
                'addon': {
                    'type': type_,
                    'name': name,
                    'src': src,
                }
            }
        cls.create(data=data, *args, **kwargs)
693383
public function installViews()
    {
        $name = $this->getParsedNameInput();

        $path = '/resources/views/' . $name . '/';
        $views = __DIR__ . '/../stubs/views/';

        if ($this->option('lucid')) {
            $service = $this->getParsedServiceInput();

            $path = '/src/Services/' . studly_case($service) . '/resources/views/' . $name . '/';
            $views = ! $this->option('domain')
                ? __DIR__ . '/../stubs/Lucid/views/'
                : __DIR__ . '/../stubs/Lucid/domain-views/';
        }

        if($this->installFiles($path, $this->files->allFiles($views))) {
            $this->info('Copied: ' . $path);
        }
    }
724049
public function install()
    {
        $this->extractZip($this->downloadZip());

        rename($this->sparkPath(), $this->command->path.'/spark');

        (new Filesystem)->deleteDirectory(
            $this->command->path.'/spark-new'
        );
    }
1219343
def get_include_files():
    "
    plugin_data_files = []
    trust_stores_pem_path = path.join(root_path, 'sslyze', 'plugins', 'utils', 'trust_store', 'pem_files')
    for file in listdir(trust_stores_pem_path):
        file = path.join(trust_stores_pem_path, file)
        if path.isfile(file):  # skip directories
            filename = path.basename(file)
            plugin_data_files.append((file, path.join('pem_files', filename)))
    return plugin_data_files
1104419
private void addCurrentDirFiles(List<File> theFiles, List<File> theDirs, File currentDir) {
    File dirs[] = currentDir.listFiles(new FileFilter() {

      @Override
      public boolean accept(File file) {
        return file.isDirectory() && !file.getName().startsWith(".") && !file.getName().equals("META-INF");
      }
      
    });
    
    File htmlFiles[] = currentDir.listFiles(new FileFilter() {

      @Override
      public boolean accept(File file) {
        return !file.isDirectory() && file.isFile() && file.canRead() && !file.getName().startsWith(".") && (file.getName().endsWith(".html") || file.getName().endsWith(".htm"));
      }
      
    });
    
    if(dirs != null && dirs.length > 0) {
      theDirs.addAll(Arrays.asList(dirs));
    }
    if(htmlFiles != null && htmlFiles.length > 0) {
      theFiles.addAll(Arrays.asList(htmlFiles));
    }
  }
943405
public static function install()
    {
        static::updatePackages();
        static::updateBootstrapping();

        tap(new Filesystem, function ($filesystem) {
            $filesystem->deleteDirectory(resource_path('js/components'));
            $filesystem->delete(resource_path('sass/_variables.scss'));
            $filesystem->deleteDirectory(base_path('node_modules'));
            $filesystem->deleteDirectory(public_path('css'));
            $filesystem->deleteDirectory(public_path('js'));
        });
    }
444048
def install_file(source, dest, is_dir=false)
      if File.exists?(dest)
        print "#{dest} already exists. Overwrite it? (yes/no) "
        return unless ['y', 'yes', 'ok'].include? gets.chomp.downcase
      end
      is_dir ? FileUtils.cp_r(source, dest) : FileUtils.cp(source, dest)
      puts "installed #{dest}" unless ENV['RACK_ENV'] == 'test'
    end
782820
def dlls_in_dir(directory):
    """"""
    files = []
    files.extend(glob.glob(os.path.join(directory, '*.so')))
    files.extend(glob.glob(os.path.join(directory, '*.dll')))
    files.extend(glob.glob(os.path.join(directory, '*.dylib')))
    return files
1025831
def install():
    """"""
    ceph_dir = "/etc/ceph"
    if not os.path.exists(ceph_dir):
        os.mkdir(ceph_dir)

    apt_install('ceph-common', fatal=True)
1176937
def add(context, filenames):
    
    logging.info(_('Current Mode: Add Linux data'))
    context.obj['database'].add_data(filenames)
    sys.exit(0)