Python werkzeug.datastructures.CallbackDict.__init__() Examples

The following are 30 code examples of werkzeug.datastructures.CallbackDict.__init__(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module werkzeug.datastructures.CallbackDict , or try the search function .
Example #1
Source File: sessions.py    From arithmancer with Apache License 2.0 5 votes vote down vote up
def __init__(self, initial=None):
        def on_update(self):
            self.modified = True
        CallbackDict.__init__(self, initial, on_update)
        self.modified = False 
Example #2
Source File: sessions.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, path=None, filename_template='werkzeug_%s.sess',
                 session_class=None, renew_missing=False, mode=0o644):
        SessionStore.__init__(self, session_class)
        if path is None:
            path = tempfile.gettempdir()
        self.path = path
        if isinstance(filename_template, text_type) and PY2:
            filename_template = filename_template.encode(
                get_filesystem_encoding())
        assert not filename_template.endswith(_fs_transaction_suffix), \
            'filename templates may not end with %s' % _fs_transaction_suffix
        self.filename_template = filename_template
        self.renew_missing = renew_missing
        self.mode = mode 
Example #3
Source File: sessions.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, session_class=None):
        if session_class is None:
            session_class = Session
        self.session_class = session_class 
Example #4
Source File: sessions.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        def on_update(self):
            self.modified = True
        self.modified = False
        CallbackDict.__init__(self, on_update=on_update)
        dict.update(self, *args, **kwargs) 
Example #5
Source File: sessions.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, data, sid, new=False):
        ModificationTrackingDict.__init__(self, data)
        self.sid = sid
        self.new = new 
Example #6
Source File: sessions.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, initial=None):
        def on_update(self):
            self.modified = True
        CallbackDict.__init__(self, initial, on_update)
        self.modified = False 
Example #7
Source File: sessions.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, data, sid, new=False):
        ModificationTrackingDict.__init__(self, data)
        self.sid = sid
        self.new = new 
Example #8
Source File: sessions.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        def on_update(self):
            self.modified = True
        self.modified = False
        CallbackDict.__init__(self, on_update=on_update)
        dict.update(self, *args, **kwargs) 
Example #9
Source File: sessions.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, initial=None):
        def on_update(self):
            self.modified = True
        CallbackDict.__init__(self, initial, on_update)
        self.modified = False 
Example #10
Source File: sessions.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, path=None, filename_template='werkzeug_%s.sess',
                 session_class=None, renew_missing=False, mode=0o644):
        SessionStore.__init__(self, session_class)
        if path is None:
            path = tempfile.gettempdir()
        self.path = path
        if isinstance(filename_template, text_type) and PY2:
            filename_template = filename_template.encode(
                get_filesystem_encoding())
        assert not filename_template.endswith(_fs_transaction_suffix), \
            'filename templates may not end with %s' % _fs_transaction_suffix
        self.filename_template = filename_template
        self.renew_missing = renew_missing
        self.mode = mode 
Example #11
Source File: sessions.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, session_class=None):
        if session_class is None:
            session_class = Session
        self.session_class = session_class 
Example #12
Source File: sessions.py    From arithmancer with Apache License 2.0 5 votes vote down vote up
def __init__(self, path=None, filename_template='werkzeug_%s.sess',
                 session_class=None, renew_missing=False, mode=0o644):
        SessionStore.__init__(self, session_class)
        if path is None:
            path = tempfile.gettempdir()
        self.path = path
        if isinstance(filename_template, text_type) and PY2:
            filename_template = filename_template.encode(
                sys.getfilesystemencoding() or 'utf-8')
        assert not filename_template.endswith(_fs_transaction_suffix), \
            'filename templates may not end with %s' % _fs_transaction_suffix
        self.filename_template = filename_template
        self.renew_missing = renew_missing
        self.mode = mode 
Example #13
Source File: sessions.py    From arithmancer with Apache License 2.0 5 votes vote down vote up
def __init__(self, session_class=None):
        if session_class is None:
            session_class = Session
        self.session_class = session_class 
Example #14
Source File: sessions.py    From arithmancer with Apache License 2.0 5 votes vote down vote up
def __init__(self, data, sid, new=False):
        ModificationTrackingDict.__init__(self, data)
        self.sid = sid
        self.new = new 
Example #15
Source File: sessions.py    From arithmancer with Apache License 2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        def on_update(self):
            self.modified = True
        self.modified = False
        CallbackDict.__init__(self, on_update=on_update)
        dict.update(self, *args, **kwargs) 
Example #16
Source File: __init__.py    From CTFd with Apache License 2.0 5 votes vote down vote up
def __init__(self, initial=None, sid=None, permanent=None):
        def on_update(self):
            self.modified = True

        CallbackDict.__init__(self, initial, on_update)
        self.sid = sid
        if permanent:
            self.permanent = permanent
        self.modified = False 
