Ejemplo n.º 1
0
Archivo: plugin.py Proyecto: h3/up
 def copy_template(self, src, dst, context={}):
     tpl = os.path.join(os.getcwd(), 'up/templates/', self.name, src)
     try:
         with open (tpl, 'r') as fd:
             tpl = template(fd.read(), context, stringio=True)
             return self.put(local_path=tpl, remote_path=dst, use_glob=False)
     except IOError:
         log.warning("Cannot load template: %s" % tpl)
Ejemplo n.º 2
0
Archivo: conf.py Proyecto: h3/up
 def interpolate_string(self, s, context=None):
     if not context:
         context = self.get_context()
     return template(s, context)