Skip to content

Commit 5d3fcd7

Browse files
committed
Remove tidy_output_dir function and put in gist instead
1 parent d924fac commit 5d3fcd7

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

mothur_py/utils.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,8 @@
88
"""
99

1010
import collections
11-
import os
1211

1312

14-
def tidy_output_dir(mothur_obj, whitelist=list()):
15-
"""Removes files from the output directory that are not listed in the current_files attribute or a whitelist."""
16-
17-
# append current files to whitelist
18-
for file in mothur_obj.current_files.values():
19-
whitelist.append(file)
20-
21-
# tidy up environment to help save space
22-
out_dir = mothur_obj.current_dirs.get('output', None)
23-
24-
# purge non-whitelist files from the output directory
25-
for file in os.listdir(out_dir):
26-
27-
# conditionally correct filepath
28-
if out_dir is not None:
29-
file = os.path.join(out_dir, file)
30-
31-
# only process files, not directories
32-
if os.path.isfile(file):
33-
if file not in whitelist:
34-
os.remove(file)
35-
3613
def format_mothur_params(*args, **kwargs):
3714
"""Formats mothur command paramters from python variables into a string formatted for mothur."""
3815

0 commit comments

Comments
 (0)