当前位置: 首页>>代码示例>>Python>>正文


Python Process.__init__方法代码示例

本文整理汇总了Python中process.Process.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Process.__init__方法的具体用法?Python Process.__init__怎么用?Python Process.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在process.Process的用法示例。


在下文中一共展示了Process.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        Process.__init__(self)
        if (len(args) > 1 and
            not any(isinstance(arg, (TableExpression, list, tuple))
                    for arg in args)):
            args = (args,)
        self.args = args
        suffix = kwargs.pop('suffix', '')
        fname = kwargs.pop('fname', None)
        mode = kwargs.pop('mode', 'w')
        if kwargs:
            kwarg, _ = kwargs.popitem()
            raise TypeError("'%s' is an invalid keyword argument for csv()"
                            % kwarg)

        if fname is not None and suffix:
            raise ValueError("csv() can't have both 'suffix' and 'fname' "
                             "arguments")
        if fname is None:
            suffix = "_" + suffix if suffix else ""
            fname = "{entity}_{period}" + suffix + ".csv"
        self.fname = fname
        if mode not in ('w', 'a'):
            raise ValueError("csv() mode argument must be either "
                             "'w' (overwrite) or 'a' (append)")
        self.mode = mode
开发者ID:AnneDy,项目名称:Til-Liam,代码行数:28,代码来源:actions.py

示例2: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
	def __init__(self, name , priority, message, numero):
		Process.__init__(self, name, 4, priority)
		self.message = message
		self.numero = numero
		self.timer = int(0.02* len(message))+1	
		# 0 no usa , 1 usa , 2 bloquea
		self.external = {'Pantalla': 0, 'Audifono': 1, 'Microfono': 0, 'GPS': 0, 'Enviar Info': 1, 'Recibir Info': 1}
开发者ID:agrass,项目名称:IIC2333-,代码行数:9,代码来源:message.py

示例3: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
	def __init__(self,context,id):
		Process.__init__(self,context,id)

		if 'config' in context:
			self.__config__ = context['config']
		else:
			raise Exception('WestGridStatusProcess','no config found in context.')
		
		if 'process' in self.__config__:
			if 'host' in self.__config__['process']:
				self.__host__ = self.__config__['process']['host']
			else:
				raise Exception('WestGridProcess','required field [process]:host not found in workfile')

			if 'user' in self.__config__['process']:
				self.__user__ = self.__config__['process']['user']
			else:
				self.__user__ = environ['USER']

			if 'key' in self.__config__['process']:
				self.__key__ = self.__config__['process']['key']
			else:
				if 0 == system( 'touch ~/.ssh/id_rsa &> /dev/null' ):
					self.__key__ = '~/.ssh/id_rsa'
				else:
					raise Exception('WestGridProcess','required field [process]:key="~/.ssh/id_rsa" not found in workfile')
		else:
			raise Exception('WestGridProcess','no process section found in workfile')

		self.__last_time__ = 0
		self.__jobs__ = {}
		
		task = WG_DeployTask( self.id(), None, self.__config__ )
		task.execute()
开发者ID:averigin,项目名称:STARS,代码行数:36,代码来源:westgridprocess.py

示例4: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
	def __init__(self,context,id):
		Process.__init__(self,context,id)

		if 'config' in context:
			self.__config__ = context['config']
			#display( OUTPUT_DEBUG, str(self.__config__) )
		else:
			raise Exception('ExperimentProcess','no config found in context.')
		
		repeat = 0
		runs = 0
		if 'process' in self.__config__:
			if 'repeat' in self.__config__['process']:
				self.__repeat__ = int(self.__config__['process']['repeat'])
			else:
				raise Exception('ExperimentProcess','no repeats field found in process section of workfile')

			if 'runs' in self.__config__['process']:
				runs = int(self.__config__['process']['runs'])
			else:
				raise Exception('ExperimentProcess','no runs field found in process section of workfile')
		else:
			raise Exception('ExperimentProcess','no process section found in workfile')

		self.__first__ = False

		self.__parameters__ = int( runs / self.__repeat__ )

		self.display( OUTPUT_MAJOR, '%s initialized for %d parameters totalling %d runs' % (self.__config__['process']['config'], self.__parameters__, runs) )

		self.__queueAnalysis__()
开发者ID:averigin,项目名称:STARS,代码行数:33,代码来源:experimentprocess.py

示例5: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
 def __init__(self, env, me):
   Process.__init__(self)
   self.ballot_number = None
   self.accepted = PValueSet()
   self.me = me
   self.env = env
   self.env.addProc(self)
开发者ID:hanmeimei,项目名称:paxosmmc,代码行数:9,代码来源:acceptor.py

