create scaffold with specified project name.
1580
def create_scaffold(project_name):
    
    if os.path.isdir(project_name):
        logger.log_warning(u"Folder {} exists, please specify a new folder name.".format(project_name))
        return

    logger.color_print("Start to create new project: {}".format(project_name), "GREEN")
    logger.color_print("CWD: {}\n".format(os.getcwd()), "BLUE")

    def create_path(path, ptype):
        if ptype == "folder":
            os.makedirs(path)
        elif ptype == "file":
            open(path, 'w').close()

        msg = "created {}: {}".format(ptype, path)
        logger.color_print(msg, "BLUE")

    path_list = [
        (project_name, "folder"),
        (os.path.join(project_name, "api"), "folder"),
        (os.path.join(project_name, "testcases"), "folder"),
        (os.path.join(project_name, "testsuites"), "folder"),
        (os.path.join(project_name, "reports"), "folder"),
        (os.path.join(project_name, "debugtalk.py"), "file"),
        (os.path.join(project_name, ".env"), "file")
    ]
    [create_path(p[0], p[1]) for p in path_list]

    # create .gitignore file
    ignore_file = os.path.join(project_name, ".gitignore")
    ignore_content = ".env\nreports/*"
    with open(ignore_file, "w") as f:
        f.write(ignore_content)
693787
function(name) {
        self.root = getPath('root');
        self.name = name;
        var err = false;

        if ( !isValidName() ) {
            console.error('[ '+name+' ] is not a valid project name. Please, try something else: [a-Z0-9].');
            process.exit(1)
        }

        // creating project file
        var file = new _(self.root + '/project.json');
        var exists = file.existsSync();
        if ( !exists ) {
            createProjectFile( file.toString() )
        } else {
            console.warn('a project already exists in this location: '+ file);
        }

        // creating package file
        file = new _(self.root + '/package.json');
        exists = file.existsSync();
        if ( !exists ) {
            createPackageFile( file.toString() )
        } else {
            console.warn('a package already exists in this location: '+ file);

            end()
        }

    }
69216
def init(project_name):
    

    project_obj = ProjectClient().get_by_name(project_name)

    if not project_obj:
        namespace, name = get_namespace_from_name(project_name)
        create_project_base_url = "{}/projects/create".format(floyd.floyd_web_host)
        create_project_url = "{}?name={}&namespace={}".format(create_project_base_url, name, namespace)
        floyd_logger.info(('Project name does not yet exist on floydhub.com. '
                          'Create your new project on floydhub.com:\n\t%s'),
                          create_project_base_url)
        webbrowser.open(create_project_url)

        name = click.prompt('Press ENTER to use project name "%s" or enter a different name' % project_name, default=project_name, show_default=False)

        project_name = name.strip() or project_name
        project_obj = ProjectClient().get_by_name(project_name)

        if not project_obj:
            raise FloydException('Project "%s" does not exist on floydhub.com. Ensure it exists before continuing.' % project_name)

    namespace, name = get_namespace_from_name(project_name)
    experiment_config = ExperimentConfig(name=name,
                                         namespace=namespace,
                                         family_id=project_obj.id)
    ExperimentConfigManager.set_config(experiment_config)
    FloydIgnoreManager.init()

    yaml_config = read_yaml_config()
    if not yaml_config:
        copyfile(os.path.join(os.path.dirname(__file__), 'default_floyd.yml'), 'floyd.yml')

    floyd_logger.info("Project \"%s\" initialized in current directory", project_name)
1111333
def create_project( name, description = nil)
      post_params = {
        :body => {name: name, description: description}.to_json,
        :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})
      }

      response = Logan::Client.post "/project_templates/#{@id}/projects.json", post_params
      Logan::Project.new response
    end
845210
def create_model_file
      dir = "/app/models/#{@scaffold_name}.rb"
      unless File.exists?(File.join(Dir.pwd,dir))
        File.join(Dir.pwd,dir)
        source = "#{@gem_path}/lib/modules/scaffold/model.rb"
        FileUtils.cp(source,File.join(Dir.pwd,dir))
        config_model
        @valid = true
        $stdout.puts "\e[1;32m \tcreate\e[0m\t#{dir}"
      else
        $stdout.puts "\e[1;31mError:\e[0m Model named #{@scaffold_name} already exists, aborting."
      end
    end
360768
def create_analysis(name, kernel, src_dir, scaffold_name):
    """"""

    # analysis folder
    folder = os.path.join(os.getcwd(), 'analyses', name)
    if not os.path.exists(folder):
        os.makedirs(folder)
    else:
        log.warning('Analysis folder {} already exists.'.format(folder))

    # copy all other files
    for f in os.listdir(src_dir):
        if f in ('__pycache__',) or \
           any(f.endswith(ending) for ending in ('.pyc',)):
            continue
        copy_scaffold_file(os.path.join(src_dir, f),
                           os.path.join(folder, f),
                           name, scaffold_name)
