U
    4Je                     @   s   d Z ddlZddlZddlZddlZddlmZ ddlm	Z	 ddl
Z
ddlZddlZddlZddlZddlZddlmZ eddd	Zedd
dZejeje  dddZdS )zsModule containing bug report helper(s).

Adapted from https://github.com/psf/requests/blob/master/requests/help.py
    N)find_executable)check_output   )__version__)returnc                  C   s   t  } | dkrt  }nj| dkr\dtjjtjjtjjf }tjj}|dkrd	||g}n(| dkrnt  }n| dkrt  }nd}|  d	| S )
a  Return a dict with the Python implementation and version.

    Provide both the name and the version of the Python implementation
    currently running. For example, on CPython 2.7.5 it will return
    {'name': 'CPython', 'version': '2.7.5'}.

    This function works best on CPython and PyPy: in particular, it probably
    doesn't work for Jython or IronPython. Future investigation should be done
    to work out the correct shape of the code for those platforms.
    CPythonPyPyz%s.%s.%sfinal Jython
IronPythonUnknown )
platformpython_implementationpython_versionsyspypy_version_infomajorminormicroreleaseleveljoin)implementationimplementation_versionrel r   ?/tmp/pip-unpacked-wheel-6qcj4cmz/sqlite3_to_mysql/debug_info.py_implementation   s$    


r   c               	   C   sf   t drbzDtddg} z|   W W S  ttfk
rH   t|  Y W S X W n tk
r`   Y nX dS )Nmysqlz-Vz$MySQL client not found on the system)r   r   decodestripUnicodeDecodeErrorAttributeErrorstr	Exception)Zmysql_versionr   r   r   _mysql_version9   s    r&   c                  C   s   zt   dt   } W n tk
r2   d} Y nX dtgddgd| gdt gdt gdtjgddgd	t	j
gd
tjj
gdtj
gdtj
gdtj
gdtj
ggS )z&Generate information for a bug report.r   r   zsqlite3-to-mysqlr
   zOperating SystemPythonZMySQLZSQLiteclickzmysql-connector-pythonpytimeparse2
simplejsontabulatetqdm)r   systemreleaseIOErrorpackage_versionr   r&   sqlite3Zsqlite_versionr(   r   r   Z	connectorr)   r*   r+   r,   )Zplatform_infor   r   r   infoF   s$    

r2   )__doc__r   r1   r   typingtdistutils.spawnr   
subprocessr   r(   Zmysql.connectorr   r)   r*   r+   r,   r
   r   r0   r$   r   r&   Listr2   r   r   r   r   <module>   s    "