Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bdf2695e1 |
@@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from time import sleep
|
from time import sleep
|
||||||
import platform
|
|
||||||
|
|
||||||
class Order:
|
class Order:
|
||||||
def CMD(self,data):
|
def CMD(self,data):
|
||||||
@@ -110,29 +110,19 @@ class Order:
|
|||||||
fsize = os.path.getsize(linux_path + "/"+fiel_name) # 435814
|
fsize = os.path.getsize(linux_path + "/"+fiel_name) # 435814
|
||||||
print(fsize)
|
print(fsize)
|
||||||
if fsize == file_size:
|
if fsize == file_size:
|
||||||
return "Success"
|
return "ftp_success"
|
||||||
else:
|
else:
|
||||||
return "Fail"
|
return "ftp_fail"
|
||||||
|
|
||||||
# FTP 登录
|
# FTP 登录
|
||||||
def FTP_login(self, ftp_url,file_content):
|
def FTP_login(self, ftp_url,file_content):
|
||||||
SYS = self.Operating_System()
|
|
||||||
if SYS == "Windows":
|
|
||||||
data = 'curl -m 10 '+ftp_url+' | iconv -f utf-8 -t gbk'
|
data = 'curl -m 10 '+ftp_url+' | iconv -f utf-8 -t gbk'
|
||||||
d = self.CMD(data)
|
d = self.CMD(data)
|
||||||
else:
|
# print(d)
|
||||||
data = 'curl -m 10 '+ftp_url
|
|
||||||
d = self.CMD(data)
|
|
||||||
|
|
||||||
if file_content in d:
|
if file_content in d:
|
||||||
return "Success"
|
return "ftp_success"
|
||||||
else:
|
else:
|
||||||
return "Fail"
|
return "ftp_fail"
|
||||||
|
|
||||||
# 判断当前操作系统
|
|
||||||
def Operating_System(self):
|
|
||||||
os_name = platform.system()
|
|
||||||
return os_name
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
datas = {"url":['https://www.baidu.com'],
|
datas = {"url":['https://www.baidu.com'],
|
||||||
|
|||||||
Reference in New Issue
Block a user