Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

FTP folder bug fix submit.py #34

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,20 @@ def submit_ncbi(database, submission_name, submission_dir, config_dict, submissi
print("If this is not a '" + submission_type + "' submission, interrupts submission immediately.", file=sys.stdout)
print("\n"+"Connecting to NCBI FTP Server", file=sys.stdout)
print("Submission name: " + submission_name, file=sys.stdout)
# CD to to test/production folder
# Check FTP folder structure either /submit/Production/ or /Production/
if submission_type not in ftp.nlst():
# Check if submit folder exists
if "submit" in ftp.nlst():
ftp.cwd("submit")
# If submit folder exists check if Production/Test folder exists
if submission_type not in ftp.nlst():
print("Error: Cannot find submission folder on NCBI FTP site.", file=sys.stderr)
sys.exit(1)
else:
print("Error: Cannot find submission folder on NCBI FTP site.", file=sys.stderr)
sys.exit(1)
ftp.cwd(submission_type)
# Create submission directory if it does not exist
# Create submission name directory if it does not exist
if ncbi_submission_name not in ftp.nlst():
ftp.mkd(ncbi_submission_name)
# CD to submission folder
Expand Down
Loading