
    vi                         % S SK r S SKJrJr  \" S\\\\\\4   \\\\\S.5      rS\SS4S jr\ R                  " S\ R                  5      r\ R                  \   \S	'   S
\\\\4   S\4S jrg)    N)	TypedDictUnionSearchResults)linknamesizeseedsleech
engine_url	desc_linkpub_date
dictionaryreturnc                 r   SR                  U S   U S   R                  SS5      [        [        U S   5      5      [        U S   5      [        U S   5      U S   U R	                  S	S
5      [        U R	                  SS5      5      45      n[        SSSSS9 n[        XS9  S S S 5        g ! , (       d  f       g = f)N|r   r    r   r	   r
   r   r    r      wzutf-8F)encodingclosefd)file)joinreplacestranySizeToBytesgetopenprint)r   outtext
utf8stdouts      */app/qBittorrent/data/nova3/novaprinter.pyprettyPrinterr$   *   s    hh66""3,N:f-./Jw Jw < {B'JNN:r*+	 	G 
aw	6*g' 
7	6	6s   
B((
B6z'^(?P<size>\d*\.?\d+) *(?P<unit>[a-z]+)?sizeUnitRegexsize_stringc                    [        U [        5      (       a  U $ [        U [        5      (       a  [        U 5      $ [        R                  U R                  5       5      nUc  g[        UR                  S5      5      nUR                  S5      nUb2  SSSSS.nUR                  US	   R                  5       S	5      nUS
U-  -  n[        U5      $ )z
Convert a string like '1 KB' to '1024' (bytes)

The canonical type for `size_string` is `str`. However numeric types are also accepted in order to
accommodate poorly written plugins.
r   r   unit(         
   )TGMKr      )

isinstanceintfloatroundr%   matchstripgroupr   upper)r&   r6   r   r(   units_exponentsexponents         r#   r   r   ?   s     +s##+u%%[!! 1 1 34E}V$%D;;vD ""2>"&&tAw}}:8;    )retypingr   r   r   r4   r3   r   r$   compile
IGNORECASEr%   Pattern__annotations__r    r<   r#   <module>rD      s   6 
 #/%c/"	, 	(m ( (" "$,VXZXeXe!frzz# feS#o 6 3 r<   