def __init__(self, q, dbs):
     Process.__init__(self)
     self.subscribe = q[listenTo[0] + '_' + name]
     self.dbs = dbs
     dbConnector.connectToDB(self)
     self.openIssues = {}
     self.callbackQueue = Queue()
Beispiel #2
0
 def __init__(self, **kwargs):
     self.addressManager = OSC.CallbackManager()
     self.queue = Queue()
     Process.__init__(self, args=(self.queue,))
     self.daemon     = True
     self._isRunning = Value('b', True)
     self._haveSocket= Value('b', False)
 def __init__(self, func):
     Process.__init__(self)
     self.in_buffer = None
     self.out_buffer = None
     self.func = func
     # number of tokens popped from the input buffer each time
     self.n_args = len(inspect.getargspec(func).args)
Beispiel #4
0
    def __init__(self, alive_event, work_event, email, queue, index_queue,
                 passed, robots, unavailable_urls,
                 agent_name=DEFAULT_AGENT_NAME, headers=DEFAULT_HEADERS,
                 url_filter=lambda x: True):
        Process.__init__(self)
        self.alive_event = alive_event
        self.work_event = work_event
        self.email = email
        self.queue = queue
        self.index_queue = index_queue
        self.passed = passed
        self.robots = robots
        self.unavailable_urls = unavailable_urls
        self.agent_name = agent_name
        self.url_filter = url_filter
        self.is_working = False

        self.handler = request.build_opener(RobotHandler(agent_name, robots))
        handler_headers = [(k, v) for k, v in copy.copy(headers).items()]
        handler_headers.append(("User-Agent", agent_name))
        handler_headers.append(("From", email))
        self.handler.addheaders = handler_headers

        self.html_parser = HTMLParser(tree=treebuilders.getTreeBuilder("dom"))
        self.connection = None
Beispiel #5
0
 def __init__(self, _output_file,  header, _input_pipe, _disk_rows):
     Process.__init__(self)
 
     self.file_name = _output_file 
     self.input_pipe = _input_pipe
     self.write_rows = _disk_rows
     self.header = header
 def __init__(self, callback=None, log=True, log_level="DEBUG"):
     """ Initialize the data parser, connect to the can bus. """
     Process.__init__(self)
     self.callback = callback
     self.log = log
     self.log_level = log_level
     self.data = {}
Beispiel #7
0
 def __init__(self, dt=1):
     import psutil
     Process.__init__(self)
     self.daemon = True
     self.dt = dt
     self.parent = psutil.Process(current_process().pid)
     self.parent_conn, self.child_conn = Pipe()
    def __init__(self, response_queue, backup_name, host_port, user, password, authdb, base_dir, binary,
                 dump_gzip=False, verbose=False):
        Process.__init__(self)
        self.host, port     = host_port.split(":")
        self.host_port      = host_port
        self.port           = int(port)
        self.response_queue = response_queue
        self.backup_name    = backup_name
        self.user           = user
        self.password       = password
        self.authdb         = authdb
        self.base_dir       = base_dir
        self.binary         = binary
        self.dump_gzip      = dump_gzip
        self.verbose        = verbose

        self._command   = None
        self.completed  = False 
        self.backup_dir = "%s/%s" % (self.base_dir, self.backup_name)
        self.dump_dir   = "%s/dump" % self.backup_dir
        self.oplog_file = "%s/oplog.bson" % self.dump_dir
        self.start_time = time()

        signal(SIGINT, self.close)
        signal(SIGTERM, self.close)
Beispiel #9
0
 def __init__(self, worker, outlist, index):
     Process.__init__(self)
     self.worker = worker
     if worker is None or worker.element is None:
         raise MultiProjectException("Bug: Invalid Worker")
     self.outlist = outlist
     self.index = index
