MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / download_file

Method download_file

client/util/api/fileserver.py:115–125  ·  view source on GitHub ↗

从文件服务器下载文件到指定地址 :param rel_url: 需要下载的文件的相对url :param filepath: 下载后的文件路径 :return: 下载成功,返回filepath;否则返回None

(self, rel_url, filepath)

Source from the content-addressed store, hash-verified

113 return rsp.read()
114
115 def download_file(self, rel_url, filepath):
116 """
117 从文件服务器下载文件到指定地址
118 :param rel_url: 需要下载的文件的相对url
119 :param filepath: 下载后的文件路径
120 :return: 下载成功,返回filepath;否则返回None
121 """
122 data = self.load_data(rel_url)
123 with open(filepath, 'wb') as wf:
124 wf.write(data)
125 return filepath
126
127 def download_big_file(self, rel_url, filepath):
128 """大文件下载"""

Callers

nothing calls this directly

Calls 2

load_dataMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected