Ejemplo n.º 1
0
 def _get_other_asset(self, asset, ext):
     """
     Return asset specifying the extension.
     :param asset:
     :param ext:
     :return:
     """
     header = Header('Content-Type', '%s/%s' % (TYPES.get(ext), ext))
     f = None
     if asset in self.__media:
         f = Settings.read_file(Settings.get('media')[asset])
     elif asset in self.__images:
         f = Settings.read_file(Settings.get('img')[asset])
     return header, f
Ejemplo n.º 2
0
 def set_content(self, value):
     if value in TYPES:
         value = '%s/%s' % (TYPES.get(value), value)
         self.req.build = False
     self.set_header('Content-Type', value)