~ubuntu-branches/ubuntu/wily/attic/wily

« back to all changes in this revision

Viewing changes to attic/hashindex.pyx

  • Committer: Package Import Robot
  • Author(s): Clint Adams
  • Date: 2013-11-25 09:06:12 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20131125090612-hp1yitu1qnpbuaq7
Tags: 0.8.1-1
* New upstream version.
* Bump to Standards-Version 3.9.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
    ctypedef struct HashIndex:
7
7
        pass
8
8
 
9
 
    HashIndex *hashindex_open(char *path)
 
9
    HashIndex *hashindex_open(char *path, int readonly)
10
10
    HashIndex *hashindex_create(char *path, int capacity, int key_size, int value_size)
11
11
    int hashindex_get_size(HashIndex *index)
12
12
    int hashindex_clear(HashIndex *index)
24
24
    cdef HashIndex *index
25
25
    key_size = 32
26
26
 
27
 
    def __cinit__(self, path):
28
 
        self.index = hashindex_open(<bytes>os.fsencode(path))
 
27
    def __cinit__(self, path, readonly=False):
 
28
        self.index = hashindex_open(<bytes>os.fsencode(path), readonly)
29
29
        if not self.index:
30
30
            raise Exception('Failed to open %s' % path)
31
31