wcs/wcs/qommon/__init__.py

46 lines
1.7 KiB
Python

# w.c.s. - web application for online forms
# Copyright (C) 2005-2010 Entr'ouvert
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
from quixote import get_publisher
from publisher import get_cfg, get_logger
try:
import lasso
except ImportError:
lasso = None
if lasso:
if not hasattr(lasso, 'SAML2_SUPPORT'):
lasso.SAML2_SUPPORT = False
if not hasattr(lasso, 'SAML2_NAME_IDENTIFIER_FORMAT_EMAIL'):
lasso.SAML2_NAME_IDENTIFIER_FORMAT_EMAIL = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'
if not hasattr(lasso, 'SAML2_NAME_IDENTIFIER_FORMAT_UNSPECIFIED'):
lasso.SAML2_NAME_IDENTIFIER_FORMAT_EMAIL = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified'
if not hasattr(lasso, 'cptrToPy') and not hasattr(lasso, 'OrigProvider'):
lasso.OrigProvider = lasso.Provider
# old (SWIG) bindings
class Provider(lasso.OrigProvider):
def __init__(self, *args):
lasso.OrigProvider.__init__(self, *args)
if self.this is None:
raise lasso.Error('Error creating Provider')
lasso.Provider = Provider
from vendor import timeoutsocket
__version__ = "$Rev$"