添加自定义传输协议编解码
This commit is contained in:
@@ -118,6 +118,15 @@ class sql:
|
||||
print(i)
|
||||
return a
|
||||
|
||||
# 下载文件数据
|
||||
def download_data(self,table_name:str,id:int):
|
||||
cmd="select name,data from {d1} WHERE id={d2};".format(d1=table_name,d2=id)
|
||||
self.cur.execute(cmd)
|
||||
a=self.cur.fetchall()[0]
|
||||
name=a[0].replace('\\','/').split('/')[-1].split('.')
|
||||
name='.'.join(name[:-1])+'--'+str(id)+'.'+name[-1]
|
||||
return (name,a[1])
|
||||
|
||||
# 下载指定文件,返回文件路径
|
||||
def download(self,id:int):
|
||||
if not os.path.exists(self.download_path):
|
||||
|
Reference in New Issue
Block a user