~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_chk_map_pyx.pyx

messy but working.

Start exposing the C API using a nice python dict, rather than offsets into an array.
This is much more convenient and allows a small amount of api skew without
serious problems. It also allows some safety checks to be performed during
import.


Mostly we just need to clean up the code a bit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
 
62
62
# It seems we need to import the definitions so that the pyrex compiler has
63
63
# local names to access them.
64
 
from _static_tuple_c cimport StaticTuple, StaticTuple_API,\
65
 
    import_static_tuple, STATIC_TUPLE_ALL_STRING, StaticTuple_New, \
 
64
from _static_tuple_c cimport StaticTuple,\
 
65
    import_static_tuple_c, STATIC_TUPLE_ALL_STRING, StaticTuple_New, \
66
66
    StaticTuple_intern, StaticTuple_SET_ITEM, StaticTuple_CheckExact
67
67
 
68
68
 
69
69
from bzrlib import _static_tuple_c
70
70
# This sets up the StaticTuple C_API functionality
71
 
if import_static_tuple() == -1 or StaticTuple_API == NULL:
72
 
    raise ImportError('failed to import_static_tuple()')
 
71
if import_static_tuple_c() != 0:
 
72
    raise ImportError('der borken')
73
73
 
74
74
cdef object _LeafNode
75
75
_LeafNode = None