B
     h                 @   sV   d dl Z d dlZd dlZd dlZd dlZeeZdd Zdd Z	dd Z
dd	 ZdS )
    Nc             C   s   t j| ddS )N   )indent)jsondumps)json_struct r   \C:\Users\sanjo\AppData\Local\Qlobot\Launcher\ext_packages\selenium\webdriver\remote\utils.pyformat_json   s    r	   c             C   s
   t | S )N)r   r   )r   r   r   r   	dump_json    s    r
   c             C   s
   t | S )N)r   loads)sr   r   r   	load_json$   s    r   c          
   C   s  | rt j| sdS t| }| dk	r.dS td|   t	 }yxl|
 D ]`}|dt jjdt jj}t j||}|t jjrRt j|sRt | td|  qRW x|
 D ]z}|dt jjdt jj}t j||}|t jjstd|  t|d}||| |  td|  qW td	|  |S  tk
r } ztd
|  dS d}~X Y nX dS )zUnzip zipfile to a temporary directory.

    The directory of the unzipped files is returned if success,
    otherwise None is returned. NzExtracting zipped file: %s\/zDirectory %s created.zCopying file %s......wbzFile %s copied.z Unzipped file can be found at %sz%Error in extracting webdriver.xpi: %s)ospathexistszipfileZipFiletestzipLOGGERinfotempfilemkdtempnamelistreplacesepjoinendswithmkdirdebugopenwritereadcloseIOErrorerror)Zzip_file_namezftempdirzip_namenamedestZoutfileerrr   r   r   unzip_to_temp_dir(   s<    


r.   )r   loggingr   r   r   	getLogger__name__r   r	   r
   r   r.   r   r   r   r   <module>   s   
