0003-iparapheur-misc-remove-useless-import-and-variables.patch
passerelle/contrib/iparapheur/models.py | ||
---|---|---|
16 | 16 |
import base64 |
17 | 17 |
import json |
18 | 18 |
import magic |
19 |
from xml.sax._exceptions import SAXParseException |
|
20 | 19 | |
21 | 20 |
from django.db import models |
22 | 21 | |
23 |
from django.core.urlresolvers import reverse |
|
24 |
from django.db import models |
|
25 | 22 |
from django.utils.translation import ugettext_lazy as _ |
26 | 23 |
from django.http import HttpResponse, Http404 |
27 | 24 | |
... | ... | |
113 | 110 |
subtyp = data['subtype'] |
114 | 111 |
email = data.get('email') |
115 | 112 |
visibility = data['visibility'] |
116 |
content = data['data'] |
|
117 | 113 |
mime = magic.open(magic.MAGIC_MIME_TYPE) |
118 | 114 |
mime.load() |
119 | 115 |
content_type = data.get('content_type') if data.get('content_type') \ |
... | ... | |
146 | 142 |
if 'inconnu' in resp.MessageRetour.message: |
147 | 143 |
raise Http404(resp.MessageRetour.message) |
148 | 144 |
raise FileError(resp.MessageRetour.message) |
149 |
fichier_nom = resp.MetaDonnees.MetaDonnee[0]['valeur'] |
|
150 | 145 |
fichier = resp.DocumentsAnnexes.DocAnnexe[0].fichier |
151 | 146 |
return HttpResponse(base64.b64decode(fichier['value']), |
152 | 147 |
content_type=fichier['_contentType']) |
passerelle/contrib/iparapheur/soap.py | ||
---|---|---|
18 | 18 |
# and https://docs.oracle.com/cd/E50245_01/E50253/html/vmprg-soap-example-authentication-python.html |
19 | 19 | |
20 | 20 | |
21 |
import requests |
|
22 | 21 |
import StringIO |
23 | 22 | |
24 | 23 |
from suds.client import Client |
... | ... | |
26 | 25 |
from suds.transport import Reply, TransportError |
27 | 26 |
from suds.plugin import MessagePlugin, DocumentPlugin |
28 | 27 | |
29 |
from suds.sudsobject import asdict |
|
30 | ||
31 | 28 | |
32 | 29 |
class Filter(MessagePlugin): |
33 | 30 | |
34 |
- |