Skip to content

Commit

Permalink
issue warning to user if no raw data to be sent
Browse files Browse the repository at this point in the history
  • Loading branch information
raacampbell committed Dec 8, 2022
1 parent 13ecbb9 commit e3c2e0e
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions btpytools/transferToServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ def user_specified_cropped_directories_individually(source_dirs, verbose=False):

# If the list is only one directory long (or is a string) then we still need to check if it
# is a cropped directory before deciding for sure wether to return True or False.
if (
isinstance(source_dirs, str)
or isinstance(source_dirs, list)
and len(source_dirs) == 1
):
if isinstance(source_dirs, list) and len(source_dirs) == 1:
source_dirs = source_dirs[0]

if isinstance(source_dirs, str):
if tools.has_compressed_raw_data(os.path.split(source_dirs)[0]):
# Parent directory contains a compressed archive. This makes it
# likely this was a cropped directory and that the user could
Expand Down Expand Up @@ -487,6 +486,19 @@ def main():
if not tools.query_yes_no(""):
sys.exit()

# Check whether the user is maybe failing to copy raw data

if issue_warning_if_compressed_data_will_not_be_sent(source_dirs):
print(
"\nYou have specified directories individually and have omitted to "
"ask for existing compressed raw data to be sent!"
)
print("Please see the readme at: https://pypi.org/project/btpytools/")
if not tools.query_yes_no(
"Are you sure you want to continue?", default="no"
):
sys.exit()

# Ask for confirmation before starting
print("\nPerform the following transfer?")
for _ii, t_dir in enumerate(source_dirs):
Expand Down

0 comments on commit e3c2e0e

Please sign in to comment.