plisttool_unittest.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:rules_apple 作者: bazelbuild 项目源码 文件源码
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())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号