pybsddb with cffi

Check-in [d0861fc808]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added `DBPermissionsError`
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d0861fc8080b9f501096ba7edc6fffc0c7699160
User & Date: broker-3 2013-02-28 14:58:54
Context
2013-03-01
10:49
Minimal setup.py - testing check-in: 45d702784c user: broker-3 tags: trunk
2013-02-28
14:58
Added `DBPermissionsError` check-in: d0861fc808 user: broker-3 tags: trunk
2013-02-07
15:12
Corrected exception check-in: 39064e3640 user: broker-3 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to bsddb3/db.py.

75
76
77
78
79
80
81




82
83
84
85
86
87
88
89
90
91

92
93
94
95
96
97
98
class DBNoMemoryError(DBError):
    pass


class DBRepUnavailError(DBError):
    pass






def check_error(err):
    if err:
        klass = check_error.errors.get(err, DBError)
        raise klass(err, ffi.string(C.db_strerror(err)))

    assert not err, 'DB_ENV error: %d' % err
check_error.errors = {
    EINVAL: DBInvalidArgError,
    ENOENT: DBNoSuchFileError,

    DB_NOTFOUND: DBNotFoundError,
    DB_KEYEXIST: DBKeyExistError,
    DB_KEYEMPTY: DBKeyEmptyError,
    DB_LOCK_DEADLOCK: DBLockDeadlockError,
    DB_LOCK_NOTGRANTED: DBLockNotGrantedError,
    DB_BUFFER_SMALL: DBNoMemoryError,
    DB_REP_UNAVAIL: DBRepUnavailError,







>
>
>
>










>







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
class DBNoMemoryError(DBError):
    pass


class DBRepUnavailError(DBError):
    pass


class DBPermissionsError(DBError):
    pass


def check_error(err):
    if err:
        klass = check_error.errors.get(err, DBError)
        raise klass(err, ffi.string(C.db_strerror(err)))

    assert not err, 'DB_ENV error: %d' % err
check_error.errors = {
    EINVAL: DBInvalidArgError,
    ENOENT: DBNoSuchFileError,
    EPERM: DBPermissionsError,
    DB_NOTFOUND: DBNotFoundError,
    DB_KEYEXIST: DBKeyExistError,
    DB_KEYEMPTY: DBKeyEmptyError,
    DB_LOCK_DEADLOCK: DBLockDeadlockError,
    DB_LOCK_NOTGRANTED: DBLockNotGrantedError,
    DB_BUFFER_SMALL: DBNoMemoryError,
    DB_REP_UNAVAIL: DBRepUnavailError,