示例#1
0
文件: dnstest.py 项目: lhl/songclub
 def handleAnswer( self, message ):
     printMessage( message )
     self.n = self.n + 1
     print "N =", self.n
     if self.n == 2:
         self.boss.stopReadingBoth()
         main.shutDown()
示例#2
0
 def handleAnswer(self, message):
     printMessage(message)
     self.n = self.n + 1
     print "N =", self.n
     if self.n == 2:
         self.boss.stopReadingBoth()
         main.shutDown()
示例#3
0
文件: dbtool.py 项目: burito/PyUI
    def tick(self):
        try:
            pyui.core.update()
            pyui.core.draw()
        except:
            #TODO: handle exceptions properly!
            print "Exception in pyui"
            raise
        
        main.addTimeout(self.tick, 0.001)
        
        if not getDesktop().running:
            main.shutDown()
            pyui.quit()

        now = time.time()
        if  now - self.last > 1:
            print "FPS:", self.frames
            self.frames = 0
            self.last = now
        self.frames = self.frames + 1
示例#4
0
文件: boatTest.py 项目: burito/PyUI
    # make sure we can be shut down on windows.
    main.addTimeout(tick, 0.5)

    # create the boat frame
    w = pyui.boat.BoatReflectorFrame(reflector, 0,0,790, 570)

    # run the main loop
    last = 0
    frame = 0
    try:
        while pyui.update():
            pyui.draw()
            main.iterate()
            frame += 1
            now = time.time()
            if now - last > 2:
                print "FPS: ", int(frame/2)
                frame=0
                last=now
    except:
        print "ERROR:"
        traceback.print_exc()

    # done. quit now.
    pyui.quit()
    reactor.stop()
    main.iterate()
    main.iterate()
    main.shutDown()
    print "done Twisted shutdown"
def gotNoObject(reason):
    print "no object:",reason
    main.shutDown()
def gotEcho(echo):
    print 'server echoed:',echo
    main.shutDown()
示例#7
0
def failure(error):
    print "Failure...",error
    main.shutDown()
示例#8
0
def success(message):
    print "Message received:",message
    main.shutDown()
示例#9
0
文件: simpledns.py 项目: lhl/songclub
def printFailure():
    print "error: could not resolve"
    main.shutDown()
示例#10
0
文件: simpledns.py 项目: lhl/songclub
def printAnswer(answer):
    print answer
    main.shutDown()
示例#11
0
def printFailure():
    print "error: could not resolve"
    main.shutDown()
示例#12
0
def printAnswer(answer):
    print answer
    main.shutDown()
示例#13
0
def failure(error):
    print "Failure...", error
    main.shutDown()
示例#14
0
def success(message):
    print "Message received:", message
    main.shutDown()