Pushes the rendered blueprint's template to S3.

        Verifies that the template doesn't already exist in S3 before
        pushing.

        Returns the URL to the template in S3.
183712
def s3_stack_push(self, blueprint, force=False):
        
        key_name = stack_template_key_name(blueprint)
        template_url = self.stack_template_url(blueprint)
        try:
            template_exists = self.s3_conn.head_object(
                Bucket=self.bucket_name, Key=key_name) is not None
        except botocore.exceptions.ClientError as e:
            if e.response['Error']['Code'] == '404':
                template_exists = False
            else:
                raise

        if template_exists and not force:
            logger.debug("Cloudformation template %s already exists.",
                         template_url)
            return template_url
        self.s3_conn.put_object(Bucket=self.bucket_name,
                                Key=key_name,
                                Body=blueprint.rendered,
                                ServerSideEncryption='AES256',
                                ACL='bucket-owner-full-control')
        logger.debug("Blueprint %s pushed to %s.", blueprint.name,
                     template_url)
        return template_url
1302210
def _copy_or_render_source(ext, f, output_dir, render_callback,
                           skip_copy=False):
    
    # Either render a template or copy the source
    dirname = os.path.dirname(f)
    filename = os.path.basename(f)
    for pattern, target, subsd in ext.template_regexps:
        if re.match(pattern, filename):
            tgt = os.path.join(dirname, re.sub(
                pattern, target, filename))
            rw = MetaReaderWriter('.metadata_subsd')
            try:
                prev_subsd = rw.get_from_metadata_file(output_dir, f)
            except (FileNotFoundError, KeyError):
                prev_subsd = None

            render_callback(
                get_abspath(f),
                os.path.join(output_dir, tgt),
                subsd,
                only_update=ext.only_update,
                prev_subsd=prev_subsd,
                create_dest_dirs=True,
                logger=ext.logger)
            rw.save_to_metadata_file(output_dir, f, subsd)
            return tgt
    else:
        if not skip_copy:
            copy(f,
                 os.path.join(output_dir,
                              os.path.dirname(f)),
                 only_update=ext.only_update,
                 dest_is_dir=True,
                 create_dest_dirs=True,
                 logger=ext.logger)
        return f
1228522
function(template, previous_template, index) {

		Firestorm.DOM.insertHTMLAfter(this._getEndElement(previous_template), template.render());
		template.broadcastInDOM();

		var previous_index = this._current_templates.indexOf(previous_template);
		if (Lava.schema.DEBUG && previous_index == -1) Lava.t();
		this._current_templates.splice(previous_index + 1, 0, template);

	}
1187809
def deploy_to_s3(self):
        
        self.tempdir = tempfile.mkdtemp('s3deploy')

        for keyname, absolute_path in self.find_file_paths():
            self.s3_upload(keyname, absolute_path)

        shutil.rmtree(self.tempdir, True)
        return True
532449
def load_template():
    
    cloudformation, found = load_cloudformation_template()
    if not found:
        print(colored.red('could not load cloudformation.py, bailing out...'))
        sys.exit(1)
    return cloudformation
599074
def render(self, url, template=None, expiration=0):
        
        template = template or self.default_template
        
        return render_to_string(template, self.get_context(url, expiration))
1201900
def init_blueprint(self, app):
        
        self.blueprint = Blueprint(
            self.name,
            self.name,
            template_folder=resource_filename("capitains_nautilus", "data/templates"),
            url_prefix=self.prefix
        )

        # Register routes
        for url, name, methods, extension_name in self.ROUTES:
            self.blueprint.add_url_rule(
                url,
                view_func=self.view(name, extension_name),
                endpoint=name[2:],
                methods=methods
            )

        app.register_blueprint(self.blueprint)
        return self.blueprint
1094692
function() {
        var options = this.options;

        return this.wrapper = this.render(options.wrapperTemplate)
            .addClass(Toolkit.buildTemplate(options.wrapperClass))
            .attr('id', this.id('wrapper'))
            .appendTo('body');
    }
