1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 01:06:50 +00:00

rename cython detection function

"have" has clearer semantics than "detect"
This commit is contained in:
Antoine Beaupré 2015-10-08 15:34:44 -04:00
parent 7ba4d47f6e
commit 423ff45d81
5 changed files with 10 additions and 10 deletions

View file

@ -13,8 +13,8 @@
from io import BytesIO
from . import xattr
from .helpers import parse_timestamp, Error, uid2user, user2uid, gid2group, group2gid, \
Manifest, Statistics, decode_dict, st_mtime_ns, make_path_safe, StableDict, int_to_bigint, bigint_to_int, detect_cython
if detect_cython():
Manifest, Statistics, decode_dict, st_mtime_ns, make_path_safe, StableDict, int_to_bigint, bigint_to_int, have_cython
if have_cython():
from .platform import acl_get, acl_set
from .chunker import Chunker
from .hashindex import ChunkIndex

View file

@ -19,8 +19,8 @@
format_file_mode, ExcludePattern, IncludePattern, exclude_path, adjust_patterns, to_localtime, timestamp, \
get_cache_dir, get_keys_dir, format_timedelta, prune_within, prune_split, \
Manifest, remove_surrogates, update_excludes, format_archive, check_extension_modules, Statistics, \
is_cachedir, bigint_to_int, ChunkerParams, CompressionSpec, detect_cython
if detect_cython():
is_cachedir, bigint_to_int, ChunkerParams, CompressionSpec, have_cython
if have_cython():
from .compress import Compressor, COMPR_BUFFER
from .upgrader import AtticRepositoryUpgrader
from .repository import Repository

View file

@ -18,7 +18,7 @@
import msgpack
def detect_cython():
def have_cython():
"""allow for a way to disable Cython includes
this is used during usage docs build, in setup.py. It is to avoid
@ -33,7 +33,7 @@ def detect_cython():
"""
return not os.environ.get('BORG_CYTHON_DISABLE')
if detect_cython():
if have_cython():
from . import hashindex
from . import chunker
from . import crypto

View file

@ -7,8 +7,8 @@
import hmac
from hashlib import sha256
from .helpers import IntegrityError, get_keys_dir, Error, detect_cython
if detect_cython():
from .helpers import IntegrityError, get_keys_dir, Error, have_cython
if have_cython():
from .crypto import pbkdf2_sha256, get_random_bytes, AES, bytes_to_long, long_to_bytes, bytes_to_int, num_aes_blocks
from .compress import Compressor, COMPR_BUFFER

View file

@ -8,8 +8,8 @@
import sys
from zlib import crc32
from .helpers import Error, IntegrityError, read_msgpack, write_msgpack, unhexlify, detect_cython
if detect_cython():
from .helpers import Error, IntegrityError, read_msgpack, write_msgpack, unhexlify, have_cython
if have_cython():
from .hashindex import NSIndex
from .locking import UpgradableLock
from .lrucache import LRUCache