HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/__pycache__/uno.cpython-38.pyc
U

W�hpD�@s�ddlZddlZej�d�e�dd�ddlZddlZddlZddlZddlZej	ddkZ
e
rjefZne
fZe��Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZGdd�d�ZGd d!�d!�ZGd"d#�d#e�ZGd$d%�d%�ZGd&d'�d'�Z Gd(d)�d)�Z!d*d+�Z"e#Z$d,d-�Z%zddl&Z&Wne'k
�rlddl(Z&YnXe%e&j)d.<Gd/d0�d0e�Z*d1d2�Z+d3d4�Z,d5d6�Z-d7d8�Z.d9d:�Z/d;d<�Z0d=d>�Z1d?d@�Z2dAdB�Z3dS)C�Nz/usr/lib/libreoffice/programZ
URE_BOOTSTRAPz@vnd.sun.star.pathname:/usr/lib/libreoffice/program/fundamentalrc�cCstS)zHReturns the UNO component context used to initialize the Python runtime.)�_component_context�rr�%/usr/lib/python3/dist-packages/uno.py�getComponentContext+srcCst��S)z�Returns the current context.

    See http://udk.openoffice.org/common/man/concept/uno_contexts.html#current_context
    for an explanation on the current context concept.
    )�pyuno�getCurrentContextrrrrr1srcCs
t�|�S)auSets newContext as new UNO context.

    The newContext must implement the XCurrentContext interface. The
    implementation should handle the desired properties and delegate
    unknown properties to the old context. Ensure that the old one
    is reset when you leave your stack, see
    http://udk.openoffice.org/common/man/concept/uno_contexts.html#current_context
    )r�setCurrentContext)Z
newContextrrrr	;s
r	cCs
t�|�S)zBLooks up the value of an IDL constant by giving its explicit name.)r�getConstantByName)Zconstantrrrr
Hsr
cCs
t�|�S)z�Returns a `uno.Type` instance of the type given by typeName.

    If the type does not exist, a `com.sun.star.uno.RuntimeException` is raised.
    )r�
getTypeByName��typeNamerrrrNsrcOst|�||�S)a�Creates a UNO struct or exception given by typeName.

    Can be called with:

    1) No additional argument.
       In this case, you get a default constructed UNO structure.
       (e.g. `createUnoStruct("com.sun.star.uno.Exception")`)
    2) Exactly one additional argument that is an instance of typeName.
       In this case, a copy constructed instance of typeName is returned
       (e.g. `createUnoStruct("com.sun.star.uno.Exception" , e)`)
    3) As many additional arguments as the number of elements within typeName
       (e.g. `createUnoStruct("com.sun.star.uno.Exception", "foo error" , self)`).
    4) Keyword arguments to give values for each element of the struct by name.
    5) A mix of 3) and 4), such that each struct element is given a value exactly once,
       either by a positional argument or by a keyword argument.

    The additional and/or keyword arguments must match the type of each struct element,
    otherwise an exception is thrown.
    )�getClass)r
�args�kwargsrrr�createUnoStructWsrcCs
t�|�S)zDReturns the class of a concrete UNO exception, struct, or interface.)rrrrrrrosrcCs
t�|�S)z5Returns True, when obj is a class of a UNO interface.)r�isInterface)�objrrrrusrcCst��S)zuReturns a 16 byte sequence containing a newly generated uuid or guid.

    For more information, see rtl/uuid.h.
    )r�generateUuidrrrrr{srcCs
t�|�S)z-Returns a file URL for the given system path.)r�systemPathToFileUrl)Z
systemPathrrrr�srcCs
t�|�S)zqReturns a system path.

    This path is determined by the system that the Python interpreter is running on.
    )r�fileUrlToSystemPath)Zurlrrrr�srcCst�||�S)z1Returns an absolute file url from the given urls.)r�
absolutize)�pathZrelativeUrlrrrr�src@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Enumz�Represents a UNO enum.

    Use an instance of this class to explicitly pass an enum to UNO.

    :param typeName: The name of the enum as a string.
    :param value: The actual value of this enum as a string.
    cCs||_||_t�|�dS�N)r
�valuerZ	checkEnum)�selfr
rrrr�__init__�sz
Enum.__init__cCsd|j|jfS)Nz<Enum instance %s (%r)>)r
r�rrrr�__repr__�sz
Enum.__repr__cCs&t|t�sdS|j|jko$|j|jkS�NF)�
isinstancerr
r�r�thatrrr�__eq__�s
zEnum.__eq__cCs|�|�Sr�r$�r�otherrrr�__ne__�szEnum.__ne__N��__name__�
__module__�__qualname__�__doc__rrr$r(rrrrr�s
rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�Typez�Represents a UNO type.

    Use an instance of this class to explicitly pass a type to UNO.

    :param typeName: Name of the UNO type
    :param typeClass: Python Enum of TypeClass, see com/sun/star/uno/TypeClass.idl
    cCs||_||_t�|�dSr)r
