141
140
% (self._module, self._name))
142
141
use_msg = ' Use %s.%s instead.' % (self._replacement_module,
143
142
self._replacement_name)
144
symbol_versioning.warn(depr_msg + use_msg, DeprecationWarning)
143
symbol_versioning.warn(depr_msg + use_msg, DeprecationWarning,
145
145
# Import the new feature and use it as a replacement for the
146
146
# deprecated one.
147
147
self._feature = pyutils.get_named_object(
290
290
if CaseInsCasePresFilenameFeature.available():
293
from bzrlib import tests
293
295
if tests.TestCaseWithMemoryTransport.TEST_ROOT is None:
294
296
root = osutils.mkdtemp(prefix='testbzr-', suffix='.tmp')
295
297
tests.TestCaseWithMemoryTransport.TEST_ROOT = root
346
348
apport = ModuleAvailableFeature('apport')
347
349
gpgme = ModuleAvailableFeature('gpgme')
348
350
lzma = ModuleAvailableFeature('lzma')
349
meliae = ModuleAvailableFeature('meliae')
351
meliae = ModuleAvailableFeature('meliae.scanner')
350
352
paramiko = ModuleAvailableFeature('paramiko')
351
353
pycurl = ModuleAvailableFeature('pycurl')
352
354
pywintypes = ModuleAvailableFeature('pywintypes')
353
sphinx = ModuleAvailableFeature('sphinx')
354
355
subunit = ModuleAvailableFeature('subunit')
355
356
testtools = ModuleAvailableFeature('testtools')
357
358
compiled_patiencediff_feature = ModuleAvailableFeature(
358
359
'bzrlib._patiencediff_c')
359
meliae_feature = ModuleAvailableFeature('meliae.scanner')
360
360
lsprof_feature = ModuleAvailableFeature('bzrlib.lsprof')
410
410
bash_feature = ExecutableFeature('bash')
411
diff_feature = ExecutableFeature('diff')
411
412
sed_feature = ExecutableFeature('sed')
412
diff_feature = ExecutableFeature('diff')
413
msgmerge_feature = ExecutableFeature('msgmerge')
415
416
class _PosixPermissionsFeature(Feature):
422
423
f = tempfile.mkstemp(prefix='bzr_perms_chk_')
425
os.chmod(name, write_perms)
426
osutils.chmod_if_possible(name, write_perms)
427
428
read_perms = os.stat(name).st_mode & 0777
493
494
win32_feature = Win32Feature()
496
for name in ['HTTPServerFeature',
497
'HTTPSServerFeature', 'SymlinkFeature', 'HardlinkFeature',
498
'OsFifoFeature', 'UnicodeFilenameFeature',
499
'ByteStringNamedFilesystem', 'UTF8Filesystem',
500
'BreakinFeature', 'CaseInsCasePresFilenameFeature',
501
'CaseInsensitiveFilesystemFeature', 'case_sensitive_filesystem_feature',
502
'posix_permissions_feature',
504
setattr(tests, name, _CompatabilityThunkFeature(
505
symbol_versioning.deprecated_in((2, 5, 0)),
506
'bzrlib.tests', name,
507
name, 'bzrlib.tests.features'))
510
for (old_name, new_name) in [
511
('UnicodeFilename', 'UnicodeFilenameFeature'),
513
setattr(tests, name, _CompatabilityThunkFeature(
514
symbol_versioning.deprecated_in((2, 5, 0)),
515
'bzrlib.tests', old_name,
516
new_name, 'bzrlib.tests.features'))
497
class _ColorFeature(Feature):
500
from bzrlib._termcolor import allow_color
503
def feature_name(self):
504
return "Terminal supports color."
506
ColorFeature = _ColorFeature()