HEX
Server: Apache
System: Linux infong-uk86 4.4.400-icpu-106 #2 SMP Mon Sep 15 08:23:40 UTC 2025 x86_64
User: u44115835 (4976590)
PHP: 8.4.17
Disabled: NONE
Upload Files
File: //kunden/lib/python3/dist-packages/breezy/__pycache__/__init__.cpython-39.pyc
a

)+�^�"�@s�dZddlmZddlZe��ZddlZddlZdZdZdd�Z	e	e�Z
e
Zdd	�Ze�
�Zeed
d�dur�edus�e�e�jdkr�eej�Zedur�dZne�e�jZdZdd
d�Zdd�Zdd�ZdS)a�All of bzr.

Developer documentation is available at
https://www.breezy-vcs.org/developers/.

Some particularly interesting things in breezy are:

 * breezy.initialize -- setup the library for use
 * breezy.plugin.load_plugins -- load all installed plugins
 * breezy.branch.Branch.open -- open a branch
 * breezy.workingtree.WorkingTree.open -- open a working tree

We hope you enjoy this library.
�)�absolute_importNzHCopyright 2005-2012 Canonical Ltd.
Copyright 2017-2020 Breezy developers)��r�finalrcCs
t|�dkrd|dd�}nd|dd�}t|�dkr>|S|d}|d}|dkrd|dkrdd	}n�|dkrzd
t|�}n�|dkr�|dkr�d}nr|dkr�dt|�}n\|dvr�|ddkr�d|dd�}|dt|�}n&|d
kr�dt|�}nd
�tt|��S||S)a�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
    �z%d.%dNz%d.%d.%dr�rr��.Zdev)ZalphaZbeta�	candidateZrc)�len�str�join�map)�version_infoZmain_versionZrelease_type�subZ
sub_string�r�1/usr/lib/python3/dist-packages/breezy/__init__.py�_format_version_tuple;s.rc	Cs�tjdk}zPddl}|j�|jd�}|rX|j�|jd�}|�|�|j	�|j
�d|jf�}WnttfyrYdS0|r�t�
|�}||�}d|_nt
|�}|�|�}|�||j�j|_t��|kr�td��|S)	aChange the Python process global encoding for filesystem names

    The effect is to change how open() and other builtin functions handle
    unicode filenames on posix systems. This should only be done near startup.

    The new encoding string passed to this function must survive until process
    termination, otherwise the interpreter may access uninitialized memory.
    The use of intern() may defer breakage is but is not enough, the string
    object should be secure against module reloading and during teardown.
    )rrNZPy_FileSystemDefaultEncodingZPy_HasFileSystemDefaultEncodingZPyUnicode_AsUTF8rz0Failed to change the filesystem default encoding)�sysr�ctypesZc_void_pZin_dllZ	pythonapiZc_intZ
PYFUNCTYPEZPOINTERZc_charZ	py_object�ImportError�
ValueError�intern�valueZc_char_p�cast�getfilesystemencoding�RuntimeError)Znew_encZis_py3rZold_ptrZhas_encZas_utf8Zenc_ptrrrr�"_patch_filesystem_default_encodingys6

�
���

r�_brz_default_fs_enc�asciiTc
Csrddlm}m}|rLddl}|p$tj}|p.tj}|p8tj}|j�	|||�}nd}|�
�}|j||d�}	|	��|	S)aRSet up everything needed for normal use of breezy.

    Most applications that embed breezy, including brz 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 breezy.  However it's not necessary to
    separately enter the context as well as starting brz: breezy is ready to
    go when this function returns.

    :param setup_ui: If true (default) use a terminal UI; otherwise
        some other ui_factory must be assigned to `breezy.ui.ui_factory` by
        the caller.
    :param stdin, stdout, stderr: If provided, use these for terminal IO;
        otherwise use the files in `sys`.
    :return: A context manager for the use of breezy. The __exit__
        should be called by the caller before exiting their process or
        otherwise stopping use of breezy. Advanced callers can use
        BzrLibraryState directly.
    r)�
library_state�traceN)�uir!)
�breezyr r!Z	breezy.uir�stdin�stdout�stderrr"Zmake_ui_for_terminalZ
DefaultConfigZBzrLibraryStateZ_start)
Zsetup_uir$r%r&r r!r#Z
ui_factoryZtracer�staterrr�
initialize�s


r(cCstdurt�StS)N)�
_global_stater(rrrr�get_global_state�sr*cCsddl}|��S)Nr)�tests�
test_suite)r+rrrr,�sr,)TNNN)�__doc__Z
__future__r�timeZ_start_time�codecsrZ
__copyright__rr�__version__Zversion_stringrrZ_fs_enc�getattr�lookup�namerr)r(r*r,rrrr�<module>s.�:(

(