Beispiel #10
0
 def __init__(self, uid=None, gid=None, group=None, target=None, name=None, args=(), kwargs={}):
     Process.__init__(self, group, target, name, args, kwargs)
     self.uid = uid
     self.gid = gid
     self.target = target
     self.args = args
     OwnedProcess.add(self)
 def __init__(self, procnum, data, row_flags, x_coords, *args, **kwds):
     """A helper process for generating the Mandelbrot set."""
     Process.__init__(self, *args, **kwds)
     self.offset = procnum
     self.data = data
     self.row_flags = row_flags
     self.x_coords = x_coords
 def __init__(self, schema, dir, postingqueue, resultqueue, limitmb):
     Process.__init__(self)
     self.schema = schema
     self.dir = dir
     self.postingqueue = postingqueue
     self.resultqueue = resultqueue
     self.limitmb = limitmb
 def __init__(self, input_queue, output_path, time_queue, temp_overlay_file=None):
     self.input_queue = input_queue
     self.time_queue = time_queue
     self.output_path = output_path
     self.decompressor = LZMADecompressor()
     self.temp_overlay_file = temp_overlay_file
     Process.__init__(self, target=self.decompress_blobs)
Beispiel #14
0
 def __init__(self, cmd, data_out):
     Process.__init__(self)
     self.cmd = cmd
     self.data_out = data_out
     self.dt_des =1/200.0
     self.airprobe = airprobe_main(self.dt_des)
     self.cycles = 0
 def __init__(self, sequence_queue, fade_engine):
     Process.__init__(self)
     self.__sequence_queue = sequence_queue
     self.__engine = fade_engine
     self.__current_sequence = None
     self.__black = rgb_light_color(0, 0, 0)
     self.__keepRunning = True
Beispiel #16
0
  def __init__(self,inp,output=False,logger=None):
    """
    ***TESTING for splitting up jobs further on the compute cluster***
    ***NOT ACTIVE***
    #The minimum input
    {'input':{'data':self.datafile,'pdb':self.input_pdb,'sg':self.sg,}
     'output','logger}
    """
    logger.info('RunPhaser.__init__')
    self.input                              = inp
    self.output                             = output
    self.logger                             = logger
    #setup params
    self.run_before                         = self.input.get('run_before',False)
    self.verbose                            = self.input.get('verbose',False)
    self.copy                               = self.input.get('copy',1)
    self.res                                = self.input.get('res',False)
    self.test                               = self.input.get('test',False)
    self.cluster_use                        = self.input.get('cluster',True)
    self.datafile                           = self.input.get('data')
    self.input_pdb                          = self.input.get('pdb')
    self.sg                                 = self.input.get('sg')
    self.ca                                 = self.input.get('cell analysis',False)
    #self.mwaa                               = self.input.get('mwaa',False)
    #self.mwna                               = self.input.get('mwna',False)
    self.n                                  = self.input.get('name',self.sg)
    self.large_cell                         = self.input.get('large',False)

    Process.__init__(self,name='RunPhaser2')
    self.start()
Beispiel #17
0
 def __init__(self, priority_queue_in, queue_in, queue_out, available_commands, shared_settings):
     Process.__init__(self)
     self.priority_queue_in = priority_queue_in
     self.queue_in = queue_in
     self.queue_out = queue_out
     self.available_commands = available_commands
     self.shared_settings = shared_settings
 def __init__(self, pathq, outputq, process_dump, callback=lambda: None, logger=logger):
     self.pathq = pathq
     self.outputq = outputq
     self.process_dump = process_dump
     self.callback = callback
     self.logger = logger
     Process.__init__(self)
Beispiel #19
0
    def __init__(self, inp, output=False, logger=None):
        """
        #The minimum input
        {"input":{"data":self.datafile,"pdb":self.input_pdb,"sg":self.sg,}
         "output","logger}
        """
        logger.info("RunPhaser.__init__")
        self.input = inp
        self.output = output
        self.logger = logger
        # setup params
        self.run_before = self.input.get("run_before", False)
        self.verbose = self.input.get("verbose", False)
        self.copy = self.input.get("copy", 1)
        self.res = self.input.get("res", False)
        self.test = self.input.get("test", False)
        self.cluster_use = self.input.get("cluster", True)
        self.datafile = self.input.get("data")
        self.input_pdb = self.input.get("pdb")
        self.sg = self.input.get("sg")
        self.ca = self.input.get("cell analysis", False)
        #self.mwaa = self.input.get("mwaa", False)
        #self.mwna = self.input.get("mwna", False)
        self.n = self.input.get("name", self.sg)
        self.large_cell = self.input.get("large", False)

        Process.__init__(self, name="RunPhaser")
        self.start()
Beispiel #20
0
 def __init__(self, nombre, diccL, intento, master):
     Process.__init__(self)
     self.nombre = nombre
     self.diccL = diccL
     self.intento = intento
     self.master = master
     self.lockM = self.master.lockM
