[Tutor] Restarting a module

Tino Dai tinoloc at gmail.com
Mon Jul 23 18:20:36 CEST 2007


Sorry about that. I think that a simpler question would be:

In my driver code:

  ap = apacheModule.apacheModule(configXML)
  while 1:
       try:
          rVs=ap.perf()
          for anObj in self.objList:
               getattr(anObj,"do")(rVs)
          time.sleep(1)
        except ArraryOutOfBoundsException:
          pass
       except Exception, e:
          sys.stdout.write(str(e) + "\n")
          sys.exit(1)


And in my apacheModule class:

         try:
                (totalAccess,totalTraffic)=(rVs[3][1],self.sizeConvert
(rVs[3][3],rVs[3][4]))

(userUsage,sysUsage,cuserUsage,csysUsage,cpuLoad)=(rVs[4][1],rVs[4][2],rVs[4][3],rVs[4][4],rVs[4][6])
                (requestsSec,bandwidth,perRequest)=(rVs[5][0],
self.sizeConvert(rVs[5][1],rVs[5][2]),self.sizeConvert(rVs[5][3],rVs[5][4]))
                (requestsProc,idle)=(rVs[6][0],rVs[6][1])
            except Exception,e:
                datetime.datetime.now()
                sys.stdout.write(str(e) + "\n")
                sys.stdout.write(rVs)

If the apacheModule comes raises an ArrayOutOfBound exception (don't
remember if that the real exception name), the exception will bubble up, and
the apacheDriver try-except will catch it, right?

Thanks,
Tino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070723/1d696191/attachment.html 


More information about the Tutor mailing list