Example #17
Source File: sessions.py    From syntheticmass with Apache License 2.0 5 votes vote down vote up
def __init__(self, path=None, filename_template='werkzeug_%s.sess',
                 session_class=None, renew_missing=False, mode=0o644):
        SessionStore.__init__(self, session_class)
        if path is None:
            path = tempfile.gettempdir()
        self.path = path
        if isinstance(filename_template, text_type) and PY2:
            filename_template = filename_template.encode(
                get_filesystem_encoding())
        assert not filename_template.endswith(_fs_transaction_suffix), \
            'filename templates may not end with %s' % _fs_transaction_suffix
        self.filename_template = filename_template
        self.renew_missing = renew_missing
        self.mode = mode 
Example #18
Source File: sessions.py    From syntheticmass with Apache License 2.0 5 votes vote down vote up
def __init__(self, session_class=None):
        if session_class is None:
            session_class = Session
        self.session_class = session_class 
Example #19
Source File: sessions.py    From syntheticmass with Apache License 2.0 5 votes vote down vote up
def __init__(self, data, sid, new=False):
        ModificationTrackingDict.__init__(self, data)
        self.sid = sid
        self.new = new 
Example #20
Source File: sessions.py    From syntheticmass with Apache License 2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        def on_update(self):
            self.modified = True
        self.modified = False
        CallbackDict.__init__(self, on_update=on_update)
        dict.update(self, *args, **kwargs) 
Example #21
Source File: sessions.py    From syntheticmass with Apache License 2.0 5 votes vote down vote up
def __init__(self, initial=None):
        def on_update(self):
            self.modified = True
        CallbackDict.__init__(self, initial, on_update)
        self.modified = False 
Example #22
Source File: sessions.py    From cloud-playground with Apache License 2.0 5 votes vote down vote up
def __init__(self, path=None, filename_template='werkzeug_%s.sess',
                 session_class=None, renew_missing=False, mode=0o644):
        SessionStore.__init__(self, session_class)
        if path is None:
            path = tempfile.gettempdir()
        self.path = path
        if isinstance(filename_template, text_type) and PY2:
            filename_template = filename_template.encode(
                sys.getfilesystemencoding() or 'utf-8')
        assert not filename_template.endswith(_fs_transaction_suffix), \
            'filename templates may not end with %s' % _fs_transaction_suffix
        self.filename_template = filename_template
        self.renew_missing = renew_missing
        self.mode = mode 
Example #23
Source File: sessions.py    From cloud-playground with Apache License 2.0 5 votes vote down vote up
def __init__(self, session_class=None):
        if session_class is None:
            session_class = Session
        self.session_class = session_class 
Example #24
Source File: sessions.py    From cloud-playground with Apache License 2.0 5 votes vote down vote up
def __init__(self, data, sid, new=False):
        ModificationTrackingDict.__init__(self, data)
        self.sid = sid
        self.new = new 
Example #25
Source File: sessions.py    From cloud-playground with Apache License 2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        def on_update(self):
            self.modified = True
        self.modified = False
        CallbackDict.__init__(self, on_update=on_update)
        dict.update(self, *args, **kwargs) 
Example #26
Source File: sessions.py    From cloud-playground with Apache License 2.0 5 votes vote down vote up
def __init__(self, initial=None):
        def on_update(self):
            self.modified = True
        CallbackDict.__init__(self, initial, on_update)
        self.modified = False 
Example #27
Source File: redissession.py    From analytics-quarry-web with MIT License 5 votes vote down vote up
def __init__(self, redis=None, prefix='session:'):
        if redis is None:
            redis = Redis()
        self.redis = redis
        self.prefix = prefix 
Example #28
Source File: redissession.py    From analytics-quarry-web with MIT License 5 votes vote down vote up
def __init__(self, initial=None, sid=None, new=False):
        def on_update(self):
            self.modified = True
        CallbackDict.__init__(self, initial, on_update)
        self.sid = sid
        self.new = new
        self.modified = False 
Example #29
Source File: sessions.py    From PhonePi_SampleServer with MIT License 5 votes vote down vote up
def __init__(self, path=None, filename_template='werkzeug_%s.sess',
                 session_class=None, renew_missing=False, mode=0o644):
        SessionStore.__init__(self, session_class)
        if path is None:
            path = tempfile.gettempdir()
        self.path = path
        if isinstance(filename_template, text_type) and PY2:
            filename_template = filename_template.encode(
                get_filesystem_encoding())
        assert not filename_template.endswith(_fs_transaction_suffix), \
            'filename templates may not end with %s' % _fs_transaction_suffix
        self.filename_template = filename_template
        self.renew_missing = renew_missing
        self.mode = mode 
Example #30
Source File: sessions.py    From PhonePi_SampleServer with MIT License 5 votes vote down vote up
def __init__(self, session_class=None):
        if session_class is None:
            session_class = Session
        self.session_class = session_class