Build the media files.
972838
def build_media(self):
        
        logger.debug("Building media directory")
        if self.verbosity > 1:
            self.stdout.write("Building media directory")
        if os.path.exists(self.media_root) and settings.MEDIA_URL:
            target_dir = path.join(self.fs_name, self.build_dir, settings.MEDIA_URL.lstrip('/'))
            logger.debug("Copying {}{} to {}{}".format("osfs://", self.media_root, self.fs_name, target_dir))
            copy.copy_dir("osfs:///", smart_text(self.media_root), self.fs, smart_text(target_dir))
1150422
public function build()
    {
        $values = array( 'access'           => false,
                         'genres'           => false,
                         'publication_date' => false,
                         'title'            => true,
                         'keywords'         => true,
                         'stock_tickers'    => true
        );
        foreach ($values as $value => $isEscaped) {
            if ( ! is_null( $this->{$value} )) {
                $this->addChild( sprintf( 'news:%s', $value ), $this->{$value}, $isEscaped );
            }
        }
    }
274753
protected function buildData()
  {
    $handle = opendir($this->folderPath);
    while (false !== ($file = readdir($handle))) {
      $vext = str_replace(',', '|', strtolower($this->extensions));
      if (!is_dir($file) && $file != '.' && $file != '..' && ($this->extensions == '' || preg_match("/\.(" . $vext . ")$/", strtolower($file)))) {
        $this->files[] = $file;
      }
    }
  }
20479
public function build()
    {
        parent::build();

        $options = $this->suppliedOptions;

        $dataOptions        = $options['options'];
        $options['options'] = array();

        //iterate over the options to create the options assoc array
        foreach ($dataOptions as $val => $text) {
            $options['options'][] = array(
                'id'   => is_numeric($val) ? $text : $val,
                'text' => $text,
            );
        }

        $this->suppliedOptions = $options;
    }
71255
def build_package_data(self):
        """"""
        for package, src_dir, build_dir, filenames in self.data_files:
            for filename in filenames:
                target = os.path.join(build_dir, filename)
                self.mkpath(os.path.dirname(target))
                srcfile = os.path.join(src_dir, filename)
                outf, copied = self.copy_file(srcfile, target)
                srcfile = os.path.abspath(srcfile)
                if (copied and
                        srcfile in self.distribution.convert_2to3_doctests):
                    self.__doctests_2to3.append(outf)
695588
def build_mp(b, stage, source_name, force):
    """"""

    source = b.source(source_name)

    with b.progress.start('build_mp',stage,message="MP build", source=source) as ps:
        ps.add(message='Running source {}'.format(source.name), source=source, state='running')
        r = b.build_source(stage, source, ps, force)

    return r
625988
public function buildItemActions()
    {
        if ($this->request->get('_route') == 'KunstmaanMediaBundle_chooser_show_folder') {
            $this->addItemAction(new MediaSelectItemAction());
        } else {
            $this->addItemAction(new MediaEditItemAction());
            $this->addItemAction(new MediaDeleteItemAction($this->request->getRequestUri()));
        }
    }
287363
def finalize_media(app):
    """"""

    if (app.builder.name == 'readthedocssinglehtmllocalmedia' or
            app.builder.format != 'html' or
            not hasattr(app.builder, 'script_files')):
        return  # Use local media for downloadable files
    # Pull project data from conf.py if it exists
    context = app.builder.config.html_context
    STATIC_URL = context.get('STATIC_URL', DEFAULT_STATIC_URL)
    js_file = '{}javascript/readthedocs-doc-embed.js'.format(STATIC_URL)
    if sphinx.version_info < (1, 8):
        app.builder.script_files.append(js_file)
    else:
        app.add_js_file(js_file)
17823
protected function generateFiles()
    {
        foreach ($this->files as $key => $file) {
            $file = $this->formatContent($file);

            $this->makeFile($key, $file);
        }
    }
794868
public function build()
    {
        foreach ($this->action->getActionComponents() as $actionComponent) {
            if (!$actionComponent->isText()) {
                $this->buildComponent($actionComponent);
            }
        }
    }
593411
public function build()
    {
        $this->classMetadata->addExtension($this->getExtensionName(), [
            'softDeleteable' => true,
            'fieldName'      => $this->fieldName,
            'timeAware'      => $this->timeAware,
        ]);
    }
856931
def Build(self):
    """"""
    self.SetupVars()
    self.Clean()

    if not os.path.exists(args.grr_src):
      self.GitCheckoutGRR()
    proto_sdist = self.MakeProtoSdist()
    core_sdist = self.MakeCoreSdist()
    client_sdist = self.MakeClientSdist()
    client_builder_sdist = self.MakeClientBuilderSdist()

    self.InstallGRR(proto_sdist)
    self.InstallGRR(core_sdist)
    self.InstallGRR(client_sdist)
    self.InstallGRR(client_builder_sdist)
    self.BuildTemplates()
    if args.test_repack_install:
      self._RepackTemplates()
      self._InstallInstallers()
