import os

QB_ROOT = os.getenv('QB_ROOT')

QB_QUESTION_DB = os.getenv('QB_QUESTION_DB', 'data/internal/non_naqt.db')
QB_GUESS_DB = os.getenv('QB_GUESS_DB', 'output/guesses.db')

QB_SPARK_MASTER = os.getenv('QB_SPARK_MASTER')
QB_STREAMING_CORES = os.getenv('QB_STREAMING_CORES', 12)

QB_WIKI_LOCATION = os.getenv('QB_WIKI_LOCATION', 'data/external/wikipedia')

QB_API_DOMAIN = os.getenv('QB_API_DOMAIN', '')
QB_API_USER_ID = int(os.getenv('QB_API_USER_ID', 1))
QB_API_KEY = os.getenv('QB_API_KEY', '')

ENVIRONMENT = dict(
    QB_ROOT=QB_ROOT,
    QB_QUESTION_DB=QB_QUESTION_DB,
    QB_GUESS_DB=QB_GUESS_DB,
    QB_SPARK_MASTER=QB_SPARK_MASTER,
    QB_STREAMING_CORES=QB_STREAMING_CORES,
    QB_WIKI_LOCATION=QB_WIKI_LOCATION,
    QB_API_DOMAIN=QB_API_DOMAIN,
    QB_API_USER_ID=QB_API_USER_ID,
    QB_API_KEY=QB_API_KEY
)


def data_path(other_path):
    if QB_ROOT:
        return os.path.join(QB_ROOT, other_path)
    else:
        return other_path

@@ -40,36 +40,56 @@
 ')%0A%0A
-QB_QUESTION_DB = os.getenv('
+if os.path.exists('data/internal/naqt.db'):%0A    
 QB_Q
@@ -98,18 +98,18 @@
 STION_DB
-',
+ =
  'data/i
@@ -120,20 +120,16 @@
 nal/
-non_
 naqt.db'
 )%0AQB
@@ -128,69 +128,63 @@
 .db'
-)
 %0A
+else:%0A    
 QB_
-GUESS
+QUESTION
 _DB = 
-os.getenv('QB_GUESS_DB', 'output/guesses
+'data/internal/non_naqt
 .db'
-)
 %0A%0AQB
@@ -585,37 +585,8 @@
 DB,%0A
-    QB_GUESS_DB=QB_GUESS_DB,%0A
     

Stop using QB environment variable for database definition