Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib/python3.7/site-packages/raven/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/raven/scripts/__pycache__/runner.cpython-37.pyc

B

��Y��@s�dZddlmZddlmZddlZddlZddlZddlZddlm	Z	ddl
mZmZddl
mZdd	�Zd
d�Zdd
�Zdd�Zdd�ZdS)z�
raven.scripts.runner
~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
�)�absolute_import)�print_functionN)�OptionParser)�Client�get_version)�jsoncCsRyt�|�}Wn.tk
r<td||f�t�d�YnXt|j|j|�dS)Nz2Invalid JSON was used for option %s.  Received: %s�)	r�loads�
ValueError�print�sys�exit�setattr�values�dest)�optionZopt_str�value�parser�r�E/opt/alt/python37/lib/python3.7/site-packages/raven/scripts/runner.py�
store_jsonsrcCsttd�rt��SdS)N�
getloadavg)�hasattr�osrrrrr�get_loadavg s
rcCs4yddl}Wntk
r dSX|�t���dS)Nr)�pwd�ImportError�getpwuidr�geteuid)rrrr�get_uid&s
rc	Cs�tj�d�x(dD] }tj�d|t|j|�f�qWtj�d�|j}|��sftj�d�t�d�|��s�tj�d�t�d�|�dd	d
ddd
�d��}tj�d�tj�	�|j
d|tjd|�di�t
�t�d�d�}tj�d|f�dS)NzClient configuration:
)Zbase_url�projectZ
public_keyZ
secret_keyz  %-15s: %s
�
z'Error: DSN configuration is not valid!
rz)Error: Client reports as being disabled!
�datazraven.scripts.runnerz
raven.test�GETzhttp://example.com)�method�url)Zculprit�loggerZrequestzSending a test message... z5This is a test message generated using ``raven test``T�tags)�userZloadavg)�messager"�level�stackr'�extrazEvent ID was %r
)r�stdout�write�getattrZremoteZ	is_activer
�
is_enabled�get�flushZcaptureMessage�logging�INFOrr)�client�options�kZ
remote_configr"�identrrr�send_test_message.s6
 



r9cCst�d�}|�tj�tt�d�}|jddtdddd�|jd	dtddd
d�|��\}}d�	|dd��pvt
j�d�}|s�t
d
�t
d�t�d�t
d�t
d|�t
�t|dgd�}t||j�t�d�|j��r�tj�d�t�d�tj�d�dS)Nz
sentry.errors)�versionz--data�callback�stringrr")�actionr;�type�nargsrz--tagsr'� Z
SENTRY_DSNz!Error: No configuration detected!zVYou must either pass a DSN to the command, or set the SENTRY_DSN environment variable.zUsing DSN configuration:�raven)Z
include_paths�zerror!
z	success!
)r3�	getLogger�setLevel�DEBUGrr�
add_optionr�
parse_args�joinr�environr1rrr
rr9�__dict__�time�sleep�stateZdid_failr-r.)�rootr�opts�argsZdsnr5rrr�mainXs.







rQ)�__doc__�
__future__rrr3rrrK�optparserrArrZraven.utils.jsonrrrrr9rQrrrr�<module>s	*

Hacked By AnonymousFox1.0, Coded By AnonymousFox