b.__init__ : module documentation

Part of bzrlib

All of bzr.

Developer documentation is available at http://doc.bazaar.canonical.com/bzr.dev/developers/

The project website is at http://bazaar.canonical.com/

Some particularly interesting things in bzrlib are:

We hope you enjoy this library.

Function initialize Set up everything needed for normal use of bzrlib.
Function test_suite Undocumented
Function _format_version_tuple Turn a version number 2, 3 or 5-tuple into a short string.
def _format_version_tuple(version_info):

Turn a version number 2, 3 or 5-tuple into a short string.

This format matches <http://docs.python.org/dist/meta-data.html> and the typical presentation used in Python output.

This also checks that the version is reasonable: the sub-release must be zero for final releases.

>>> print _format_version_tuple((1, 0, 0, 'final', 0))
1.0.0
>>> print _format_version_tuple((1, 2, 0, 'dev', 0))
1.2.0dev
>>> print _format_version_tuple((1, 2, 0, 'dev', 1))
1.2.0dev1
>>> print _format_version_tuple((1, 1, 1, 'candidate', 2))
1.1.1rc2
>>> print _format_version_tuple((2, 1, 0, 'beta', 1))
2.1b1
>>> print _format_version_tuple((1, 4, 0))
1.4.0
>>> print _format_version_tuple((1, 4))
1.4
>>> print _format_version_tuple((2, 1, 0, 'final', 42))
2.1.0.42
>>> print _format_version_tuple((1, 4, 0, 'wibble', 0))
1.4.0.wibble.0
def initialize(setup_ui=True, stdin=None, stdout=None, stderr=None):
Set up everything needed for normal use of bzrlib.

Most applications that embed bzrlib, including bzr itself, should call this function to initialize various subsystems.

More options may be added in future so callers should use named arguments.

The object returned by this function can be used as a contex manager through the 'with' statement to automatically shut down when the process is finished with bzrlib. However (from bzr 2.4) it's not necessary to separately enter the context as well as starting bzr: bzrlib is ready to go when this function returns.

Parameterssetup_uiIf true (default) use a terminal UI; otherwise some other ui_factory must be assigned to bzrlib.ui.ui_factory by the caller.
stdin, stdout, stderrIf provided, use these for terminal IO; otherwise use the files in sys.
ReturnsA context manager for the use of bzrlib. The __exit__ should be called by the caller before exiting their process or otherwise stopping use of bzrlib. Advanced callers can use BzrLibraryState directly.
def test_suite():
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.