Esempio n. 1
0
def get_template(orgName, envName, tplName):
    template_api = TemplateAPI()

    env = get_environment(orgName, envName)
    tpl = template_api.template_by_name(env["id"], tplName)
    if tpl == None:
        raise ApiDataError(_("Could not find template [ %(tplName)s ] within environment [ %(env_name)s ]") %
            {'tplName':tplName, 'env_name':env["name"]})
    return tpl
Esempio n. 2
0
 def get_template_id(cls, environmentId, templateName):
     if templateName != None:
         template_api = TemplateAPI()
         template = template_api.template_by_name(environmentId, templateName)
         if template == None:
             raise OptionException()
         else:
             return template['id']
     else:
         return None
Esempio n. 3
0
def get_template(orgName, envName, tplName):
    template_api = TemplateAPI()

    env = get_environment(orgName, envName)
    tpl = template_api.template_by_name(env["id"], tplName)
    if tpl == None:
        raise ApiDataError(
            _("Could not find template [ %s ] within environment [ %s ]") %
            (tplName, env["name"]))
    return tpl
Esempio n. 4
0
def get_template(orgName, envName, tplName):
    template_api = TemplateAPI()

    env = get_environment(orgName, envName)
    if env == None:
        return None

    tpl = template_api.template_by_name(env["id"], tplName)
    if tpl == None:
        print >> sys.stderr, _("Could not find template [ %s ] within environment [ %s ]") % (tplName, env["name"])
    return tpl
Esempio n. 5
0
 def get_template_id(self, environmentId, templateName):
     if templateName != None:
         template_api = TemplateAPI()
         template = template_api.template_by_name(environmentId,
                                                  templateName)
         if template == None:
             raise OptionException()
         else:
             return template['id']
     else:
         return None
Esempio n. 6
0
 def __init__(self):
     super(TemplateAction, self).__init__()
     self.api = TemplateAPI()