diff --git a/ectyper/ectyper.py b/ectyper/ectyper.py index 148ff1e..bb82252 100644 --- a/ectyper/ectyper.py +++ b/ectyper/ectyper.py @@ -65,6 +65,7 @@ def run_program(): args = commandLineOptions.parse_command_line() + output_directory = create_output_directory(args.output) # Create a file handler for log messages in the output directory for the root thread diff --git a/ectyper/genomeFunctions.py b/ectyper/genomeFunctions.py index f062290..f9c6c7a 100644 --- a/ectyper/genomeFunctions.py +++ b/ectyper/genomeFunctions.py @@ -35,12 +35,14 @@ def get_files_as_list(files_or_directories, max_depth_level): """ files_list = [] + + init_min_dir_level = min([os.path.abspath(p).count(os.sep)+1 if os.path.isdir(p) else os.path.abspath(p).count(os.sep) for p in files_or_directories]) - for file_or_directory in sorted([os.path.abspath(p) for p in files_or_directories]): + for file_or_directory in sorted([os.path.abspath(p) for p in files_or_directories if len(p) != 0]): dir_level_current = get_relative_directory_level(file_or_directory, init_min_dir_level) - + if dir_level_current > max_depth_level: LOG.info(f"Directory level exceeded ({dir_level_current} > {max_depth_level}), skipping {file_or_directory} ...") continue diff --git a/test/test_ectyper_integration.py b/test/test_ectyper_integration.py index 02db518..998aa17 100644 --- a/test/test_ectyper_integration.py +++ b/test/test_ectyper_integration.py @@ -59,7 +59,7 @@ def test_integration_no_file(): :return: None """ file = '' - set_input(file) + set_input(input=file) with pytest.raises(FileNotFoundError) as se: ectyper.run_program() assert se.type == FileNotFoundError