|
OpenQuizz
Une application de gestion des contenus pédagogiques
|
Data Structures | |
| class | _RandomAccessBytesIO |
| class | LazyMixin |
| class | LockedFD |
Functions | |
| def | unpack_from (fmt, data, offset=0) |
| def | remove (*args, **kwargs) |
| def | byte_ord (b) |
| def | make_sha (source=''.encode("ascii")) |
| def | allocate_memory (size) |
| def | file_contents_ro (fd, stream=False, allow_mmap=True) |
| def | file_contents_ro_filepath (filepath, stream=False, allow_mmap=True, flags=0) |
| def | sliding_ro_buffer (filepath, flags=0) |
| def | to_hex_sha (sha) |
| def | to_bin_sha (sha) |
Variables | |
| mman | |
| hex_to_bin | |
| bin_to_hex | |
| ENOENT | |
| exists | |
| mkdir | |
| chmod | |
| isdir | |
| isfile | |
| rename | |
| dirname | |
| basename | |
| join | |
| read | |
| write | |
| close | |
| fsync | |
| def gitdb.util.allocate_memory | ( | size | ) |
:return: a file-protocol accessible memory block of the given size
| def gitdb.util.byte_ord | ( | b | ) |
Return the integer representation of the byte string. This supports Python 3 byte arrays as well as standard strings.
| def gitdb.util.file_contents_ro | ( | fd, | |
stream = False, |
|||
allow_mmap = True |
|||
| ) |
:return: read-only contents of the file represented by the file descriptor fd
:param fd: file descriptor opened for reading
:param stream: if False, random access is provided, otherwise the stream interface
is provided.
:param allow_mmap: if True, its allowed to map the contents into memory, which
allows large files to be handled and accessed efficiently. The file-descriptor
will change its position if this is False
| def gitdb.util.file_contents_ro_filepath | ( | filepath, | |
stream = False, |
|||
allow_mmap = True, |
|||
flags = 0 |
|||
| ) |
Get the file contents at filepath as fast as possible :return: random access compatible memory of the given filepath :param stream: see ``file_contents_ro`` :param allow_mmap: see ``file_contents_ro`` :param flags: additional flags to pass to os.open :raise OSError: If the file could not be opened **Note** for now we don't try to use O_NOATIME directly as the right value needs to be shared per database in fact. It only makes a real difference for loose object databases anyway, and they use it with the help of the ``flags`` parameter
| def gitdb.util.make_sha | ( | source = ''.encode("ascii") | ) |
A python2.4 workaround for the sha/hashlib module fiasco **Note** From the dulwich project
| def gitdb.util.remove | ( | * | args, |
| ** | kwargs | ||
| ) |
| def gitdb.util.sliding_ro_buffer | ( | filepath, | |
flags = 0 |
|||
| ) |
:return: a buffer compatible object which uses our mapped memory manager internally
ready to read the whole given filepath
| def gitdb.util.to_bin_sha | ( | sha | ) |
| def gitdb.util.to_hex_sha | ( | sha | ) |
:return: hexified version of sha
| def gitdb.util.unpack_from | ( | fmt, | |
| data, | |||
offset = 0 |
|||
| ) |
| basename |
| bin_to_hex |
| chmod |
| close |
| dirname |
| ENOENT |
| exists |
| fsync |
| hex_to_bin |
| isdir |
| isfile |
| join |
| mkdir |
| mman |
| read |
| rename |
| write |