Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84fd39418d |
@@ -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):
|
||||||
@@ -116,14 +116,24 @@ class Order:
|
|||||||
|
|
||||||
# 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)
|
||||||
# print(d)
|
else:
|
||||||
|
data = 'curl -m 10 '+ftp_url
|
||||||
|
d = self.CMD(data)
|
||||||
|
|
||||||
if file_content in d:
|
if file_content in d:
|
||||||
return "Success"
|
return "Success"
|
||||||
else:
|
else:
|
||||||
return "Fail"
|
return "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'],
|
||||||
"Certificate":"Tango Secure Gateway CA",
|
"Certificate":"Tango Secure Gateway CA",
|
||||||
|
|||||||
Reference in New Issue
Block a user