home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import cgi
- import cherrypy
-
- class FieldStorage(cgi.FieldStorage):
-
- def __init__(self, *args, **kwds):
-
- try:
- cgi.FieldStorage.__init__(self, *args, **kwds)
- except ValueError:
- ex = None
- if str(ex) == 'Maximum content length exceeded':
- raise cherrypy.HTTPError(status = 413)
- str(ex) == 'Maximum content length exceeded'
- raise ex
-
-
-
- def read_lines_to_eof(self):
- while None:
- line = self.fp.readline(65536)
- if not line:
- self.done = -1
- break
-
- continue
- return None
-
-
- def read_lines_to_outerboundary(self):
- next = '--' + self.outerboundary
- last = next + '--'
- delim = ''
- last_line_lfend = True
- while None:
- line = self.fp.readline(65536)
- if not line:
- self.done = -1
- break
-
- if line[:2] == '--' and last_line_lfend:
- strippedline = line.strip()
- if strippedline == next:
- break
-
- if strippedline == last:
- self.done = 1
- break
-
-
- odelim = delim
- if line[-2:] == '\r\n':
- delim = '\r\n'
- line = line[:-2]
- last_line_lfend = True
- elif line[-1] == '\n':
- delim = '\n'
- line = line[:-1]
- last_line_lfend = True
- else:
- delim = ''
- last_line_lfend = False
- continue
- return None
-
-
- def skip_lines(self):
- if not (self.outerboundary) or self.done:
- return None
- next = '--' + self.outerboundary
- last = next + '--'
- last_line_lfend = True
- while None:
- line = self.fp.readline(65536)
- if not line:
- self.done = -1
- break
-
- if line[:2] == '--' and last_line_lfend:
- strippedline = line.strip()
- if strippedline == next:
- break
-
- if strippedline == last:
- self.done = 1
- break
-
-
- if line.endswith('\n'):
- last_line_lfend = True
- continue
- last_line_lfend = False
- continue
- return None
-
-
-