"Fossies" - the Fresh Open Source Software Archive

Member "LinOTP-release-2.10.5.3/linotpd/src/linotp/lib/config/global_api.py" (24 Jun 2019, 1415 Bytes) of package /linux/misc/LinOTP-release-2.10.5.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "global_api.py" see the Fossies "Dox" file reference documentation.

    1 # -*- coding: utf-8 -*-
    2 #
    3 #    LinOTP - the open source solution for two factor authentication
    4 #    Copyright (C) 2010 - 2019 KeyIdentity GmbH
    5 #
    6 #    This file is part of LinOTP server.
    7 #
    8 #    This program is free software: you can redistribute it and/or
    9 #    modify it under the terms of the GNU Affero General Public
   10 #    License, version 3, as published by the Free Software Foundation.
   11 #
   12 #    This program is distributed in the hope that it will be useful,
   13 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
   14 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15 #    GNU Affero General Public License for more details.
   16 #
   17 #    You should have received a copy of the
   18 #               GNU Affero General Public License
   19 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
   20 #
   21 #
   22 #    E-mail: linotp@keyidentity.com
   23 #    Contact: www.linotp.org
   24 #    Support: www.keyidentity.com
   25 #
   26 """
   27     helper to manage the pylons global object
   28 """
   29 
   30 from linotp.config import environment as env
   31 
   32 global_object = env.config.get('pylons.app_globals', env.config.get(
   33                                 'pylons.g'))
   34 
   35 
   36 def getGlobalObject():
   37     return global_object
   38 
   39 
   40 def _getConfigReadLock():
   41     getGlobalObject().setConfigReadLock()
   42 
   43 
   44 def _getConfigWriteLock():
   45     getGlobalObject().setConfigWriteLock()
   46 
   47 
   48 def _releaseConfigLock():
   49     getGlobalObject().releaseConfigLock()
   50 
   51 # eof #