Beispiel #21
0
 def __init__(self, openoffice, interval, limit_memory_usage):
   """Expects to receive an object that implements the interfaces IApplication
   and ILockable, the limit of memory usage that the openoffice can use and
   the interval to check the object."""
   Monitor.__init__(self, openoffice, interval)
   Process.__init__(self)
   self.limit = limit_memory_usage
Beispiel #22
0
 def __init__(self, qi, qo, server_ips):
     Process.__init__(self)
     self.qi = qi
     self.qo = qo
     self.server_ips = server_ips
     self.logics = set()
     self.remcon = set()
Beispiel #23
0
 def __init__(self, send_queue, recv_queue, port=9999):
     Process.__init__(self)
     self.send_queue = send_queue
     self.recv_queue = recv_queue
     self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     self.socket.bind(("", port))
     self.socket.listen(1)
    def __init__(self, settings, callback_queue, mount_devices, grub_device, fs_devices, ssd=None, alternate_package_list=""):
        Process.__init__(self)
        
        self.alternate_package_list = alternate_package_list
        
        self.callback_queue = callback_queue
        self.settings = settings
        
        self.method = self.settings.get('partition_mode')
        
        self.queue_event('info', _("Installing using the '%s' method") % self.method)
        
        self.ssd = ssd
        self.mount_devices = mount_devices
        self.grub_device = grub_device

        # Check desktop selected to load packages needed
        self.desktop = self.settings.get('desktop')
        self.desktop_manager = 'gdm'
        self.network_manager = 'NetworkManager'
        self.card = []
        # Packages to be removed
        self.conflicts = []

        self.fs_devices = fs_devices

        self.running = True
        self.error = False
Beispiel #25
0
 def __init__(self, proj, stat, idQueue, status, genotypes):
     '''Use sql to process sample passed from queue, set results in status'''
     self.proj = proj
     # query, where, idx
     self.stat = []
     for field, item in stat:
         if item == '#(GT)':
             self.stat.append(('count(*)', None))
         elif item == '#(alt)':
             self.stat.append(('sum(abs(GT))', None))
         elif item == '#(hom)':
             self.stat.append(('count(*)', 'GT=2'))
         elif item == '#(het)':
             self.stat.append(('count(*)', 'GT=1'))
         elif item == '#(other)':
             self.stat.append(('count(*)', 'GT=-1'))
         elif item == '#(wtGT)':
             self.stat.append(('count(*)', 'GT=0'))
         elif item == '#(mutGT)':
             self.stat.append(('count(*)', 'GT!=0'))
         elif item.startswith('#'):
             raise ValueError('{} is not a valid special function (only #(GT), #(wtGT), #(mutGT), #(alt), #(hom), #(het), and #(other) are allowed).'.format(item))
         else:
             self.stat.append((item, None))
     self.queue = idQueue
     self.status = status
     self.genotypes = genotypes
    
     # threading.Thread.__init__(self, name='Calculate genotype statistics')
     Process.__init__(self, name='Calculate genotype statistics')
Beispiel #26
0
    def __init__(self, task_queue, results_queue, individuals):
        """
        Initialize the VariantAnnotator
        
        Consume variant batches from the task queue, annotate them with the 
        genetic inheritance patterns that they follow and put them in the 
        results queue.
        
        Arguments:
            task_queue (Queue)
            results_queue (Queue)
            individuals (list)
        """
        Process.__init__(self)
        
        self.proc_name = self.name
        
        logger.info("Setting up variant_annotator: {0}".format(
            self.proc_name))
        
        logger.debug("Setting up task queue")
        self.task_queue = task_queue
        
        logger.debug("Setting up results queue")
        self.results_queue = results_queue

        logger.debug("Setting up individuals")
        self.individuals = individuals
        
        if len(self.individuals) == 1:
            self.models = ['AR_comp', 'AR_comp_dn', 'AD', 'AD_dn']
        else:
            self.models = ['AR_comp', 'AR_comp_dn']
Beispiel #27
0
 def __init__(self, id, GPR, crawlers_queue):
     Process.__init__(self)
     self.id = id
     self.GPR = GPR
     # Making a queue only contains 1 element.
     self.__queue = Queue(1)
     self.__crawlers_queue = crawlers_queue
