Commit 40da6b54 authored by Martijn Pieters's avatar Martijn Pieters

Fix severe indentation problems, and also the funky way to get the last item

of a list (which is also a small performance hit).
parent caffc57c
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.68 $'[11:-2] __version__='$Revision: 1.69 $'[11:-2]
import re, sys, os, urllib, time, random, cgi, codecs import re, sys, os, urllib, time, random, cgi, codecs
from BaseRequest import BaseRequest from BaseRequest import BaseRequest
...@@ -477,9 +477,7 @@ class HTTPRequest(BaseRequest): ...@@ -477,9 +477,7 @@ class HTTPRequest(BaseRequest):
if flags&RECORD: if flags&RECORD:
item=getattr(item,attr) item=getattr(item,attr)
if flags&RECORDS: if flags&RECORDS:
item.reverse() item = getattr(item[-1], attr)
item = item[0]
item=getattr(item,attr)
else: else:
raise raise
...@@ -495,9 +493,7 @@ class HTTPRequest(BaseRequest): ...@@ -495,9 +493,7 @@ class HTTPRequest(BaseRequest):
#Get the list and the last record #Get the list and the last record
#in the list #in the list
reclist = mapping_object[key] reclist = mapping_object[key]
reclist.reverse() x = reclist[-1]
x=reclist[0]
reclist.reverse()
if not hasattr(x,attr): if not hasattr(x,attr):
#If the attribute does not #If the attribute does not
#exist, setit #exist, setit
...@@ -880,8 +876,7 @@ class HTTPRequest(BaseRequest): ...@@ -880,8 +876,7 @@ class HTTPRequest(BaseRequest):
keys.update(self._lazies) keys.update(self._lazies)
for key in self.environ.keys(): for key in self.environ.keys():
if (isCGI_NAME(key) or key[:5] == 'HTTP_') and \ if (isCGI_NAME(key) or key[:5] == 'HTTP_') and (not hide_key(key)):
(not hide_key(key)):
keys[key] = 1 keys[key] = 1
n=0 n=0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment