taler-merchant-demos

Python-based Frontends for the Demonstration Web site
Log | Files | Refs | Submodules | README | LICENSE

appconfig.py (1083B)


      1 ##
      2 # This file is part of GNU TALER.
      3 # Copyright (C) 2024 Taler Systems SA
      4 #
      5 # TALER is free software; you can redistribute it and/or modify it under the
      6 # terms of the GNU Lesser General Public License as published by the Free Software
      7 # Foundation; either version 2.1, or (at your option) any later version.
      8 #
      9 # TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11 # A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
     12 #
     13 # You should have received a copy of the GNU Lesser General Public License along with
     14 # GNU TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 #
     16 # @author Florian Dold
     17 
     18 import os
     19 from .util.talerconfig import TalerConfig
     20 
     21 def load_taler_config():
     22     # The (WSGI) host passes the configuration endpoint via
     23     # an environment variable.
     24     config_filename = os.environ["TALER_CONFIG_FILENAME"]
     25     if config_filename == "":
     26         config_filename = None
     27     return TalerConfig.from_file(config_filename)