Mercurial > repos > brenninc > directory_reader_limited_by_data_table
diff directory_copier.py @ 1:1487421505f1 draft
Uploaded correct tool this time
author | brenninc |
---|---|
date | Wed, 23 Mar 2016 12:08:33 -0400 |
parents | 25b07ce180d4 |
children | 3911ee1a0078 |
line wrap: on
line diff
--- a/directory_copier.py Wed Mar 23 11:56:50 2016 -0400 +++ b/directory_copier.py Wed Mar 23 12:08:33 2016 -0400 @@ -10,34 +10,6 @@ sys.exit(1) -def get_tool_data(name): - root_dir = os.path.dirname((os.path.realpath(__file__))) - path = os.path.join(root_dir,"tool-data",name) - if not(os.path.isfile(path)): - report_error(name,"file not found in tool's tool-data folder. Please ask you galaxy admin to add it back") - return path - - -def check_white_list(path_to_check): - white_list = get_tool_data("white-list.ini") - with open(white_list, 'r') as white_list_file: - for line in white_list_file: - line = line.strip() - if len(line) >= 1 and path_to_check.startswith(line): - return True - report_error(path_to_check,"has not been included in the white list. Please contact the local galaxy admin to add it.") - - -def check_black_list(path_to_check): - black_list = get_tool_data("black-list.ini") - with open(black_list, 'r') as black_list_file: - for line in black_list_file: - line = line.strip() - if len(line) >= 1 and line in path_to_check: - report_error(line,"has been black list so",path_to_check,"is not allowed. Please contact the local galaxy admin to change that, or add a symlink.") - return True - - def check_pattern_get_new_name(a_file, ending, options): if options.start: if not(a_file.startswith(options.start)): @@ -130,9 +102,5 @@ path = options.path.strip() if path[-1] != '/': path = path + "/" - check_white_list(path) - print path, "white listed" - check_black_list(path) - print path, "not black listed" copy_and_link(path, options)