oops forgot to remove some debugging statements from the previous patch
[htsworkflow.git] / scripts / library.py
1 """
2 Provide some quick and dirty access and reporting for the fctracker database.
3
4 The advantage to this code is that it doesn't depend on django being
5 installed, so it can run on machines other than the webserver.
6 """
7 from optparse import OptionParser
8 import sys
9
10 from gaworkflow.util import fctracker
11
12 def make_parser():
13     """
14     Make parser
15     """
16     parser = OptionParser()
17     parser.add_option("-d", "--database", dest="database",
18                       help="path to the fctracker.db",
19                       default=None)
20     parser.add_option("-w", "--where", dest="where",
21                       help="add a where clause",
22                       default=None)
23     return parser
24
25 def main(argv=None):
26     if argv is None:
27         argv = []
28     parser = make_parser()
29
30     opt, args = parser.parse_args(argv)
31     
32     fc = fctracker.fctracker(opt.database)
33     cells = fc._get_flowcells(opt.where)
34
35     print fctracker.recoverable_drive_report(cells)
36     return 0
37
38 if __name__ == "__main__":
39     sys.exit(main(sys.argv[1:]))