524895
def new(project, credentials=None):
        """"""
        user, oauth_access_token = parsecredentials(credentials)
        response = Project.create(project, user)
        if response is not None:
            return response
        msg = "Project " + project + " has been created for user " + user
        if oauth_access_token:
            extraloc = '?oauth_access_token=' + oauth_access_token
        else:
            extraloc = ''
        return flask.make_response(msg, 201, {'Location': getrooturl() + '/' + project + '/' + extraloc, 'Content-Type':'text/plain','Content-Length': len(msg),'Access-Control-Allow-Origin': settings.ALLOW_ORIGIN, 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE', 'Access-Control-Allow-Headers': 'Authorization'})
647954
def generate_folder_names(name, project):
    """"""

    out_data_dir = prms.Paths.outdatadir
    project_dir = os.path.join(out_data_dir, project)
    batch_dir = os.path.join(project_dir, name)
    raw_dir = os.path.join(batch_dir, "raw_data")
    return out_data_dir, project_dir, batch_dir, raw_dir
1349107
def _newproject(command, path, name, settings):
    
    key = None
    title = _get_project_title()
    template = _get_template(settings)

    # Init repo
    git = sh.git.bake(_cwd=path)
    puts(git.init())

    if template.get("url"):
        # Create submodule
        puts(git.submodule.add(template['url'], '_blueprint'))
        puts(git.submodule.update(*['--init']))

        # Create spreadsheet
        key = _create_spreadsheet(name, title, path, settings)

        # Copy html files
        puts(colored.green("\nCopying html files..."))
        files = glob.iglob(os.path.join(path, "_blueprint", "*.html"))
        for file in files:
            if os.path.isfile(file):
                dir, filename = os.path.split(file)
                if not filename.startswith("_") and not filename.startswith("."):
                    puts("Copying {0} to {1}".format(filename, path))
                    shutil.copy2(file, path)
        ignore = os.path.join(path, "_blueprint", ".gitignore")
        if os.path.isfile(ignore):
            shutil.copy2(ignore, path)
    else:
        empty_index_path = os.path.join(path, "index.html")
        open(empty_index_path, "w")

    # Create config file
    _copy_config_template(name, title, template, path, key, settings)

    # Commit
    puts(colored.green("\nInitial commit"))
    puts(git.add('.'))
    puts(git.commit(m='Created {0} from {1}'.format(name, template['name'])))

    _install_requirements(path)

    # Get site, run hook
    with ensure_project(command, args, path) as site:
        site.call_hook("newproject", site, git)

    # Messages
    puts("\nAll done! To preview your new project, type:\n")
    puts("{0} {1}".format(colored.green("tarbell switch"), colored.green(name)))
    puts("\nor\n")
    puts("{0}".format(colored.green("cd %s" % path)))
    puts("{0}".format(colored.green("tarbell serve\n")))

    puts("\nYou got this!\n")
39208
def create_sconstruct(self, project_dir='', sayyes=False):
        """"""

        project_dir = util.check_dir(project_dir)

        sconstruct_name = 'SConstruct'
        sconstruct_path = util.safe_join(project_dir, sconstruct_name)
        local_sconstruct_path = util.safe_join(
            util.get_folder('resources'), sconstruct_name)

        if isfile(sconstruct_path):
            # -- If sayyes, skip the question
            if sayyes:
                self._copy_sconstruct_file(sconstruct_name, sconstruct_path,
                                           local_sconstruct_path)
            else:
                click.secho(
                    'Warning: {} file already exists'.format(sconstruct_name),
                    fg='yellow')

                if click.confirm('Do you want to replace it?'):
                    self._copy_sconstruct_file(sconstruct_name,
                                               sconstruct_path,
                                               local_sconstruct_path)
                else:
                    click.secho('Abort!', fg='red')

        else:
            self._copy_sconstruct_file(sconstruct_name, sconstruct_path,
                                       local_sconstruct_path)
565758
def cli(ctx, board, scons, project_dir, sayyes):
    """"""

    if scons:
        Project().create_sconstruct(project_dir, sayyes)
    elif board:
        Project().create_ini(board, project_dir, sayyes)
    else:
        click.secho(ctx.get_help())
351358
def create_new(projectname):
    """"""
    git_url = "https://github.com/moluwole/Bast_skeleton"
    path = os.path.abspath('.') + "/" + projectname
    if not os.path.exists(path):
        os.makedirs(path)

    click.echo(Fore.GREEN + '    ___  ___   __________')
    click.echo(Fore.GREEN + '  / _ )/ _ | / __/_  __/')
    click.echo(Fore.GREEN + ' / _  / __ |_\ \  / /')
    click.echo(Fore.GREEN + '/____/_/ |_/___/ /_/')

    click.echo(Fore.GREEN + "Creating Project at %s.... " % path)
    click.echo(Fore.GREEN + "Pulling Project Skeleton from Repo")
    try:
        Repo.clone_from(git_url, path)

        click.echo(Fore.GREEN + "Setting up project")

        shutil.rmtree(path + "/.git")

        if not os.path.exists('/.env'):
            shutil.copy(path + '/.env.example', path + '/.env')

        env_file = path + "/.env"
        if not os.path.isfile(env_file):
            shutil.copy('.env.example', '.env')
        call(['panther', 'generate:key', path])

        click.echo(Fore.GREEN + "New Bast Project created at  %s " % path)
    except Exception as e:
        click.echo(Fore.RED + "An error occurred creating a new project. Try Again.\n Reason: {}".format(e))
81005
def init(project_name):
    """"""

    if not VALID_PROJECT_NAME.match(project_name):
        print("Invalid project name. It may only contain letters, numbers and underscores.", file=sys.stderr)
        return

    check_path(project_name, functools.partial(shutil.copytree, skeleton_path("plugin")))
    check_path("static", os.mkdir)
    check_path("templates", os.mkdir)
    check_path("config.py", functools.partial(config_maker, project_name))
493264
def create(self, project_name, template_name, substitutions):
        
        self.project_name = project_name
        self.template_name = template_name

        # create substitutions dictionary from user arguments
        # TODO: check what is given
        for subs in substitutions:
            current_sub = subs.split(',')
            current_key = current_sub[0].strip()
            current_val = current_sub[1].strip()
            self.substitutes_dict[current_key] = current_val

        self.term.print_info(u"Creating project '{0}' with template {1}"
            .format(self.term.text_in_color(project_name, TERM_PINK), template_name))

        self.make_directories()
        self.make_files()
        self.make_posthook()
903762
def create_instance(self, credentials, name, **kwargs):
        """"""
        op_name = create_instance(
            credentials, self.project, self.zone, name,
            machine_type=self.machine_type,
            disk_size_gb=self.disk_size_gb,
            **kwargs)
        
        return op_name
187134
function createProjectObject (projectPath, projectName) {
    var locations = {
        root: projectPath,
        pbxproj: path.join(projectPath, projectName + '.xcodeproj', 'project.pbxproj')
    };

    return projectFile.parse(locations);
}
1121875
public function createProjectSkel($projectName)
    {
        $rootDir = $this->config->get('phpalchemy.root_dir');
        $defAppIniFile = $rootDir . '/config/defaults.application.ini';

        if (! self::validateProjectName($projectName)) {
            throw new \Exception(
                "Error: Invalid project name!\nProject name can be contains only alphanumeric characteres."
            );
        }

        $newProjectDir = getcwd() . '/' . $projectName;

        if (! file_exists($defAppIniFile)) {
            throw new \Exception("FATAL ERROR: File: 'defaults.application.ini' is missing!");
        }

        $this->projectDir = $newProjectDir;
        $this->config->set('app.root_dir', $newProjectDir);

        // create main project dir
        self::createDir($newProjectDir);

        $this->config->load($this->homeDir . DS . 'config' . DS . 'defaults.application.ini');
        $this->config->load($this->projectDir . DS . 'application.ini');

        $appInitConf = $this->config->all();
        //print_r($appInitConf); die;

        // creating directories skel.
        foreach ($appInitConf as $key => $targetDir) {
            // process only directory path ini. conf.
            //if (strpos($key, '_dir') !== false) {
            if (preg_match('/^app\.[\w]+_dir/', $key, $m) && $key !== 'app.root_dir') {
                //echo $key.' -> '.$targetDir . PHP_EOL;
                self::createDir($targetDir);
            }
        }

        // defining vars
        $data = array();
        $data['appName'] = $projectName;
        $data['namespace'] = self::camelize($projectName);
        $data['framework_dir'] = $this->homeDir;

        // read project templates & others files
        $projectFiles = glob($rootDir . '/templates/project/*');

        foreach ($projectFiles as $file) {
            $targetFile = $this->projectDir.'/'.str_replace('|', DIRECTORY_SEPARATOR, basename($file));
            self::createDir(pathinfo($targetFile, PATHINFO_DIRNAME));

            if (substr($file, -4) === '.tpl') {
                $contents = file_get_contents($file);
                $targetFile = str_replace('.tpl', '', $targetFile);

                // replace data on template
                foreach ($data as $key => $value) {
                    $contents = str_replace('{'.$key.'}', $value, $contents);
                }

                // write the composed template to target file
                file_put_contents($targetFile, $contents);
            } else {
                // just we need to copy file
                copy($file, $targetFile);
            }
        }

        return $projectName;
    }