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 @@ import time
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 @@ from .helpers import Error, location_validator, format_time, format_file_size, \
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 @@ from operator import attrgetter
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 textwrap
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 struct
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