Did I find the right examples for you? yes no

All Samples(19)  |  Call(16)  |  Derive(0)  |  Import(3)

src/f/r/frame-0.3.1/frame/preprocessors.py   frame(Download)
from cgi import FieldStorage
import json
from multipart import MultipartParser
import re
 
 
		if match:
			mp = MultipartParser(request.wsgi.input, boundary=match.group(1))
			for i in mp:
				if i.filename:

src/w/e/weiyu-HEAD/weiyu/adapters/http/util.py   weiyu(Download)
        return None, None
 
    parser = multipart.MultipartParser(stream, boundary, length)
    form, files = {}, {}
    for part in parser:

src/p/y/python-multipart-0.0.2/multipart/__init__.py   python-multipart(Download)
from ._version import __version__
 
from .multipart import (
    FormParser,
    MultipartParser,

src/m/u/multipart-0.1/test/test_multipart.py   multipart(Download)
    def test_line_parser(self):
        for line in ('foo',''):
            for ending in ('\n','\r','\r\n'):
                i = mp.MultipartParser(BytesIO(tob(line+ending)), 'foo')
                i = i._lineiter().next()
        'Content-Disposition: form-data; name="file3"; filename="random.png"',
        'Content-Type: image/png', '', test_file*2, '--'+boundary+'--',''])))
        p = mp.MultipartParser(request, boundary, memfile_limit=len(test_file))
        self.assertEqual(p.get('file1').file.read(), tob(test_file))
        self.assertTrue(p.get('file1').is_buffered())
        'Content-Disposition: form-data; name="file1"; filename="random.png"',
        'Content-Type: image/png', '', 'def'*1024, '--' + boundary + '--',''])))
        p = mp.MultipartParser(request, boundary)
        self.assertEqual(p.get('file1').file.read(), tob('abc'*1024))
        self.assertEqual(p.get('file2'), None)
        'Content-Disposition: form-data; name="file1"; filename="random.png"',
        'Content-Type: image/png', '', test_file, '--' + boundary + '--',''])))
        p = mp.MultipartParser(request, boundary)
        self.assertEqual(p.get('file1').file.read(), tob(test_file))
        self.assertEqual(p.get('file1').value, test_file)
        'Content-Disposition: form-data; name="file1"; filename="random.png"',
        'Content-Type: image/png', '', test_file, '--' + boundary + '--',''])))
        p = mp.MultipartParser(request, boundary)
        self.assertEqual(p.get('file1').file.read(), tob(test_file))
        self.assertEqual(p.get('file1').value, test_file)

src/m/u/multipart-HEAD/test/test_multipart.py   multipart(Download)
    def test_line_parser(self):
        for line in ('foo',''):
            for ending in ('\n','\r','\r\n'):
                i = mp.MultipartParser(BytesIO(tob(line+ending)), 'foo')
                i = i._lineiter().next()
        'Content-Disposition: form-data; name="file3"; filename="random.png"',
        'Content-Type: image/png', '', test_file*2, '--'+boundary+'--',''])))
        p = mp.MultipartParser(request, boundary, memfile_limit=len(test_file))
        self.assertEqual(p.get('file1').file.read(), tob(test_file))
        self.assertTrue(p.get('file1').is_buffered())
        'Content-Disposition: form-data; name="file1"; filename="random.png"',
        'Content-Type: image/png', '', 'def'*1024, '--' + boundary + '--',''])))
        p = mp.MultipartParser(request, boundary)
        self.assertEqual(p.get('file1').file.read(), tob('abc'*1024))
        self.assertEqual(p.get('file2'), None)
        'Content-Disposition: form-data; name="file1"; filename="random.png"',
        'Content-Type: image/png', '', test_file, '--' + boundary + '--',''])))
        p = mp.MultipartParser(request, boundary)
        self.assertEqual(p.get('file1').file.read(), tob(test_file))
        self.assertEqual(p.get('file1').value, test_file)
        'Content-Disposition: form-data; name="file1"; filename="random.png"',
        'Content-Type: image/png', '', test_file, '--' + boundary + '--',''])))
        p = mp.MultipartParser(request, boundary)
        self.assertEqual(p.get('file1').file.read(), tob(test_file))
        self.assertEqual(p.get('file1').value, test_file)

src/c/i/circuits-3.0.0.dev/circuits/web/parsers/__init__.py   circuits(Download)
"""circuits.web parsers"""
 
from .multipart import MultipartParser
from .querystring import QueryStringParser
from .http import HttpParser, BAD_FIRST_LINE