Tag latest live version before the SCHEMA CHANGE that turns library_id
[htsworkflow.git] / htsworkflow / frontend / settings.py
index d4f94a8e3771a0d2d38696e1bed41a6f4a65ba3c..979256933902b260711f0e837211efcfee583b00 100644 (file)
@@ -26,17 +26,18 @@ The options understood by this module are (with their defaults):
 """
 import ConfigParser
 import os
+import shlex
 
 # make epydoc happy
 __docformat__ = "restructuredtext en"
 
-def options_to_list(dest, section_name):
+def options_to_list(options, dest, section_name, option_name):
   """
   Load a options from section_name and store in a dictionary
   """
-  if options.has_section(section_name):
-    for name in options.options(section_name):
-      dest.append( options.get(section_name, name) )
+  if options.has_option(section_name, option_name):
+    opt = options.get(section_name, option_name)
+    dest.extend( shlex.split(opt) )
       
 def options_to_dict(dest, section_name):
   """
@@ -80,9 +81,10 @@ DEBUG = True
 TEMPLATE_DEBUG = DEBUG
 
 ADMINS = []
-options_to_list(ADMINS, 'admins')
+options_to_list(options, ADMINS, 'frontend', 'admins')
 
-MANAGERS = ADMINS
+MANAGERS = []
+options_to_list(options, MANAGERS, 'frontend', 'managers')
 
 AUTHENTICATION_BACKENDS = ( 'samples.auth_backend.HTSUserModelBackend', )
 CUSTOM_USER_MODEL = 'samples.HTSUser' 
@@ -90,6 +92,11 @@ CUSTOM_USER_MODEL = 'samples.HTSUser'
 EMAIL_HOST = options.get('frontend', 'email_host')
 EMAIL_PORT = int(options.get('frontend', 'email_port'))
 
+if options.has_option('frontend', 'notification_sender'):
+    NOTIFICATION_SENDER = options.get('frontend', 'notification_sender')
+else:
+    NOTIFICATION_SENDER = "noreply@example.com"
+
 # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
 DATABASE_ENGINE = options.get('frontend', 'database_engine')
 
@@ -134,6 +141,9 @@ ADMIN_MEDIA_PREFIX = '/media/'
 # Make this unique, and don't share it with anybody.
 SECRET_KEY = '(ekv^=gf(j9f(x25@a7r+8)hqlz%&_1!tw^75l%^041#vi=@4n'
 
+# some of our urls need an api key
+DEFAULT_API_KEY = 'n7HsXGHIi0vp9j5u4TIRJyqAlXYc4wrH'
+
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
     'django.template.loaders.filesystem.load_template_source',
@@ -172,7 +182,6 @@ INSTALLED_APPS = (
     'htsworkflow.frontend.reports',
     'htsworkflow.frontend.inventory',
     'htsworkflow.frontend.bcmagic',
-    'htsworkflow.frontend.bcprinter',
     'django.contrib.databrowse',
 )
 
@@ -183,11 +192,13 @@ options_to_dict(ALLOWED_IPS, 'allowed_hosts')
 
 ALLOWED_ANALYS_IPS = {'127.0.0.1': '127.0.0.1'}
 options_to_dict(ALLOWED_ANALYS_IPS, 'allowed_analysis_hosts')
-#UPLOADTO_HOME = os.path.abspath('../../uploads')
-#UPLOADTO_CONFIG_FILE = os.path.join(UPLOADTO_HOME, 'eland_config')
-#UPLOADTO_ELAND_RESULT_PACKS = os.path.join(UPLOADTO_HOME, 'eland_results')
-#UPLOADTO_BED_PACKS = os.path.join(UPLOADTO_HOME, 'bed_packs')
-RESULT_HOME_DIR='/Users/diane/proj/solexa/results/flowcells'
+
+UPLOADTO_HOME = os.path.abspath('/home/www/gaworkflow/uploads')
+UPLOADTO_CONFIG_FILE = os.path.join(UPLOADTO_HOME, 'eland_config')
+UPLOADTO_ELAND_RESULT_PACKS = os.path.join(UPLOADTO_HOME, 'eland_results')
+UPLOADTO_BED_PACKS = os.path.join(UPLOADTO_HOME, 'bed_packs')
+
+RESULT_HOME_DIR=os.path.abspath('/woldlab/loxcyc/data00/solexa-sequence/flowcells')
 
 LINK_FLOWCELL_STORAGE_DEVICE_URL = options.get('frontend', 'link_flowcell_storage_device_url')
 # PORT 9100 is default for Zebra tabletop/desktop printers