當前位置: 首頁>>代碼示例>>Python>>正文


Python LocalProcess.finish方法代碼示例

本文整理匯總了Python中grid_control.utils.process_base.LocalProcess.finish方法的典型用法代碼示例。如果您正苦於以下問題:Python LocalProcess.finish方法的具體用法?Python LocalProcess.finish怎麽用?Python LocalProcess.finish使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在grid_control.utils.process_base.LocalProcess的用法示例。


在下文中一共展示了LocalProcess.finish方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _parseProxy

# 需要導入模塊: from grid_control.utils.process_base import LocalProcess [as 別名]
# 或者: from grid_control.utils.process_base.LocalProcess import finish [as 別名]
	def _parseProxy(self, cached = True):
		# Return cached results if requested
		if cached and self._cache:
			return self._cache
		# Call voms-proxy-info and parse results
		proc = LocalProcess(self._infoExec, *self._getProxyArgs())
		(retCode, stdout, stderr) = proc.finish(timeout = 10)
		if (retCode != 0) and not self._ignoreWarning:
			msg = ('%s output:\n%s\n%s\n' % (self._infoExec, stdout, stderr)).replace('\n\n', '\n')
			msg += 'If job submission is still possible, you can set [access] ignore warnings = True\n'
			raise AccessTokenError(msg + '%s failed with return code %d' % (self._infoExec, retCode))
		self._cache = DictFormat(':').parse(stdout)
		return self._cache
開發者ID:Fra-nk,項目名稱:grid-control,代碼行數:15,代碼來源:access_grid.py

示例2: _parseProxy

# 需要導入模塊: from grid_control.utils.process_base import LocalProcess [as 別名]
# 或者: from grid_control.utils.process_base.LocalProcess import finish [as 別名]
	def _parseProxy(self, cached = True):
		# Return cached results if requested
		if cached and self._cache:
			return self._cache
		# Call voms-proxy-info and parse results
		args = ['--all']
		if self._proxyPath:
			args.extend(['--file', self._proxyPath])
		proc = LocalProcess(self._infoExec, *args)
		(retCode, stdout, stderr) = proc.finish(timeout = 10)
		if (retCode != 0) and not self._ignoreWarning:
			msg = ('voms-proxy-info output:\n%s\n%s\n' % (stdout, stderr)).replace('\n\n', '\n')
			msg += 'If job submission is still possible, you can set [access] ignore warnings = True\n'
			raise AccessTokenError(msg + 'voms-proxy-info failed with return code %d' % retCode)
		self._cache = utils.DictFormat(':').parse(stdout)
		return self._cache
開發者ID:thomas-mueller,項目名稱:grid-control,代碼行數:18,代碼來源:access.py

示例3: _parse_proxy

# 需要導入模塊: from grid_control.utils.process_base import LocalProcess [as 別名]
# 或者: from grid_control.utils.process_base.LocalProcess import finish [as 別名]
	def _parse_proxy(self, cached=True):
		# Return cached results if requested
		if cached and self._cache:
			return self._cache
		# Call voms-proxy-info and parse results
		proc = LocalProcess(self._proxy_info_exec, *self._get_proxy_info_arguments())
		(exit_code, stdout, stderr) = proc.finish(timeout=10)
		if (exit_code != 0) and not self._ignore_warning:
			msg = ('%s output:\n%s\n%s\n' % (self._proxy_info_exec, stdout, stderr)).replace('\n\n', '\n')
			msg += 'If job submission is still possible, you can set [access] ignore warnings = True\n'
			msg += '%s failed with return code %d' % (self._proxy_info_exec, exit_code)
			raise AccessTokenError(msg)
		self._cache = DictFormat(':').parse(stdout)
		if not self._cache:
			msg = 'Unable to parse access token information:\n\t%s\n\t%s\n'
			raise AccessTokenError(msg % (stdout.strip(), stderr.strip()))
		return self._cache
開發者ID:grid-control,項目名稱:grid-control,代碼行數:19,代碼來源:access_grid.py


注:本文中的grid_control.utils.process_base.LocalProcess.finish方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。