ok

Mini Shell

Direktori : /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)ZoptionZopt_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_urlZprojectZ
public_keyZ
secret_keyz  %-15s: %s
�
z'Error: DSN configuration is not valid!
rz)Error: Client reports as being disabled!
�datazraven.scripts.runnerz
raven.testZGETzhttp://example.com)�methodZurl)ZculpritZloggerZrequestzSending a test message... z5This is a test message generated using ``raven test``T�tags)�userZloadavg)�messager �level�stackr"ZextrazEvent ID was %r
)r�stdout�write�getattrZremoteZ	is_activer
Z
is_enabled�get�flushZcaptureMessage�logging�INFOrr)�clientZoptions�kZ
remote_configr Zidentrrr�send_test_message.s6
 



r0cCst�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 )�actionr2�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!
)r,Z	getLoggerZsetLevel�DEBUGrrZ
add_optionr�
parse_args�joinr�environr*rrr
rr0�__dict__�timeZsleep�stateZdid_failr'r()�rootrZopts�argsZdsnr.rrr�mainXs.







rC)�__doc__Z
__future__rrr,rrr?Zoptparserr8rrZraven.utils.jsonrrrrr0rCrrrr�<module>s	*

Zerion Mini Shell 1.0