Ignore:
Timestamp:
05/01/12 10:58:30 (2 years ago)
Author:
wehart
Message:

Python 3.x portability fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyutilib.pyro/trunk/pyutilib/pyro/dispatcher.py

    r2636 r2831  
    2626        self.verbose = kwds.get("verbose", False) 
    2727        if self.verbose is True: 
    28            print "Verbose output enabled..." 
     28           print("Verbose output enabled...") 
    2929 
    3030    def shutdown(self): 
    31         print "Dispatcher received request to shut down - initiating..." 
     31        print("Dispatcher received request to shut down - initiating...") 
    3232        self.getDaemon().shutdown() 
    3333 
    3434    def add_task(self, task, type=None): 
    3535        if self.verbose is True: 
    36            print "Received request to add task="+str(task)+"; queue type="+str(type) 
     36           print("Received request to add task="+str(task)+"; queue type="+str(type)) 
    3737        if type is None: 
    3838            self.default_taskqueue.put(task) 
     
    4444    def get_task(self, type=None, timeout=5): 
    4545        if self.verbose is True: 
    46            print "Received request for a task from queue type="+str(type)+"; timeout="+str(timeout)+" seconds" 
     46           print("Received request for a task from queue type="+str(type)+"; timeout="+str(timeout)+" seconds") 
    4747        if type is None: 
    4848            return self.default_taskqueue.get(block=True, timeout=timeout) 
     
    5555    def add_result(self, data, type=None): 
    5656        if self.verbose is True: 
    57            print "Received request to add result with data="+str(data)+"; queue type="+str(type) 
     57           print("Received request to add result with data="+str(data)+"; queue type="+str(type)) 
    5858        if type is None: 
    5959            self.default_resultqueue.put(data) 
     
    6565    def get_result(self, type=None, timeout=5): 
    6666        if self.verbose is True: 
    67            print "Received request for result with queue type="+str(type)+"; timeout="+str(timeout) 
     67           print("Received request for result with queue type="+str(type)+"; timeout="+str(timeout)) 
    6868        if type is None: 
    6969            return self.default_resultqueue.get(block=True, timeout=timeout) 
     
    7676    def num_tasks(self, type=None): 
    7777        if self.verbose is True: 
    78            print "Received request for number of tasks in queue with type="+str(type) 
     78           print("Received request for number of tasks in queue with type="+str(type)) 
    7979        if type is None: 
    8080            return self.default_taskqueue.qsize() 
     
    8787    def num_results(self, type=None): 
    8888        if self.verbose is True: 
    89            print "Received request for number of results in queue with type="+str(type) 
     89           print("Received request for number of results in queue with type="+str(type)) 
    9090        if type is None: 
    9191            return self.default_resultqueue.qsize() 
     
    9898    def queues_with_results(self): 
    9999        if self.verbose is True: 
    100            print "Received request for the set of queues with results" 
     100           print("Received request for the set of queues with results") 
    101101        result = set() 
    102102        if self.default_resultqueue.qsize() > 0: 
     
    132132    uri=daemon.connect(Dispatcher(verbose=verbose),group+".dispatcher") 
    133133 
    134     print "Dispatcher is ready." 
     134    print("Dispatcher is ready.") 
    135135    daemon.requestLoop() 
Note: See TracChangeset for help on using the changeset viewer.