~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/features.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
                                            % (self._module, self._name))
141
141
            use_msg = ' Use %s.%s instead.' % (self._replacement_module,
142
142
                                               self._replacement_name)
143
 
            symbol_versioning.warn(depr_msg + use_msg, DeprecationWarning)
 
143
            symbol_versioning.warn(depr_msg + use_msg, DeprecationWarning,
 
144
                                   stacklevel=5)
144
145
            # Import the new feature and use it as a replacement for the
145
146
            # deprecated one.
146
147
            self._feature = pyutils.get_named_object(
351
352
paramiko = ModuleAvailableFeature('paramiko')
352
353
pycurl = ModuleAvailableFeature('pycurl')
353
354
pywintypes = ModuleAvailableFeature('pywintypes')
354
 
sphinx = ModuleAvailableFeature('sphinx')
355
355
subunit = ModuleAvailableFeature('subunit')
356
356
testtools = ModuleAvailableFeature('testtools')
357
357
 
408
408
 
409
409
 
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')
413
414
 
414
415
 
415
416
class _PosixPermissionsFeature(Feature):
422
423
            f = tempfile.mkstemp(prefix='bzr_perms_chk_')
423
424
            fd, name = f
424
425
            os.close(fd)
425
 
            os.chmod(name, write_perms)
 
426
            osutils.chmod_if_possible(name, write_perms)
426
427
 
427
428
            read_perms = os.stat(name).st_mode & 0777
428
429
            os.unlink(name)
491
492
 
492
493
 
493
494
win32_feature = Win32Feature()
 
495
 
 
496
 
 
497
class _ColorFeature(Feature):
 
498
 
 
499
    def _probe(self):
 
500
        from bzrlib._termcolor import allow_color
 
501
        return allow_color()
 
502
 
 
503
    def feature_name(self):
 
504
        return "Terminal supports color."
 
505
 
 
506
ColorFeature = _ColorFeature()