Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(22)  |  Call(14)  |  Derive(0)  |  Import(8)

        def render_template(path, context):
    if not isinstance(context, Context):
        context = Context(context)
    with open(path) as template_file:
        template = Template(template_file.read())
    return template.render(context)
        


src/d/p/dploi-fabric-0.1.30/dploi_fabric/utils.py   dploi-fabric(Download)
from dploi_fabric.toolbox.template import app_package_path, render_template
import os
import posixpath
 
import StringIO
        gunicorn_cmd_context.update(common_cmd_context)
        gunicorn_command_template_path = self.sites[site]['supervisor']['gunicorn_command_template']
        gunicorn_command = render_template(gunicorn_command_template_path, gunicorn_cmd_context)
        process_dict["%s_%s_gunicorn" % (env_dict.get("user"), site)] = {
                    'command': gunicorn_command,
            celeryd_command_context.update(common_cmd_context)
            celeryd_command_template_path = self.sites[site]['supervisor']['celeryd_command_template']
            celeryd_command = render_template(celeryd_command_template_path, celeryd_command_context)
            process_dict["%s_%s_celeryd" % (env_dict.get("user"), site)] = {
                    'command': celeryd_command,
                celerycam_command_context.update(common_cmd_context)
                celerycam_command_template_path = self.sites[site]['supervisor']['celerycam_command_template']
                celerycam_command = render_template(celerycam_command_template_path, celerycam_command_context)
                process_dict["%s_%s_celerycam" % (env_dict.get("user"), site)] = {
                    'command': celerycam_command,

src/d/p/dploi-fabric-HEAD/dploi_fabric/utils.py   dploi-fabric(Download)
from dploi_fabric.toolbox.template import app_package_path, render_template
import os
import posixpath
 
import StringIO
        gunicorn_cmd_context.update(common_cmd_context)
        gunicorn_command_template_path = self.sites[site]['supervisor']['gunicorn_command_template']
        gunicorn_command = render_template(gunicorn_command_template_path, gunicorn_cmd_context)
        process_dict["%s_%s_gunicorn" % (env_dict.get("user"), site)] = {
                    'command': gunicorn_command,
            celeryd_command_context.update(common_cmd_context)
            celeryd_command_template_path = self.sites[site]['supervisor']['celeryd_command_template']
            celeryd_command = render_template(celeryd_command_template_path, celeryd_command_context)
            process_dict["%s_%s_celeryd" % (env_dict.get("user"), site)] = {
                    'command': celeryd_command,
                celerycam_command_context.update(common_cmd_context)
                celerycam_command_template_path = self.sites[site]['supervisor']['celerycam_command_template']
                celerycam_command = render_template(celerycam_command_template_path, celerycam_command_context)
                process_dict["%s_%s_celerycam" % (env_dict.get("user"), site)] = {
                    'command': celerycam_command,

src/d/p/dploi-fabric-0.1.30/dploi_fabric/supervisor.py   dploi-fabric(Download)
import StringIO
from copy import copy
from fabric.decorators import task
from fabric.api import run, put, env
from dploi_fabric.toolbox.template import render_template
                'stopwaitsecs': process_dict.get('stopwaitsecs', None),
            })
            output += render_template(template_path, context_dict)
            groups[group_name].append(process_name)
    output += render_template(group_template_path, {'groups': groups})

src/d/p/dploi-fabric-HEAD/dploi_fabric/supervisor.py   dploi-fabric(Download)
import StringIO
from copy import copy
from fabric.decorators import task
from fabric.api import run, put, env
from dploi_fabric.toolbox.template import render_template
                'stopwaitsecs': process_dict.get('stopwaitsecs', None),
            })
            output += render_template(template_path, context_dict)
            groups[group_name].append(process_name)
    output += render_template(group_template_path, {'groups': groups})

src/d/p/dploi-fabric-0.1.30/dploi_fabric/nginx.py   dploi-fabric(Download)
import StringIO
from fabric.decorators import task
from fabric.api import run, env, put
 
from dploi_fabric.toolbox.template import render_template
        })
        template_path = context_dict['nginx']['template']
        output += render_template(template_path, context_dict)
    path = posixpath.abspath(posixpath.join(env.path, '..', 'config', 'nginx.conf'))
    if dryrun:

src/d/p/dploi-fabric-HEAD/dploi_fabric/nginx.py   dploi-fabric(Download)
import StringIO
from fabric.decorators import task
from fabric.api import run, env, put
 
from dploi_fabric.toolbox.template import render_template
        })
        template_path = context_dict['nginx']['template']
        output += render_template(template_path, context_dict)
    path = posixpath.abspath(posixpath.join(env.path, '..', 'config', 'nginx.conf'))
    if dryrun:

src/d/p/dploi-fabric-0.1.30/dploi_fabric/redis.py   dploi-fabric(Download)
from fabric.api import run, env, put
 
from dploi_fabric.toolbox.template import render_template
from dploi_fabric.utils import config
 
            })
            path = posixpath.abspath(posixpath.join(site_config['deployment']['path'], '..', 'config', process_name + '.conf'))
            output = render_template(template_path, context_dict)
            if dryrun:
                print path + ":"

src/d/p/dploi-fabric-HEAD/dploi_fabric/redis.py   dploi-fabric(Download)
from fabric.api import run, env, put
 
from dploi_fabric.toolbox.template import render_template
from dploi_fabric.utils import config
 
            })
            path = posixpath.abspath(posixpath.join(site_config['deployment']['path'], '..', 'config', process_name + '.conf'))
            output = render_template(template_path, context_dict)
            if dryrun:
                print path + ":"