本文整理汇总了Python中subprocess.Popen.partition方法的典型用法代码示例。如果您正苦于以下问题:Python Popen.partition方法的具体用法?Python Popen.partition怎么用?Python Popen.partition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subprocess.Popen
的用法示例。
在下文中一共展示了Popen.partition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: list
# 需要导入模块: from subprocess import Popen [as 别名]
# 或者: from subprocess.Popen import partition [as 别名]
plain = None
is_encrypted = False
found = False
gpg_block = False
for line in logs.splitlines():
if gpg_block:
encrypted.append(line)
if line == '-----END PGP MESSAGE-----':
gpg_block = False
is_encrypted = True
found = True
elif line.endswith('FiWare Support:'):
gpg_block = True
encrypted = list()
elif line.startswith('support:') or line.startswith('Fiware Support: '):
password = line.partition(':')[2].strip()
found = True
is_encrypted = False
if is_encrypted:
encrypted = '\n'.join(encrypted)
print(encrypted)
output = Popen(['gpg', '-d'], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate(encrypted)[0]
print(output.partition(':')[2].strip())
elif found:
print(password)
print(server.get_vnc_console('novnc')['console']['url'])
示例2: list
# 需要导入模块: from subprocess import Popen [as 别名]
# 或者: from subprocess.Popen import partition [as 别名]
plain = None
is_encrypted = False
found = False
gpg_block = False
for line in logs.splitlines():
if gpg_block:
encrypted.append(line)
if line == '-----END PGP MESSAGE-----':
gpg_block = False
is_encrypted = True
found = True
elif line.endswith('FiWare Support:'):
gpg_block = True
encrypted = list()
elif line.startswith('support:') or line.startswith('Fiware Support: '):
password = line.partition(':')[2].strip()
found = True
is_encrypted = False
if is_encrypted:
encrypted = '\n'.join(encrypted)
print encrypted
output = Popen(['gpg', '-d'], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate(encrypted)[0]
print output.partition(':')[2].strip(),
elif found:
print password,
print server.get_vnc_console('novnc')['console']['url']
示例3: svn_get_version
# 需要导入模块: from subprocess import Popen [as 别名]
# 或者: from subprocess.Popen import partition [as 别名]
def svn_get_version():
from subprocess import Popen, PIPE
output = Popen(["svn", "info", "mealadvisor"],
stdout=PIPE).communicate()[0]
return output.partition('Revision: ')[2].partition('\n')[0]