Beispiel #28
0
    def __init__(self,
            name,
            files,
            output_queue,
            logging_queue,
            gridmode=False,
            metadata=None,
            profile=False,
            nice=0,
            **kwargs):

        Process.__init__(self)
        self.uuid = uuid.uuid4().hex
        self.filters = {}
        self.name = name
        self.files = files
        self.metadata = metadata
        self.logging_queue = logging_queue
        self.output_queue = output_queue
        self.output = None
        self.gridmode = gridmode
        self.nice = nice
        self.kwargs = kwargs
        self.output = None
        self.queuemode = isinstance(files, multiprocessing.queues.Queue)
        self.profile = profile
Beispiel #29
0
 def __init__(self,connection,size,type_,title,fit):
     """
     **SUMMARY**
     
     Creates a new process to handle the gtk mainloop for a display.
     
     **PARAMETERS**
     
     * *connection* - The connection used to communicate with parent
      
     * *size* - Initial size of display.
     
     * *type_* - The type of dispay.
     
     * *fit* - the fitting methods of the display.
     
     """
     #TODO , the doc references
     Process.__init__(self)
     self.connection = connection
     self.size = size
     self.fit = fit
     self.title = title
     self.type_ = type_
     self.daemon = True
Beispiel #30
0
 def __init__(self, job, update_heartbeat=True, *args, **kwargs):
     self.job = job
     Process.__init__(self, *args, **kwargs)
     
     # Don't let this process hold up the parent.
     self.daemon = True
     self.update_heartbeat = update_heartbeat
Beispiel #31
0
 def __init__(self, gpuid, queue):
     Process.__init__(self, name='ModelProcessor')
     self._gpuid = gpuid
     self._queue = queue
 def __init__(self, *args):
     Process.__init__(self)
     self.daemon = True
     super(ResultCollectorProcess,self).__init__(*args)
Beispiel #33
0
 def __init__(self, gpuid, queue):
     Process.__init__(self,
                      name='ModelProcessor')  # inheritance from Process
     self._gpuid = gpuid  #assigined gpu id for this thread
     self._queue = queue
Beispiel #34
0
 def __init__(self, options, resultsQueue):
     Process.__init__(self)
     self.daemon = True
     self.options = options
     self._resultsQueue = resultsQueue
Beispiel #35
0
 def __init__(self, start, queue):  # сохраняет данные для
     self.state = start  # использования в методе run
     self.post = queue
     Process.__init__(self)
Beispiel #36
0
 def __init__(self, blobs_queue, repo_path, output_dir):
     Process.__init__(self)
     self.blobs_queue = blobs_queue
     self.output_dir = output_dir
     self.repo_path = repo_path
Beispiel #37
0
 def __init__(self, connec, *args, **kwargs):
     self.connec = connec
     Process.__init__(self, *args, **kwargs)
Beispiel #38
0
 def __init__(self, queue, rezqueue):
     Process.__init__(self)
     self.queue = queue
     self.rezqueue = rezqueue
Beispiel #39
0
 def __init__(self,controlq,statusq,qs):
     Process.__init__(self)
     self.controlq = controlq
     self.statusq = statusq
     self.qs = qs
     self.exception_raised = False
