Default to sequencing if we don't have a genome for the provided
[htsworkflow.git] / scripts / retrieve_config
index 3056c16b6912a08015bdaac3d57d354183f47014..e4fdff1fad42122e6a20b0f678f9660aed9c5809 100644 (file)
@@ -1,29 +1,42 @@
 #!/usr/bin/env python
+import logging
 import sys
-from gaworkflow.pipeline.retrieve_config import *
+from htsworkflow.pipelines.retrieve_config import *
+from htsworkflow.pipelines import retrieve_config
 
-def main(args=None):
-  #Display help if no args are presented
-  if len(sys.argv) == 1:
-    sys.argv.append('-h')
+#Turn on built-in command-line parsing.
+retrieve_config.DISABLE_CMDLINE = False
+
+def main(argv=None):
+  if argv is None:
+    argv = sys.argv
     
-  options = getCombinedOptions()
+  #Display help if no args are presented
+  options = getCombinedOptions(argv)
+
+  if options.verbose:
+    logging.basicConfig(level=logging.DEBUG)
+  else:
+    logging.basicConfig(level=logging.INFO)
+  
   msg_list = ['ERROR MESSAGES:']
-  if options.output_filepath is None:
-    msg_list.append("  Output filepath argument required. -o <filepath> or --output=<filepath>")
-    
   if options.flowcell is None:
     msg_list.append("  Flow cell argument required. -f <flowcell> or --flowcell=<flowcell>")
     
   if options.url is None:
     msg_list.append("  URL argument required (-u <url> or --url=<url>), or entry\n" \
-                    "    in /etc/elandifier/elandifer.conf or ~/.elandifier.conf")
+                    "    in /etc/ga_frontend/ga_frontend.conf or ~/.ga_frontend.conf")
+  if options.genome_dir is None:
+    msg_list.append("  genome_dir argument required (-g <genome_dir> or \n" \
+                    "    --genome_dir=<genome_dir>, or entry in \n" \
+                    "    /etc/ga_frontend/ga_frontend.conf or ~/.ga_frontend.conf")
     
   if len(msg_list) > 1:
     print '\n'.join(msg_list)
     return 1
   
-  saveConfigFile(options.flowcell, options.url, options.output_filepath)
+  saveConfigFile(options)
+  
   return 0
   
 if __name__ == "__main__":