�	typeClassrZ	checkType)rr
r/rrrr�sz
Type.__init__cCsd|j|jfS)Nz<Type instance %s (%r)>)r
r/rrrrr�sz
Type.__repr__cCs&t|t�sdS|j|jko$|j|jkSr )r!r.r/r
r"rrrr$�s
zType.__eq__cCs|�|�Srr%r&rrrr(�szType.__ne__cCs
|j��Sr)r
�__hash__rrrrr0�sz
Type.__hash__N)	r*r+r,r-rrr$r(r0rrrrr.�sr.c@seZdZdZdd�ZdS)�Boolz�Represents a UNO boolean.

    Use an instance of this class to explicitly pass a boolean to UNO.

    Note: This class is deprecated. Use Python's True and False directly instead.
    cCsHd}t�|t�t|t�r&|dkr&dSt|t�r<|dkr<dS|rDdSdS)NzKThe Bool class is deprecated. Use Python's True and False directly instead.�trueTZfalseF)�warnings�warn�DeprecationWarningr!�six_string_types)�clsr�messagerrr�__new__�szBool.__new__N)r*r+r,r-r9rrrrr1�sr1c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Chara]Represents a UNO char.

    Use an instance of this class to explicitly pass a char to UNO.

    For Python 2, this class only works with unicode objects. Creating
    a Char instance with a normal str object or comparing a Char instance
    to a normal str object will raise an AssertionError.

    :param value: A Unicode string with length 1
    cCsXtr t|t�s:tdt|���nt|t�s:tdt|���t|�dksNtd��||_dS)Nz(Expected unicode object, got %s instead.z$Expected str object, got %s instead.�z!Char value must have length of 1.)�PY2r!Zunicode�AssertionError�type�str�lenr�rrrrrr�s
z
Char.__init__cCsd|jfS)Nz<Char instance %s>�rrrrrrsz
Char.__repr__cCsBt|t�r(t|�dkrdS|j|dkSt|t�r>|j|jkSdS)Nr;Fr)r!r6r@rr:r"rrrr$s

zChar.__eq__cCs|�|�Srr%r&rrrr(szChar.__ne__Nr)rrrrr:�s

r:c@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)�ByteSequencez�Represents a UNO ByteSequence value.

    Use an instance of this class to explicitly pass a byte sequence to UNO.

    :param value: A string or bytesequence
    cCs:t|t�r||_n$t|t�r&|j|_ntdt|���dS)Nz6Expected bytes object or ByteSequence, got %s instead.)r!�bytesrrC�	TypeErrorr>rArrrrs



zByteSequence.__init__cCsd|jfS)Nz<ByteSequence instance '%s'>rBrrrrr%szByteSequence.__repr__cCs.t|t�r|j|kSt|t�r*|j|jkSdSr )r!rDrrCr"rrrr$(s



zByteSequence.__eq__cCs
t|j�Sr)r@rrrrr�__len__1szByteSequence.__len__cCs
|j|SrrB)r�indexrrr�__getitem__4szByteSequence.__getitem__cCs
|j��Sr)r�__iter__rrrrrI7szByteSequence.__iter__cCsFt|t�rt|j|�St|t�r2t|j|j�Stdt|���dS)NzCan't add ByteString and %s.)r!rDrCrrEr>)r�brrr�__add__:s


zByteSequence.__add__cCs
|j��Sr)r�hashrrrrr0DszByteSequence.__hash__N)r*r+r,r-rrr$rFrHrIrKr0rrrrrCs
	
rCc@seZdZdZdd�ZdS)�AnyzmRepresents a UNO Any value.

    Use only in connection with uno.invoke() to pass an explicit typed Any.
    cCs&t|t�r||_n
t|�|_||_dSr)r!r.r>rr)rr>rrrrrNs

