HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib64/python3.10/site-packages/honcho/__pycache__/printer.cpython-310.pyc
o

we�
�@s�ddlmZddlZddlmZedd�ZGdd�de�Zd	d
�Zdd�Z	erBzddl
Z
Wney;d
d�Z	YdSwe
��dSdS)�)�
namedtupleN�)�
ON_WINDOWS�Messageztype data time name colourc@s.eZdZdZejddddfdd�Zdd�Zd	S)
�Printerz�
    Printer is where Honcho's user-visible output is defined. A Printer
    instance receives typed messages and prints them to its output (usually
    STDOUT) in the Honcho format.
    z%H:%M:%SrTcCsL||_||_||_||_||_z	|j��|_WdSty%d|_YdSw)NF)�output�time_format�width�colour�prefix�isatty�_colours_supported�AttributeError)�selfrrr	r
r�r�G/home/arjun/projects/env/lib/python3.10/site-packages/honcho/printer.py�__init__s�zPrinter.__init__cCs�|jdkr	td��|jdur|jnd}|�|j�}|r|d7}t|jt�r-|j�dd�}n|j}|�	�D].}d}|j
rX|j�|j
�}dj||d�}|jrX|jrX|jrXt|j|�}t|||jd	d
�q4dS)N�linez0Printer can only process messages of type "line"�� zutf-8�replacez{time} {name}| )�time�nameT)�file�flush)�type�RuntimeErrorr�ljustr	�
isinstance�data�bytes�decode�
splitlinesrr�strftimer�formatr
r
�_colour_string�printr)r�messager�stringrr�time_formattedrrr�write%s$
�z
Printer.writeN)�__name__�
__module__�__qualname__�__doc__�sys�stdoutrr*rrrrr	s
�rcCs
d�|�S)Nz[{0}m)r$)�coderrr�_ansi@s
r2cCsd�td�t|�|td��S)Nz{0}{1}{2}{3}r)r$r2�r
�srrrr%Dsr%cCs|S)Nrr3rrrr%Os)
�collectionsrr/�compatrr�objectrr2r%�colorama�ImportError�initrrrr�<module>s
7��