Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/data_util/calcthread.py

    ra1b8fee r7432acb  
    44#  \brief Abstract class for defining calculation threads. 
    55# 
    6 from __future__ import print_function 
    76 
    87import thread 
     
    296295    """ 
    297296    def __init__(self, n=20000): 
    298         print(thread.get_ident()) 
     297        print thread.get_ident() 
    299298        self.starttime = clock() 
    300299        self.done = False 
     
    308307        self.work2.queue(n) 
    309308        self.work3.queue(n) 
    310         print("Expect updates from Main every second and from thread every 2.5 seconds") 
    311         print("") 
     309        print "Expect updates from Main every second and from thread every 2.5 seconds" 
     310        print "" 
    312311        self.work.ready(.5) 
    313312        while not self.done: 
    314313            sleep(1) 
    315             print("Main thread %d at %.2f" % (thread.get_ident(), 
    316                                               clock() - self.starttime)) 
     314            print "Main thread %d at %.2f" % (thread.get_ident(), 
     315                                              clock() - self.starttime) 
    317316 
    318317    def update(self, i=0): 
    319         print("Update i=%d from thread %d at %.2f" % (i, thread.get_ident(), 
    320                                                       clock() - self.starttime)) 
     318        print "Update i=%d from thread %d at %.2f" % (i, thread.get_ident(), 
     319                                                      clock() - self.starttime) 
    321320        self.work.ready(2.5) 
    322321 
    323322    def complete(self, total=0.0): 
    324         print("Complete total=%g from thread %d at %.2f" % (total, 
     323        print "Complete total=%g from thread %d at %.2f" % (total, 
    325324                                                    thread.get_ident(), 
    326                                                     clock() - self.starttime)) 
     325                                                    clock() - self.starttime) 
    327326        self.done = True 
Note: See TracChangeset for help on using the changeset viewer.