示例6: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
	def __init__(self,context,pid):
		Process.__init__(self,context,pid)

		if 'config' in context:
			self._config = context['config']
			#display( OUTPUT_DEBUG, str(self.__config__) )
		else:
			raise Exception('RandomTestProcess','no config found in context.')
		
		self._start = time()
		self._tasktime = 1
		self._nextid = 0

		if 'process' in self._config:

			if 'tasktime' in self._config['process']:
				self._tasktime = float(self._config['process']['tasktime'])

			if 'period' in self._config['process']:
				self._period = float(self._config['process']['period'])

			if 'ctrltasktime' in self._config['process']:
				self._ctrltasktime = float(self._config['process']['ctrltasktime'])

			if 'maxtasks' in self._config['process']:
				self._maxtasks = int(self._config['process']['maxtasks'])
	
		self.__queueRandomTestTask__(10)
		self.determineState()
开发者ID:averigin,项目名称:STARS,代码行数:31,代码来源:randomtestprocess.py

示例7: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
    def __init__(self, args, desc, parent=None):
        if isinstance(args, basestring):
            command = '%s %s' % (self.program, args)
        else:
            command = (self.program,) + tuple(args)

        Process.__init__(self, command, self.title, desc, parent)
开发者ID:gentoo-mirror,项目名称:raw,代码行数:9,代码来源:o2cb_ctl.py

示例8: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
    def __init__(self):
        Process.__init__(self)
        self.block_render = True
        self.ticks = 0

        self.page = 0
        self.dest_page = 0
        self.state = 0  # 0 = zoom out, 1 = control, 2 = zoom in, 3 = change page
开发者ID:Hatchet2k4,项目名称:mannux,代码行数:10,代码来源:subscreen.py

示例9: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
	def __init__(self,config,pid):
		Process.__init__(self,config,pid)
		
		self._interval = 300
		self._last = time() - self._interval
		self._data = None

		self.display( OUTPUT_VERBOSE, 'status process activated' )
开发者ID:averigin,项目名称:STARS,代码行数:10,代码来源:statusprocess.py

示例10: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
 def __init__(self, env, id, config):
     Process.__init__(self, env, id)
     self.ballot_number = BallotNumber(0, self.id)
     self.active = False
     self.proposals = {}
     self.timeout = 1.0
     self.config = config
     self.env.addProc(self)
开发者ID:hanmeimei,项目名称:paxosmmc,代码行数:10,代码来源:leader.py

示例11: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
	def __init__(self,name,priority,numero,duracion):
		Process.__init__(self,name,2,priority)
		self.numero = numero;
		self.hist = Historial()
		self.duracion = int(duracion)
		self.timer = int(duracion)
		# 0 no usa , 1 usa , 2 bloquea
		self.external = {'Pantalla': 1, 'Audifono': 2, 'Microfono': 2, 'GPS': 0, 'Enviar Info': 1, 'Recibir Info': 1}
开发者ID:agrass,项目名称:IIC2333-,代码行数:10,代码来源:llamar.py

示例12: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
    def __init__(self, outQueue, errQueue, proc_count=10, headers={}):

        self.outQueue = outQueue
        self.errQueue = errQueue
        self.headers = {}
        self.timeOut = 5
        
        Process.__init__(self, proc_count)
开发者ID:mvidela,项目名称:image_grabber,代码行数:10,代码来源:grabbler.py

示例13: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
 def __init__(self, env, id, config):
   Process.__init__(self, env, id)
   self.slot_in = self.slot_out = 1
   self.proposals = {}
   self.decisions = {}
   self.requests = []
   self.config = config
   self.env.addProc(self)
开发者ID:hanmeimei,项目名称:paxosmmc,代码行数:10,代码来源:replica.py

示例14: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     Process.__init__(self)
     self.args = args
     self.print_exprs = kwargs.pop('print_exprs', False)
     if kwargs:
         kwarg, _ = kwargs.popitem()
         raise TypeError("'%s' is an invalid keyword argument for show()"
                         % kwarg)
开发者ID:chenyuyou,项目名称:liam2,代码行数:10,代码来源:actions.py

示例15: __init__

# 需要导入模块: from process import Process [as 别名]
# 或者: from process.Process import __init__ [as 别名]
 def __init__(self, env, me, leader, acceptors, ballot_number):
   Process.__init__(self)
   self.env = env
   self.me = me
   self.leader = leader
   self.acceptors = acceptors
   self.ballot_number = ballot_number
   self.env.addProc(self)
开发者ID:hanmeimei,项目名称:paxosmmc,代码行数:10,代码来源:scout.py


注:本文中的process.Process.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。