
    Eqg                         d Z ddlZddlZddlZddlZddlmZmZ dedede	dedej
        e         f
d	Zdd
Zedk    r e             dS dS )zU
This module provides a command line interface for sending SMS messages via SmsAero.
    N)SmsAeroSmsAeroExceptionemailapi_keyphonemessagereturnc                 N    t          | |          }|                    ||          S )ar  
    Sends an SMS message via SmsAero.

    :param email: The email registered with SmsAero.
    :param api_key: The API key from SmsAero.
    :param phone: The phone number to send the SMS message to.
    :param message: The text of the message to be sent.
    :return: Returns a dictionary with the response data from SmsAero, or None if the message was not sent.
    )r   send_sms)r   r   r   r   apis        F/var/www/html/env/lib/python3.11/site-packages/smsaero/command_line.pyr   r      s'     %
!
!C<<w'''    c                  :   t          j        d          } |                     dt          dd           |                     dt          dd           |                     d	t          dd
           |                     dt          dd           |                                 }	 t          |j        |j        |j	        |j
                  }t          j        |           dS # t          $ r1}t          d|            t          j        d           Y d}~dS d}~ww xY w)a  
    Parses command line arguments and sends an SMS message via SmsAero.

    The command line arguments are:
    --email: The email registered with SmsAero.
    --api_key: The API key from SmsAero.
    --phone: The phone number to send the SMS message to.
    --message: The text of the message to be sent.

    If the SMS message is sent successfully, the response data from SmsAero is printed.
    If an error occurs, the error message is printed and the program exits with status code 1.
    zSend SMS via smsaero.ru gate)descriptionz--emailTz"Your email registered with SmsAero)typerequiredhelpz	--api_keyzYour SmsAero API keyz--phonezPhone number to send SMS toz	--messagezMessage to sendzAn error occurred:    N)argparseArgumentParseradd_argumentstrint
parse_argsr   r   r   r   r   pprintr   printsysexit)parserargsresultes       r   mainr#      s&    $1OPPPF
	dAefff
#CYZZZ
	dA^___
#CTUUUD$*dlDJMMf   'A''(((s   #:C 
D)&DD__main__)r	   N)__doc__r   r   typingr   smsaeror   r   r   r   Optionaldictr   r#   __name__ r   r   <module>r,      s        



 - - - - - - - -(C (# (c (C (FOTXDY ( ( ( (   : zDFFFFF r   