690536
public function build() {

        // If we have decided not to backup activities, prevent anything to be built
        if (!$this->get_setting_value('activities')) {
            $this->built = true;
            return;
        }

        // Add some extra settings that related processors are going to need
        $this->add_setting(new backup_activity_generic_setting(backup::VAR_MODID, base_setting::IS_INTEGER, $this->moduleid));
        $this->add_setting(new backup_activity_generic_setting(backup::VAR_COURSEID, base_setting::IS_INTEGER, $this->get_courseid()));
        $this->add_setting(new backup_activity_generic_setting(backup::VAR_SECTIONID, base_setting::IS_INTEGER, $this->sectionid));
        $this->add_setting(new backup_activity_generic_setting(backup::VAR_MODNAME, base_setting::IS_FILENAME, $this->modulename));
        $this->add_setting(new backup_activity_generic_setting(backup::VAR_ACTIVITYID, base_setting::IS_INTEGER, $this->activityid));
        $this->add_setting(new backup_activity_generic_setting(backup::VAR_CONTEXTID, base_setting::IS_INTEGER, $this->contextid));

        // Create the activity directory
        $this->add_step(new create_taskbasepath_directory('create_activity_directory'));

        // Generate the module.xml file, containing general information for the
        // activity and from its related course_modules record and availability
        $this->add_step(new backup_module_structure_step('module_info', 'module.xml'));

        // Annotate the groups used in already annotated groupings if groups are to be backed up.
        if ($this->get_setting_value('groups')) {
            $this->add_step(new backup_annotate_groups_from_groupings('annotate_groups'));
        }

        // Here we add all the common steps for any activity and, in the point of interest
        // we call to define_my_steps() is order to get the particular ones inserted in place.
        $this->define_my_steps();

        // Generate the roles file (optionally role assignments and always role overrides)
        $this->add_step(new backup_roles_structure_step('activity_roles', 'roles.xml'));

        // Generate the filter file (conditionally)
        if ($this->get_setting_value('filters')) {
            $this->add_step(new backup_filters_structure_step('activity_filters', 'filters.xml'));
        }

        // Generate the comments file (conditionally)
        if ($this->get_setting_value('comments')) {
            $this->add_step(new backup_comments_structure_step('activity_comments', 'comments.xml'));
        }

        // Generate the userscompletion file (conditionally)
        if ($this->get_setting_value('userscompletion')) {
            $this->add_step(new backup_userscompletion_structure_step('activity_userscompletion', 'completion.xml'));
        }

        // Generate the logs file (conditionally)
        if ($this->get_setting_value('logs')) {
            // Legacy logs.
            $this->add_step(new backup_activity_logs_structure_step('activity_logs', 'logs.xml'));
            // New log stores.
            $this->add_step(new backup_activity_logstores_structure_step('activity_logstores', 'logstores.xml'));
        }

        // Generate the calendar events file (conditionally)
        if ($this->get_setting_value('calendarevents')) {
            $this->add_step(new backup_calendarevents_structure_step('activity_calendar', 'calendar.xml'));
        }

        // Fetch all the activity grade items and put them to backup_ids
        $this->add_step(new backup_activity_grade_items_to_ids('fetch_activity_grade_items'));

        // Generate the grades file
        $this->add_step(new backup_activity_grades_structure_step('activity_grades', 'grades.xml'));

        // Generate the grading file (conditionally)
        $this->add_step(new backup_activity_grading_structure_step('activity_grading', 'grading.xml'));

        // Generate the grade history file. The setting 'grade_histories' is handled in the step.
        $this->add_step(new backup_activity_grade_history_structure_step('activity_grade_history', 'grade_history.xml'));

        // Generate the competency file.
        $this->add_step(new backup_activity_competencies_structure_step('activity_competencies', 'competencies.xml'));

        // Annotate the scales used in already annotated outcomes
        $this->add_step(new backup_annotate_scales_from_outcomes('annotate_scales'));

        // NOTE: Historical grade information is saved completely at course level only (see 1.9)
        // not per activity nor per selected activities (all or nothing).

        // Generate the inforef file (must be after ALL steps gathering annotations of ANY type)
        $this->add_step(new backup_inforef_structure_step('activity_inforef', 'inforef.xml'));

        // Migrate the already exported inforef entries to final ones
        $this->add_step(new move_inforef_annotations_to_final('migrate_inforef'));

        // At the end, mark it as built
        $this->built = true;
    }
1078563
def build(self):
        """"""
        for cmd in self.build_cmds:
            log.info('building command: {}'.format(cmd))
            full_cmd = 'cd {}; {}'.format(self.analyses_path, cmd)
            log.debug('full command: {}'.format(full_cmd))
            subprocess.call(full_cmd, shell=True)
            log.info('build done')
44230
def build(self):
        """"""
        if os.path.exists(self.build_path) and not os.path.isdir(self.build_path):
            self._logger.error('Output path must be a folder if it already exists')
            return
        Compiler._mkdir(self.build_path)
        self._execute_backend_on_spec()
885861
def build(self, **kwargs):
        """"""
        self.lexer = ply.lex.lex(object=self, **kwargs)
629596
def build(self, docs=None, filename=None):
        
        if docs:
            if hasattr(docs, 'items'):
                for (idx, doc) in sorted(getattr(docs, 'items')(),
                                         key=lambda x: x[0]):
                    self.fm.push_back(doc)
            else:
                for doc in filter(bool, docs):
                    self.fm.push_back(doc)
        self.fm.build()
        if filename:
            self.fm.write(filename)