home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_781 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  1.7 KB  |  41 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __license__ = 'GPL v3'
  5. __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
  6. import threading
  7. import Queue
  8.  
  9. class DeviceManager(object):
  10.     
  11.     def __init__(self):
  12.         self.devices = []
  13.         self.device_jobs = Queue(0)
  14.  
  15.  
  16.  
  17. class Job(object):
  18.     count = 0
  19.     
  20.     def __init__(self, func, args):
  21.         self.completed = False
  22.         self.exception = None
  23.  
  24.  
  25.  
  26. class Worker(threading.Thread):
  27.     
  28.     def __init__(self, jobs):
  29.         self.jobs = jobs
  30.         self.results = []
  31.         threading.Thread.__init__(self)
  32.         self.setDaemon(True)
  33.  
  34.     
  35.     def run(self):
  36.         while True:
  37.             self.jobs.get(True, None)
  38.             self.jobs.task_done()
  39.  
  40.  
  41.