
    Vke                     f    d dl mZ d dlmZmZ d dlmZ d dlZd dlm	Z	 d dl
mZ defdZd	 Zd
 ZdS )    )listdirisfilejoin)BinaryION)reduce)settingsfilec                 X    |                      |           |                                  dS )zk
    Saves file to selected path
    :param file: file to save
    :param path: path
    :return: None
    N)writeclose)r
   paths     K/Users/daniilossinkin/PycharmProjects/ShopsBackend/src/utils/file_system.py	save_filer   
   s'     	JJtJJLLLLL    c                     t          | d          5 }t          j        |                                          }ddd           n# 1 swxY w Y   |S )z
    Reads, removes 
 and concats xml to one string
    :param xml_file: file to concat
    :return: processed xml formatted string
    rN)open	xmltodictparseread)xml_file	file_readdatas      r   load_and_conc_xmlr      s     
h		 1	y~~//001 1 1 1 1 1 1 1 1 1 1 1 1 1 1Ks   'AAAc              #      K   t           j        fdt                    D             }|D ]<}|                    d          }|d         }|d         }|d         }|| k    r6||fV  =d S )Nc                 N    g | ]!}t          t          |                    |"S  r   ).0flogging_directorys     r   
<listcomp>zread_logs.<locals>.<listcomp>"   s2    XXX!VDARTU<V<V5W5WXAXXXr   z - r         )r	   logging_dirr   split)contextlogslogparts	date_timelog_contextentryr!   s          @r   	read_logsr.       s       ,XXXXw011XXXD  		%  !H	Aha'!! r   )osr   os.pathr   r   typingr   r   	functoolsr   
src.configr	   r   r   r.   r   r   r   <module>r4      s                                               H      
 
 
 
 
r   