Explorar o código

use FWROOT os environ var if it exists

Chris McDonough %!s(int64=10) %!d(string=hai) anos
pai
achega
aaada7b8ec
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      frameworks/Python/pyramid/create_database.py

+ 4 - 1
frameworks/Python/pyramid/create_database.py

@@ -1,11 +1,14 @@
 import codecs
+import os
 from frameworkbenchmarks.models import DBSession
 
+FWROOT = os.environ.get('FWROOT', '../../..')
+
 if __name__ == "__main__":
     """
     Initialize database
     """
-    with codecs.open('../../../config/create-postgres.sql',
+    with codecs.open('%s/config/create-postgres.sql' % FWROOT,
                      'r',
                      encoding='utf-8') as fp:
         sql = fp.read()