diff --git a/beat/web/settings/__init__.py b/beat/web/settings/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8d221af98ef576e61d5a28e214678a3072f3dde0 100644 --- a/beat/web/settings/__init__.py +++ b/beat/web/settings/__init__.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python +# vim: set fileencoding=utf-8 : + +############################################################################### +# # +# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/ # +# Contact: beat.support@idiap.ch # +# # +# This file is part of the beat.web module of the BEAT platform. # +# # +# Commercial License Usage # +# Licensees holding valid commercial BEAT licenses may use this file in # +# accordance with the terms contained in a written agreement between you # +# and Idiap. For further information contact tto@idiap.ch # +# # +# Alternatively, this file may be used under the terms of the GNU Affero # +# Public License version 3 as published by the Free Software and appearing # +# in the file LICENSE.AGPL included in the packaging of this file. # +# The BEAT platform is distributed in the hope that it will be useful, but # +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # +# or FITNESS FOR A PARTICULAR PURPOSE. # +# # +# You should have received a copy of the GNU Affero Public License along # +# with the BEAT platform. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +import os +import platform + + +SHM_PATH = "/dev/shm/beatweb" # nosec + + +def get_test_db_path(is_on_ci): + database_name = "test.sqlite3" + database_path = os.path.realpath("./") + + if not is_on_ci: + if platform.system() == "Linux": + database_path = SHM_PATH + if not os.path.exists(database_path): + os.makedirs(database_path) + + return os.path.join(database_path, database_name) + + +def get_test_prefix_path(is_on_ci): + prefix_path = os.path.realpath("./test_prefix") + if not is_on_ci: + if platform.system() == "Linux": + prefix_path = os.path.join(SHM_PATH, "test_prefix") # nosec + + return prefix_path