Changeset 8215 for django/branches/gis/django/http
- Timestamp:
- 08/05/08 12:15:33 (4 months ago)
- Files:
-
- django/branches/gis (modified) (1 prop)
- django/branches/gis/django/http/__init__.py (modified) (3 diffs)
- django/branches/gis/django/http/multipartparser.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis
- Property svnmerge-integrated changed from /django/trunk:1-7978 to /django/trunk:1-8214
django/branches/gis/django/http/__init__.py
r7836 r8215 32 32 self.GET, self.POST, self.COOKIES, self.META, self.FILES = {}, {}, {}, {}, {} 33 33 self.path = '' 34 self.path_info = '' 34 35 self.method = None 35 36 … … 38 39 (pformat(self.GET), pformat(self.POST), pformat(self.COOKIES), 39 40 pformat(self.META)) 40 41 def __getitem__(self, key):42 for d in (self.POST, self.GET):43 if key in d:44 return d[key]45 raise KeyError, "%s not found in either POST or GET" % key46 47 def has_key(self, key):48 return key in self.GET or key in self.POST49 50 __contains__ = has_key51 41 52 42 def get_host(self): … … 443 433 else: 444 434 return s 435 django/branches/gis/django/http/multipartparser.py
r7918 r8215 5 5 file upload handlers for processing. 6 6 """ 7 7 8 import cgi 8 9 from django.conf import settings … … 13 14 from django.core.files.uploadhandler import StopUpload, SkipFile, StopFutureHandlers 14 15 15 __all__ = ('MultiPartParser', 'MultiPartParserError','InputStreamExhausted')16 __all__ = ('MultiPartParser', 'MultiPartParserError', 'InputStreamExhausted') 16 17 17 18 class MultiPartParserError(Exception): … … 163 164 elif item_type == FILE: 164 165 # This is a file, use the handler... 165 file_successful = True166 166 file_name = disposition.get('filename') 167 167 if not file_name: … … 210 210 211 211 except SkipFile, e: 212 file_successful = False213 212 # Just use up the rest of this file... 214 213 exhaust(field_stream) … … 516 515 end = index 517 516 next = index + len(self._boundary) 518 data_len = len(data) - 1519 517 # backup over CRLF 520 518 if data[max(0,end-1)] == '\n': … … 522 520 if data[max(0,end-1)] == '\r': 523 521 end -= 1 524 # skip over --CRLF525 #if data[min(data_len,next)] == '-':526 # next += 1527 #if data[min(data_len,next)] == '-':528 # next += 1529 #if data[min(data_len,next)] == '\r':530 # next += 1531 #if data[min(data_len,next)] == '\n':532 # next += 1533 522 return end, next 534 523
