예제 #1
0
    def mainBody(self):
        # This is running inside a while() loop remember.
        # Optimisation would be reassignment of self.mainBody when we skip through
        # the different phases of execution.
        if not self.gotRequest:
            if self.handleDataAquisition():
                return 1
        self.gotRequest = 1
        try:
            self.request = Kamaelia.Support.Data.requestLine.requestLine(
                self.requestLine)
        except Kamaelia.Support.Data.requestLine.BadRequest:
            br = sys.exc_info()[1]
            errinf = errorInformation(self, br)
            self.send(errinf, "signal")
            return 0

        assert self.debugger.note("MimeRequestComponent.mainBody", 5,
                                  self.request, "\n")
        assert self.debugger.note("MimeRequestComponent.mainBody", 10,
                                  "HEADER  \t:", self.header)
        assert self.debugger.note("MimeRequestComponent.mainBody", 10,
                                  "BODY    \t:", self.body)

        self.mimeRequest = mimeObject(self.header, self.body, self.request)
        assert self.debugger.note("MimeRequestComponent.mainBody", 5,
                                  self.mimeRequest)
        self.send(self.mimeRequest, "outbox")
 def mainBody(self):
    # This is running inside a while() loop remember.
    # Optimisation would be reassignment of self.mainBody when we skip through
    # the different phases of execution.
    if not self.gotRequest:
       if self.handleDataAquisition():
          return 1
    self.gotRequest = 1
    try:
       self.request = Kamaelia.Support.Data.requestLine.requestLine(self.requestLine)
    except Kamaelia.Support.Data.requestLine.BadRequest, br:
       errinf = errorInformation(self, br)
       self.send(errinf, "signal")
       return 0
예제 #3
0
   def mainBody(self):
      # This is running inside a while() loop remember.
      # Optimisation would be reassignment of self.mainBody when we skip through
      # the different phases of execution.
      if not self.gotRequest:
         if self.handleDataAquisition():
            return 1
      self.gotRequest = 1
      try:
         self.request = Kamaelia.Support.Data.requestLine.requestLine(self.requestLine)
      except Kamaelia.Support.Data.requestLine.BadRequest:
         br = sys.exc_info()[1]
         errinf = errorInformation(self, br)
         self.send(errinf, "signal")
         return 0

      assert self.debugger.note("MimeRequestComponent.mainBody",5, self.request,"\n")
      assert self.debugger.note("MimeRequestComponent.mainBody",10, "HEADER  \t:", self.header)
      assert self.debugger.note("MimeRequestComponent.mainBody",10, "BODY    \t:", self.body)

      self.mimeRequest = mimeObject(self.header, self.body, self.request)
      assert self.debugger.note("MimeRequestComponent.mainBody",5, self.mimeRequest)
      self.send(self.mimeRequest, "outbox")