Beispiel #40
0
 def __init__(self, rezqueue):
     Process.__init__(self)
     self.rezqueue = rezqueue
    def __init__(self, uri, archivo, tipo):

        gobject.GObject.__init__(self)
        Process.__init__(self)

        self.tipo = tipo

        if not archivo.endswith(".ogg"):
            archivo = "%s%s" % (archivo, ".ogg")

        self.patharchivo = archivo
        self.actualizador = False
        self.estado = None
        self.control = 0
        self.tamanio = 0
        self.uri = ""

        self.pipeline = None
        self.player = None
        self.archivo = None
        self.bus = None

        self.pipeline = gst.Pipeline()

        self.player = gst.element_factory_make("uridecodebin", "uridecodebin")
        self.player.set_property("buffer-size", 40000)
        self.player.set_property("download", True)

        self.pipeline.add(self.player)

        # AUDIO
        audioconvert = gst.element_factory_make('audioconvert', 'audioconvert')
        audioresample = gst.element_factory_make(
            'audioresample', 'audioresample')
        audioresample.set_property('quality', 10)
        vorbisenc = gst.element_factory_make('vorbisenc', 'vorbisenc')

        self.pipeline.add(audioconvert)
        self.pipeline.add(audioresample)
        self.pipeline.add(vorbisenc)

        audioconvert.link(audioresample)
        audioresample.link(vorbisenc)

        self.audio_sink = audioconvert.get_static_pad('sink')

        # VIDEO
        videoconvert = gst.element_factory_make(
            'ffmpegcolorspace', 'videoconvert')
        videorate = gst.element_factory_make('videorate', 'videorate')

        try:
            videorate.set_property('max-rate', 30)
        except:
            pass

        theoraenc = gst.element_factory_make('theoraenc', 'theoraenc')

        if self.tipo == "video":
            self.pipeline.add(videoconvert)
            self.pipeline.add(videorate)
            self.pipeline.add(theoraenc)

            videoconvert.link(videorate)
            videorate.link(theoraenc)

        self.video_sink = videoconvert.get_static_pad('sink')

        # MUXOR y ARCHIVO
        oggmux = gst.element_factory_make('oggmux', "oggmux")
        self.archivo = gst.element_factory_make('filesink', "filesink")

        self.pipeline.add(oggmux)
        self.pipeline.add(self.archivo)

        vorbisenc.link(oggmux)

        if self.tipo == "video":
            theoraenc.link(oggmux)

        oggmux.link(self.archivo)

        self.bus = self.pipeline.get_bus()
        self.bus.add_signal_watch()
        self.bus.connect('message', self.__on_mensaje)
        self.bus.enable_sync_message_emission()
        self.bus.connect('sync-message', self.__sync_message)

        self.player.connect('pad-added', self.__pad_added)

        self.load(uri)
Beispiel #42
0
 def __init__(self, *args, **kwargs):
     Process.__init__(self, *args, **kwargs)
     self._receive_pipe, self._send_pipe = Pipe()
     self._exception = None
     self.called_function = kwargs.get('target')
 def __init__(self, driver):
     Process.__init__(self)
     self.name = driver.__class__.__name__
     self.driver = driver
Beispiel #44
0
 def __init__(self,qin,qout):
     Process.__init__(self)
     self.qin = qin
     self.qout = qout
	def __init__(self, paths, queue):
		self.paths = paths
		self.post = queue
		Process.__init__(self)
 def __init__(self):
     Process.__init__(self)
Beispiel #47
0
 def __init__(self, voiceFilePath):
     Process.__init__(self)
     self.voiceFilePath = voiceFilePath
	def __init__(self, outfilename, queue):
		self.out = outfilename
		self.post = queue
		Process.__init__(self)
 def __init__(self, conf_file_path, queue: Queue):
     Process.__init__(self)
     logging.config.fileConfig(conf_file_path)
     self.queue = queue
 def __init__(self, sid, kanming, i, dic):
     Process.__init__(self)
     self.row = i
     self.sid = sid
     self.kanming = kanming
     self.dic = dic
 def __init__(self, a, b, count1):
     Process.__init__(self)
     self.a = a
     self.b = b
     self.count1 = count1
Beispiel #52
0
    def __init__(self, port, results):
        #initialize the process
        Process.__init__(self)

        self.port = port
        self.results = results
Beispiel #53
0
 def __init__(self, processId, name, q):
     Process.__init__(self)
     self.processId = processId
     self.name = name
     self.q = q
Beispiel #54
0
 def __init__(self, interval, name=''):
     Process.__init__(self)
     self.interval = interval
     if name:
         self.name = name
Beispiel #55
0
 def __init__(self, pipe):
     Process.__init__(self)
     self.pipe = pipe
Beispiel #56
0
 def __init__(self, folderList=[], delay=3000, lock=Lock()):
     self.folderList = set(folderList)
     self.delay = delay
     self.lock = lock
     self.prevSet = set()
     Process.__init__(self)
Beispiel #57
0
 def __init__(self, queue):
     self.queue = queue
     Process.__init__(self)
     Observable.__init__(self)
 def __init__(self, interval):
     Process.__init__(self)
     self.__interval = interval
Beispiel #59
0
 def __init__(self, name, queue, lock, result):  # <5>
     Process.__init__(self)
     self.queue = queue
     self.result = result
     self.lock = lock
     self.name = name
Beispiel #60
0
 def __init__(self, klass, i, kwargs, queue):
   Process.__init__(self)
   self.simulator = klass(name='{} {}'.format(klass.__name__, i), **kwargs)
   self.queue = queue