491529
def template(*args, **kwargs):
    '''
    
    '''
    tpl = args[0] if args else None
    template_adapter = kwargs.pop('template_adapter', SimpleTemplate)
    if tpl not in TEMPLATES or DEBUG:
        settings = kwargs.pop('template_settings', {})
        lookup = kwargs.pop('template_lookup', TEMPLATE_PATH)
        if isinstance(tpl, template_adapter):
            TEMPLATES[tpl] = tpl
            if settings: TEMPLATES[tpl].prepare(**settings)
        elif "\n" in tpl or "{" in tpl or "%" in tpl or '$' in tpl:
            TEMPLATES[tpl] = template_adapter(source=tpl, lookup=lookup, **settings)
        else:
            TEMPLATES[tpl] = template_adapter(name=tpl, lookup=lookup, **settings)
    if not TEMPLATES[tpl]:
        abort(500, 'Template (%s) not found' % tpl)
    for dictarg in args[1:]: kwargs.update(dictarg)
    return TEMPLATES[tpl].render(kwargs)
915218
def getTemplate(self, copied_from, template_name=None,
                    template_folder=None, keep=False, encoding="UTF-8"):
        

        return self.templater.getTemplate(copied_from,
                                          template_name=template_name,
                                          template_folder=template_folder,
                                          keep=keep,
                                          encoding=encoding)
155817
def wf_link_template?(template)
      if template.is_a?(String) &&
         template.start_with?('http://', 'https://')
        return true
      end

      raise Wavefront::Exception::InvalidLinkTemplate
    end
100101
def _push_render(self):
        
        bokeh.io.push_notebook(handle=self.handle)
        self.last_update = time.time()
368646
def get_page_template(self, **kwargs):
        
        opts = self.object_list.model._meta
        return '{0}/{1}{2}{3}.html'.format(
            opts.app_label,
            opts.object_name.lower(),
            self.template_name_suffix,
            self.page_template_suffix,
        )
758578
def verify(template)
      unless template.kind_of?(Template)
        raise ArgumentError, 'you can only push Osheet::Template objs to the template set'
      end
      key = template_key(template)
      self[key.first] ||= {}
      self[key.first][key.last] ||= nil
      key
    end
800465
public String renderIfTemplateExists(String template, Object... args) {
        boolean typeInferenceEnabled = conf().typeInferenceEnabled();
        if (typeInferenceEnabled) {
            ParamTypeInferencer.registerParams(this, args);
        }

        if (nonExistsTemplates.contains(template)) return "";

        String key = template;
        if (typeInferenceEnabled) {
            key += ParamTypeInferencer.uuid();
        }

        try {
            TemplateClass tc = classes().getByTemplate(template);
            if (null == tc) {
                ITemplateResource rsrc = resourceManager().getResource(template);
                if (rsrc.isValid()) {
                    tc = new TemplateClass(rsrc, this);
                    //classes().add(key, tc);
                } else {
                    nonExistsTemplates.add(template);
                    if (isDevMode() && nonExistsTemplatesChecker == null) {
                        nonExistsTemplatesChecker = new NonExistsTemplatesChecker();
                    }
                    return "";
                }
            }
            ITemplate t = tc.asTemplate(this);
            setRenderArgs(t, args);
            return t.render();
        } finally {
            renderCleanUp();
        }
    }
1057239
def show
      if should_skip_to_first_child?
        redirect_to refinery.url_for(first_live_child.url), status: 301 and return
      elsif page.link_url.present?
        redirect_to page.link_url, status: 301 and return
      elsif should_redirect_to_friendly_url?
        redirect_to refinery.url_for(page.url), status: 301 and return
      end

      render_with_templates?
    end
111435
def render_404_template!(template_name)
      VIEW_TEMPLATE_ENGINES.each do |engine, extension|
        @preferred_extension = extension.to_s
        find_template(settings.views, template_name, engine) do |file|
          next unless File.file?(file)
          halt send(extension, template_name.to_sym, layout: false)
        end
      end
    end