File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ install:
10
10
- python setup.py install
11
11
- pip install pyyaml
12
12
- pip install flask
13
+ - pip install six
13
14
before_script :
14
15
- mkdir prism
15
16
- mkdir prism/bin
Original file line number Diff line number Diff line change 2
2
import base64
3
3
import email
4
4
import mimetypes
5
+ from six import iteritems
5
6
from werkzeug .utils import secure_filename
6
7
7
8
@@ -47,7 +48,7 @@ def attachments(self):
47
48
48
49
def _get_attachments (self , request ):
49
50
attachments = []
50
- for _ , filestorage in request .files . iteritems ( ):
51
+ for _ , filestorage in iteritems ( request .files ):
51
52
attachment = {}
52
53
if filestorage .filename not in (None , 'fdopen' , '<fdopen>' ):
53
54
filename = secure_filename (filestorage .filename )
@@ -72,7 +73,7 @@ def _get_attachments_raw(self, raw_email):
72
73
filename = 'part-%03d%s' % (counter , ext )
73
74
counter += 1
74
75
attachment ['type' ] = part .get_content_type ()
75
- attachment ['filename ' ] = filename
76
+ attachment ['file_name ' ] = filename
76
77
attachment ['contents' ] = part .get_payload (decode = False )
77
78
attachments .append (attachment )
78
79
return attachments
You can’t perform that action at this time.
0 commit comments