zAny.__init__N)r*r+r,r-rrrrrrMHsrMcCst�|||�S)zKUse this function to pass exactly typed Anys to the callee (using uno.Any).)r�invoke)�objectZ
methodnameZargTuplerrrrNWsrNcOs�zt|f|�|�WStk
r�}z\t|�dd�|�di�|�di�|�dg�gt|�d�\}}}|rvt|d�rx�|}W5d}~XYnXd}tj}	|�d�D]&}
|
|	kr�|	|
}n
t	�
|
�}|j}	q�t	�d�}|D�]}||	kr�d	}
zt	�|d|�|	|<Wn�|k
�r�zt
||�|	|<Wnt|k
�r�zt|d|�|	|<WnD|k
�r�zt||�|	|<Wntk
�r�d
}
YnXYnXYnXYnX|
r�td|||f�}tjddk�r�|�|j�}d
|_|�q�|S)
zJOverrides built-in import to allow directly importing LibreOffice classes.N��globals�locals�fromlist�_uno_import_failed�.�!com.sun.star.uno.RuntimeExceptionFTz%s (or '%s.%s' is unknown)r)�_builtin_import�ImportError�list�getr@�hasattr�sys�modules�splitr�	__class__�__dict__rrr
�_impl_getConstantGroupByName�
ValueError�version_info�with_traceback�
__traceback__rT)�nameZoptargsr�erQrRrSZ
py_import_exc�mod�d�module�RuntimeException�
class_nameZfailedZuno_import_excrrr�_uno_importcsX"
��



�rm�
__import__c@s.eZdZdZdgZdd�Zdd�Zdd�Zd	S)
�_ConstantGroupz'Represents a group of UNOIDL constants.�
_constantscCs
||_dSr)rp)r�	constantsrrrr�sz_ConstantGroup.__init__cCs
|j��Sr)rp�keysrrrr�__dir__�sz_ConstantGroup.__dir__cCs$||jkr|j|Std|��dS)Nz%The constant '%s' could not be found.)rp�AttributeError�rrfrrr�__getattr__�s

z_ConstantGroup.__getattr__N)r*r+r,r-�	__slots__rrsrvrrrrro�s
rocCsztdd�}tdd�}t�d�}|�||f|�}|d|}|D]*}|j|kr>ttdd�|jD���Sq>td	|��d
S)z#Gets UNOIDL constant group by name.zcom.sun.star.uno.TypeClassZ	CONSTANTSz2com.sun.star.reflection.TypeDescriptionSearchDepthZONEz=/singletons/com.sun.star.reflection.theTypeDescriptionManagerrUcss$|]}|j�d�d|jfVqdS)rU���N)�Namer^Z
ConstantValue)�.0�crrr�	<genexpr>�s�z/_impl_getConstantGroupByName.<locals>.<genexpr>z+The constant group '%s' could not be found.N)	rrZgetValueByNameZ createTypeDescriptionEnumerationryro�dictZ	Constantsrb)rj�grouprqZoneZ
type_desc_mgrZ
type_descsZqualified_nameZ	type_descrrrra�s




�racOs�t|�dkr>t|�dkr>t|ddd�|jkr>|d|jd<nRtj|jj|f|�\}}|��D]&}|�|�s^t�	d�}|d|d��q^||jd<dS)aInitializes a UNO struct.

    Referenced from the pyuno shared library.

    This function can be called with either an already constructed UNO struct, which it
    will then just reference without copying, or with arguments to create a new UNO struct.
    rr;r_NrrVz2_uno_struct__init__: unused keyword argument '%s'.)
r@�getattrr_r`rZ_createUnoStructHelperZ__pyunostruct__rrrZr)rrrZstructZusedZkwargrkrrr�_uno_struct__init__�s
.

r�cCst|jd|�S)zSGets attribute from UNO struct.

    Referenced from the pyuno shared library.
    r)rr`rurrr�_uno_struct__getattr__�sr�cCst|jd||�S)zQSets attribute on UNO struct.

    Referenced from the pyuno shared library.
    r)�setattrr`)rrfrrrr�_uno_struct__setattr__sr�cCst|jd�S)z`Converts a UNO struct to a printable string.

    Referenced from the pyuno shared library.
    r)�reprr`rrrr�_uno_struct__repr__sr�cCst|jd�S)z"Converts a UNO struct to a string.r)r?r`rrrr�_uno_struct__str__sr�cCs|�|�Srr%r&rrr�_uno_struct__ne__sr�cCs"t|d�r|jd|jdkSdS)zMCompares two UNO structs.

    Referenced from the pyuno shared library.
    rF)r[r`r"rrr�_uno_struct__eq__!s
r�cCsd�t�|��S)z`Extracts a printable stacktrace.

    Referenced from pyuno shared lib and pythonscript.py.
    �)�join�	traceback�	format_tb)Ztracerrr�!_uno_extract_printable_stacktrace-sr�)4r\�osr�append�putenvrr�r3Zsocketrcr<Z
basestringr6r?rrrr	r
rrrrrrrrrr.rOr1r:rCrMrNrnrWrmZ__builtin__rX�builtinsr`rorar�r�r�r�r�r�r�r�rrrr�<module>s`

			)5	W