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 @@
#
##############################################################################
__version__='$Revision: 1.68 $'[11:-2]
__version__='$Revision: 1.69 $'[11:-2]
import re, sys, os, urllib, time, random, cgi, codecs
from BaseRequest import BaseRequest
......@@ -477,9 +477,7 @@ class HTTPRequest(BaseRequest):
if flags&RECORD:
item=getattr(item,attr)
if flags&RECORDS:
item.reverse()
item = item[0]
item=getattr(item,attr)
item = getattr(item[-1], attr)
else:
raise
......@@ -495,9 +493,7 @@ class HTTPRequest(BaseRequest):
#Get the list and the last record
#in the list
reclist = mapping_object[key]
reclist.reverse()
x=reclist[0]
reclist.reverse()
x = reclist[-1]
if not hasattr(x,attr):
#If the attribute does not
#exist, setit
......@@ -880,8 +876,7 @@ class HTTPRequest(BaseRequest):
keys.update(self._lazies)
for key in self.environ.keys():
if (isCGI_NAME(key) or key[:5] == 'HTTP_') and \
(not hide_key(key)):
if (isCGI_NAME(key) or key[:5] == 'HTTP_') and (not hide_key(key)):
keys[key] = 1
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