def create_xml_list(self, ftp_server, archive_path, submission):
ftp = FTP(ftp_server)
ftp.login()
num = int(submission[3:])
n = "DRA" + str(int(num/1000)).zfill(3)
xml_file_path = "/".join([archive_path, n, submission])
ftp.cwd(xml_file_path)
xml_list = []
try:
xml_list = ftp.mlsd()
except ftplib.error_perm as erm:
if str(erm) == "550 No files found":
print("No files in this directory")
else:
raise
return xml_list
Created
January 19, 2016 19:12
-
-
Save dogrunjp/3e72ba831b0fcef87f26 to your computer and use it in GitHub Desktop.
DRAのsubmission idからメタデータファイルリストをftpで取得する関数。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment