Finished removing bcprinter module by moving what little code there
[htsworkflow.git] / htsworkflow / frontend / settings.py
index 01ec35aa3002ef7b5c971692a4c5931bf3a3c3e1..675da571863af24483f254b7f2ec5dbf38398751 100644 (file)
@@ -54,11 +54,26 @@ options = ConfigParser.SafeConfigParser(
              'database_name': 
                os.path.abspath('/htsworkflow/htswfrontend/dev_fctracker.db'),
              'time_zone': 'America/Los_Angeles',
+             'default_pm': '5',
+             'link_flowcell_storage_device_url': "http://localhost:8000/inventory/lts/link/",
+             'printer1_host': '127.0.0.1',
+             'printer1_port': '9100',
+             'printer2_host': '127.0.0.1',
+             'printer2_port': '9100',
            })
 
 options.read([os.path.expanduser("~/.htsworkflow.ini"),
               '/etc/htsworkflow.ini',])
 
+# OptionParser will use the dictionary passed into the config parser as
+# 'Default' values in any section. However it still needs an empty section
+# to exist in order to retrieve anything.
+if not options.has_section('frontend'):
+    options.add_section('frontend')
+if not options.has_section('bcprinter'):
+    options.add_section('bcprinter')
+
+
 # Django settings for elandifier project.
 
 DEBUG = True
@@ -69,6 +84,9 @@ options_to_list(ADMINS, 'admins')
 
 MANAGERS = ADMINS
 
+AUTHENTICATION_BACKENDS = ( 'samples.auth_backend.HTSUserModelBackend', )
+CUSTOM_USER_MODEL = 'samples.HTSUser' 
+
 EMAIL_HOST = options.get('frontend', 'email_host')
 EMAIL_PORT = int(options.get('frontend', 'email_port'))
 
@@ -152,6 +170,8 @@ INSTALLED_APPS = (
     'htsworkflow.frontend.experiments',
     'htsworkflow.frontend.analysis', 
     'htsworkflow.frontend.reports',
+    'htsworkflow.frontend.inventory',
+    'htsworkflow.frontend.bcmagic',
     'django.contrib.databrowse',
 )
 
@@ -167,3 +187,11 @@ options_to_dict(ALLOWED_ANALYS_IPS, 'allowed_analysis_hosts')
 #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'
+
+LINK_FLOWCELL_STORAGE_DEVICE_URL = options.get('frontend', 'link_flowcell_storage_device_url')
+# PORT 9100 is default for Zebra tabletop/desktop printers
+# PORT 6101 is default for Zebra mobile printers
+BCPRINTER_PRINTER1_HOST = options.get('bcprinter', 'printer1_host')
+BCPRINTER_PRINTER1_PORT = int(options.get('bcprinter', 'printer1_port'))
+BCPRINTER_PRINTER2_HOST = options.get('bcprinter', 'printer2_host')
+BCPRINTER_PRINTER2_PORT = int(options.get('bcprinter', 'printer2_port'))