Esempio n. 1
0
File: plugin.py Progetto: 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)
Esempio n. 2
0
File: conf.py Progetto: h3/up
 def interpolate_string(self, s, context=None):
     if not context:
         context = self.get_context()
     return template(s, context)