コード例 #1
0
 def __call__(self, data):
     response = requests_post(self._api_url,
                              headers={'Content-Type': data['type']},
                              data=data['content'])
     response.raise_for_status()
     return {
         'filename': change_ext(data['filename'], None, '.xml'),
         'content': response.text,
         'type': response.headers['Content-Type']
     }
コード例 #2
0
 def __call__(self, data):
     return {
         'filename': change_ext(data['filename'], None, '.pdf'),
         'content': doc_to_pdf(data['content'], data['type']),
         'type': MimeTypes.PDF
     }
コード例 #3
0
 def __call__(self, data):
     return {
         'filename': change_ext(data['filename'], None, '.docx'),
         'content': doc_to_docx(data['content'], data['type']),
         'type': MimeTypes.DOCX
     }