def _qbzr_run(self, acceptable_keys=None, revision=None, location=CUR_DIR): if gpg.GPGStrategy.verify_signatures_available(): window = QBzrVerifySignaturesWindow(acceptable_keys, revision, location) window.show() self._application.exec_() else: raise errors.DependencyNotPresent("python-gpgme", "python-gpgme not installed")
def __init__(self, base, _from_transport=None): super(PyCurlTransport, self).__init__(base, _from_transport=_from_transport) if base.startswith('https'): # Check availability of https into pycurl supported # protocols supported = pycurl.version_info()[8] if 'https' not in supported: raise errors.DependencyNotPresent('pycurl', 'no https support') self.cabundle = ca_bundle.get_ca_path()
def tar_lzma_exporter_generator(tree, dest, root, subdir, force_mtime=None, fileobj=None, compression_format="alone"): """Export this tree to a new .tar.lzma file. `dest` will be created holding the contents of this tree; if it already exists, it will be clobbered, like with "tar -c". """ if dest == '-': raise errors.BzrError("Writing to stdout not supported for .tar.lzma") if fileobj is not None: raise errors.BzrError( "Writing to fileobject not supported for .tar.lzma") try: import lzma except ImportError, e: raise errors.DependencyNotPresent('lzma', e)
deprecated_passed, warn, ) from bzrlib.trace import mutter from bzrlib.transport import ( FileStream, ConnectedTransport, _file_streams, ) from bzrlib.tests.test_server import TestServer try: import glib except ImportError, e: raise errors.DependencyNotPresent('glib', e) try: import gio except ImportError, e: raise errors.DependencyNotPresent('gio', e) class GioLocalURLServer(TestServer): """A pretend server for local transports, using file:// urls. Of course no actual server is required to access the local filesystem, so this just exists to tell the test code how to get to it. """ def start_server(self): pass
trace, __version__ as bzrlib_version, ) import bzrlib from bzrlib.trace import mutter from bzrlib.transport.http import ( ca_bundle, HttpTransportBase, response, ) try: import pycurl except ImportError, e: mutter("failed to import pycurl: %s", e) raise errors.DependencyNotPresent('pycurl', e) try: # see if we can actually initialize PyCurl - sometimes it will load but # fail to start up due to this bug: # # 32. (At least on Windows) If libcurl is built with c-ares and there's # no DNS server configured in the system, the ares_init() call fails and # thus curl_easy_init() fails as well. This causes weird effects for # people who use numerical IP addresses only. # # reported by Alexander Belchenko, 2006-04-26 pycurl.Curl() except pycurl.error, e: mutter("failed to initialize pycurl: %s", e) raise errors.DependencyNotPresent('pycurl', e)
from bzrlib import ( branch, config, errors, osutils, trace, transport, ) from bzrlib.i18n import gettext from bzrlib.plugins.launchpad.lp_registration import ( InvalidLaunchpadInstance, ) try: import launchpadlib except ImportError, e: raise errors.DependencyNotPresent('launchpadlib', e) from launchpadlib.launchpad import ( STAGING_SERVICE_ROOT, Launchpad, ) from launchpadlib import uris # Declare the minimum version of launchpadlib that we need in order to work. # 1.6.0 is the version of launchpadlib packaged in Ubuntu 10.04, the most # recent Ubuntu LTS release supported on the desktop at the time of writing. MINIMUM_LAUNCHPADLIB_VERSION = (1, 6, 0) def get_cache_directory(): """Return the directory to cache launchpadlib objects in."""
import base64, ftplib from bzrlib import ( errors, ) from bzrlib.i18n import gettext from bzrlib.trace import ( mutter, note, ) from bzrlib.transport.ftp import FtpTransport try: import kerberos except ImportError, e: mutter('failed to import kerberos lib: %s', e) raise errors.DependencyNotPresent('kerberos', e) if getattr(kerberos, "authGSSClientWrap", None) is None: raise errors.DependencyNotPresent( 'kerberos', "missing encryption function authGSSClientWrap") class GSSAPIFtp(ftplib.FTP): """Extended version of ftplib.FTP that can authenticate using GSSAPI.""" def mic_putcmd(self, line): rc = kerberos.authGSSClientWrap(self.vc, base64.b64encode(line)) wrapped = kerberos.authGSSClientResponse(self.vc) ftplib.FTP.putcmd(self, "MIC " + wrapped) def mic_getline(self): resp = ftplib.FTP.getline(self)
def __init__(self, base_url): raise errors.DependencyNotPresent('some_lib', 'testing missing dependency')