U
    gF                     @   s   d Z dZdd ZdS )z_
Implementation of Unicode Bidirectional Algorithm
http://www.unicode.org/unicode/reports/tr9/
z0.4.2c                  C   s4  ddl } ddl}ddl}ddl}ddl}ddlm} |  }|jddddd	d
d |jddddddd |jddddddd |jddddd	dd |	 \}}|j
r|j
dkr|d |jr|| |j|_|r|}	n|j}	|	D ]D}
||
|j|j|j
|j}t||js ||j}|j|dd qdS )z)Will be used to create the console script    N   )get_displayz-ez
--encodingencodingzutf-8stringzText encoding (default: utf-8))destdefaulttypehelpz-uz--upper-is-rtlupper_is_rtlF
store_truezDTreat upper case chars as strong 'R' for debugging (default: False).)r   r   actionr	   z-dz--debugdebugz/Output to stderr steps taken with the algorithmz-bz
--base-dirbase_dirzOverride base direction [L|R]ZLRzoption -b can be L or R )end)optparsesyscodecslocalesix	algorithmr   OptionParser
add_option
parse_argsr   errorPY2	getwritergetpreferredencodingstdoutstdinr   r
   r   
isinstance	text_typedecodeprint_)r   r   r   r   r   r   parseroptionsrestlineslineZdisplay r)   1/tmp/pip-unpacked-wheel-nh04upgo/bidi/__init__.pymain   s^    
 r+   N)__doc__VERSIONr+   r)   r)   r)   r*   <module>   s   