← Back
Editing: testutils.cpython-311.pyc
� ;�>c�/ � �� � d dl Z de _ [ dZdZd dlZd dlZd dlZd dlZd dlm Z d dl Z d dlmZm Z mZmZ d� Zdadadad� Zej � d d � � d k rdndfZd� Zd � Zd$d�Zd� Zd%d�Z G d� de � � Z G d� d� � Z G d� de� � Z G d� de� � Z G d� de j! � � Z" G d� de j! � � Z# G d� de j! � � Z$d&d!�Z%d"� Z&d#� Z'dS )'� NTz3.3.0a Provides support for the test suite. The test suite as a whole, and individual tests, need to share certain support functions. We have to put these in here so they can always be imported, and so that individual tests need to import nothing more than "reportlab.whatever..." )�ConfigParser)�isCompactDistro� __rl_loader__�rl_isdir� asUnicodec � � d}t |d� � }|� d� � |� � � t j � |� � rt j |� � dS d S # Y dS xY w)Nz00DELETE.ME�wz$test of writability - can be deleted� r )�open�write�close�os�path�isfile�remove)�D�fn�fs �9/usr/lib/python3/dist-packages/reportlab/lib/testutils.py� isWritabler s{ � � � ����S�M�M�� ���6�7�7�7� ��� � � � �7�>�>�"��� ��I�b�M�M�M��1� � ����q�q���s �A.A4 �4A9c �> � t rt S d� t j D � � }|s%t j � dd� � }|r|g}|r]|d a t j t � � n# Y nxY w|D ]/}|t j v rt j � |� � �0nV| dk s J d� � �t j � t j d � � }|st j � � }|a t t � � st d� � a dd l }|j d at j � t � � sAt j � t j � t � � � � at j � t � � }t j � |d � � at j � t( � � s=t j � t j � |� � d � � at j � t( � � sl| dk rdt j � t j d � � }|st j � � }t j � |� � and at( rBt j � dt j � t( � � � � t S )z�Is it a writable file system distro being invoked within test directory? If so, can write test output here. If not, it had better go in a temp directory. Only do this once per processc �L � g | ]!}|� d � � �|dd� ��"S )z --outdir=� N�� startswith)�.0�ds r � <listcomp>zsetOutDir.<locals>.<listcomp>+ s1 � �>�>�>�1�A�L�L��$=�$=�>��1�2�2��>�>�>� �RL_TEST_OUTDIR� ����__main__z2setOutDir should only be called in the main scriptr �reportlab_testN�tests)�_OUTDIR�sys�argvr �environ�get�makedirsr r �dirname�getcwdr �get_rl_tempdir� reportlab�__path__�RL_HOME�isabs�normpath�abspath�join�testsFolder�isdir�insert)�namer r � scriptDirr/ �topDirs r � setOutDirr<