【问题标题】:pysvn obtaining file mode (symlink, executable, file, or dir) from http requestpysvn 从 http 请求中获取文件模式(符号链接、可执行文件、文件或目录)
【发布时间】:2014-03-19 19:28:03
【问题描述】:

我正在尝试使用给定的存储库 url 创建一个存储所有信息的数据库。

通过使用 pysvn API,我试图通过 http 请求获取文件模式(符号链接、可执行文件、文件)。

我尝试使用 list 和 info2 方法返回关于我的 http url 的信息。这两种方法在返回的字典中都有一个属性“kind”,但“kind”只确定它是“文件”还是“目录”。

我阅读了http://pysvn.tigris.org/docs/pysvn_prog_ref.html 上的文档,但找不到任何可以在不将文件保存到本地磁盘的情况下找到文件模式的内容。

任何帮助将不胜感激。

谢谢。

【问题讨论】:

    标签: python file executable symlink pysvn


    【解决方案1】:

    所以我发现要获取文件模式,您需要首先检查文件是否具有属性。方法 list() 具有 has_prop 的属性。

    http://pysvn.tigris.org/docs/pysvn_prog_ref.html#pysvn_client_list

    如果有属性,使用方法 proplist() 获取包含路径和 prop_dict 的元组列表,其中 prop_dict 可以确定给定文件的文件模式。

    http://pysvn.tigris.org/docs/pysvn_prog_ref.html#pysvn_client_proplist

    【讨论】:

      猜你喜欢
      • 2021-01-10
      • 1970-01-01
      • 2018-10-21
      • 1970-01-01
      • 2019-02-10
      • 1970-01-01
      • 2013-03-17
      • 1970-01-01
      • 2015-07-31
      相关资源
      最近更新 更多