def _plisttool_result(control):
"""Helper function that runs PlistTool with the given control struct.
This function inserts a StringIO object as the control's "output" key and
returns the dictionary containing the result of the tool after parsing it
from that StringIO.
Args:
control: The control struct to pass to PlistTool. See the module doc for
the plisttool module for a description of this format.
Returns:
The dictionary containing the result of the tool after parsing it from
the in-memory string file.
"""
output = StringIO.StringIO()
control['output'] = output
control['target'] = _testing_target
tool = plisttool.PlistTool(control)
tool.run()
return plistlib.readPlistFromString(output.getvalue())
评论列表
文章目录