Skip to content

Commit

Permalink
Get new CLI working properly with force recheck
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstanek committed Jul 27, 2016
1 parent 594dd0e commit 9d8ba18
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion botbot/botbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,15 @@ def main():
path = args.path
outpath = args.out if args.out else sys.stdout

# Initialize the checker
chkr = checker.OneshotChecker(outpath, sqlcache.get_dbpath())

# Add all file checks to the checker
all_file_checks = checks.ALLCHECKS + schecks.ALLSCHECKS
chkr.register(*all_file_checks)

chkr.check_all(path, shared=args.shared, link=args.follow_symlinks,
verbose=args.verbose)
verbose=args.verbose, force=args.force_recheck)

elif args.cmd == 'daemon':
pass
Expand Down
3 changes: 3 additions & 0 deletions botbot/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ def is_old_and_large(fi):

if fi['size'] > int(large) and mod_days >= int(old):
return 'PROB_OLD_LARGE'

ALLCHECKS = [is_fastq, sam_should_compress, is_large_plaintext,
is_old_and_large]
2 changes: 2 additions & 0 deletions botbot/schecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ def dir_group_readable(fi):
return 'PROB_DIR_NOT_ACCESSIBLE'
elif not bool(stat.S_IWGRP & mode):
return 'PROB_DIR_NOT_WRITABLE'

ALLSCHECKS = [file_groupreadable, file_group_executable, dir_group_readable]

0 comments on commit 9d8ba18

Please sign in to comment.