File: base_backend.py

package info (click to toggle)
python-bottle-cork 0.12.0-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 936 kB
  • sloc: python: 6,862; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 752 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Cork - Authentication module for the Bottle web framework
# Copyright (C) 2013 Federico Ceratto and others, see AUTHORS file.
# Released under LGPLv3+ license, see LICENSE.txt

"""
.. module:: backend.py
   :synopsis: Base Backend.
"""

class BackendIOException(Exception):
    """Generic Backend I/O Exception"""
    pass

def ni(*args, **kwargs):
    raise NotImplementedError

class Backend(object):
    """Base Backend class - to be subclassed by real backends."""
    save_users = ni
    save_roles = ni
    save_pending_registrations = ni

class Table(object):
    """Base Table class - to be subclassed by real backends."""
    __len__ = ni
    __contains__ = ni
    __setitem__ = ni
    __getitem__ = ni
    __iter__ = ni
    iteritems = ni