本文整理汇总了Python中multiprocessing.Process.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Process.__init__方法的具体用法?Python Process.__init__怎么用?Python Process.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiprocessing.Process
的用法示例。
在下文中一共展示了Process.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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
示例2: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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()
示例3: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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
示例4: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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
示例5: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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
示例6: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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
示例7: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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)
示例8: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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)
示例9: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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
示例10: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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
示例11: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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')
示例12: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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
示例13: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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']
示例14: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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
示例15: __init__
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
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