當前位置: 首頁>>代碼示例>>Python>>正文


Python storage.Settings方法代碼示例

本文整理匯總了Python中gluon.storage.Settings方法的典型用法代碼示例。如果您正苦於以下問題:Python storage.Settings方法的具體用法?Python storage.Settings怎麽用?Python storage.Settings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gluon.storage的用法示例。


在下文中一共展示了storage.Settings方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from gluon import storage [as 別名]
# 或者: from gluon.storage import Settings [as 別名]
def __init__(self, server=None, sender=None, login=None, tls=True):

        settings = self.settings = Settings()
        settings.server = server
        settings.sender = sender
        settings.login = login
        settings.tls = tls
        settings.timeout = 5  # seconds
        settings.hostname = None
        settings.ssl = False
        settings.cipher_type = None
        settings.gpg_home = None
        settings.sign = True
        settings.sign_passphrase = None
        settings.encrypt = True
        settings.x509_sign_keyfile = None
        settings.x509_sign_certfile = None
        settings.x509_sign_chainfile = None
        settings.x509_nocerts = False
        settings.x509_crypt_certfiles = None
        settings.debug = False
        settings.lock_keys = True
        self.result = {}
        self.error = None 
開發者ID:HackPucBemobi,項目名稱:touch-pay-client,代碼行數:26,代碼來源:tools.py

示例2: __init__

# 需要導入模塊: from gluon import storage [as 別名]
# 或者: from gluon.storage import Settings [as 別名]
def __init__(self, server=None, sender=None, login=None, tls=True):

        settings = self.settings = Settings()
        settings.server = server
        settings.sender = sender
        settings.login = login
        settings.tls = tls
        settings.timeout = 60  # seconds
        settings.hostname = None
        settings.ssl = False
        settings.cipher_type = None
        settings.gpg_home = None
        settings.sign = True
        settings.sign_passphrase = None
        settings.encrypt = True
        settings.x509_sign_keyfile = None
        settings.x509_sign_certfile = None
        settings.x509_sign_chainfile = None
        settings.x509_nocerts = False
        settings.x509_crypt_certfiles = None
        settings.debug = False
        settings.lock_keys = True
        self.result = {}
        self.error = None 
開發者ID:lucadealfaro,項目名稱:true_review_web2py,代碼行數:26,代碼來源:tools.py

示例3: __init__

# 需要導入模塊: from gluon import storage [as 別名]
# 或者: from gluon.storage import Settings [as 別名]
def __init__(self, server=None, sender=None, login=None, tls=True):

        settings = self.settings = Settings()
        settings.server = server
        settings.sender = sender
        settings.login = login
        settings.tls = tls
        settings.hostname = None
        settings.ssl = False
        settings.cipher_type = None
        settings.gpg_home = None
        settings.sign = True
        settings.sign_passphrase = None
        settings.encrypt = True
        settings.x509_sign_keyfile = None
        settings.x509_sign_certfile = None
        settings.x509_sign_chainfile = None
        settings.x509_nocerts = False
        settings.x509_crypt_certfiles = None
        settings.debug = False
        settings.lock_keys = True
        self.result = {}
        self.error = None 
開發者ID:StuffShare,項目名稱:StuffShare,代碼行數:25,代碼來源:tools.py

示例4: __init__

# 需要導入模塊: from gluon import storage [as 別名]
# 或者: from gluon.storage import Settings [as 別名]
def __init__(self, db=None, hmac_key=None, signature=True):
        self.db = db
        session = current.session
        auth = session.auth
        self.user_groups = auth and auth.user_groups or {}
        now = current.request.now
        # if we have auth info
        #    if not expired it, used it
        #    if expired, clear the session
        # else, only clear auth info in the session
        if auth:
            delta = datetime.timedelta(days=0, seconds=auth.expiration)
            if auth.last_visit and auth.last_visit + delta > now:
                self.user = auth.user
                # this is a trick to speed up sessions to avoid many writes
                if (now - auth.last_visit).seconds > (auth.expiration // 10):
                    auth.last_visit = now
            else:
                self.user = None
                if session.auth:
                    del session.auth
                session.renew(clear_session=True)
        else:
            self.user = None
            if session.auth:
                del session.auth

        settings = self.settings = Settings(self.__class__.default_settings)
        settings.update(
            extra_fields={},
            hmac_key=hmac_key,
        )
        settings.lock_keys = True
        messages = self.messages = Messages(current.T)
        messages.update(self.default_messages)
        messages.lock_keys = True
        if signature is True:
            self.define_signature()
        else:
            self.signature = signature or None 
開發者ID:HackPucBemobi,項目名稱:touch-pay-client,代碼行數:42,代碼來源:authapi.py


注:本文中的gluon.storage.Settings方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。