3 0Q=jØ ã @ sR d dl Z d dlZd dlmZ d dlmZ d dlZd dlmZ d dl m Z yd dlZW n ek rr d dl jZY nX d dlZejddd�Zeed ƒsœeje_ejZd d lmZ d dlmZ d dlmZ d d lmZ d dlmZ edddd edƒd�eddedƒd�eddedƒd�eddedƒd�eddedƒd�gZG dd „ d eƒZd!d"„ ZdS )#é N)ÚOption)ÚOptionParser)Úrpclib)Ússtrzrhn-client-toolsT)ZfallbackÚugettext)Úconfig)Úup2dateAuth)Ú up2dateErrors)Ú up2dateLog)Úup2dateUtilsz-vz --verboseÚcountzShow additional output)ÚactionÚdefaultÚhelpz--proxyZstorezSpecify an http proxy to use)r r z--proxyUserz:Specify a username to use with an authenticated http proxyz--proxyPasswordz:Specify a password to use with an authenticated http proxyz--debugÚ store_truez&Enable debug output (network requests)c @ sd e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd d „ Zdd„ Zd d„ Z dd„ Z edd„ ƒZedd„ ƒZ dS )ÚRhnClic C s" t ttjƒ d�| _d | _d | _d S )N)Zoption_listÚversion)r Ú _optionsTabler Ú_RhnCli__versionStringÚ optparserÚoptionsÚargs)Úself© r ú/usr/lib/python3.6/rhncli.pyÚ__init__M s zRhnCli.__init__c C sB t t_y | jƒ tj| jƒ pdƒ W �n tk rZ tjjt t dƒƒƒ tjdƒ Y �nä tjj k r¾ } zDtjjt t dƒtjƒ d ƒƒ tjjt t dƒƒƒ tjdƒ W Y d d }~X �n€ tk rü tjjt t dƒtjƒ d ƒƒ tjdƒ Y �nB tjk �rh tjƒ d }|d k�s6tt|ƒƒdk�rLtjjt t dƒƒƒ ntjjt t dƒ| ƒƒ Y nÖ tk �r¦ tjjt t d ƒtjƒ d ƒƒ tjdƒ Y n˜ tk �r¼ ‚ Y n‚ tjk �rü tjjt t d ƒtjƒ d ƒƒ tjdƒ Y nB tjk �r< tjjt dttjƒ d ƒ ƒƒ tjdƒ Y nX d S ) Nr z Aborted. é zThere was an SSL error: %s zqA common cause of this error is the system time being incorrect. Verify that the time on this system is correct. z$An unexpected OS error occurred: %s z1A connection was attempted with a malformed URI. z5A connection was attempted with a malformed URI: %s. z%There was some sort of I/O error: %s z&There was an authentication error: %s zXMLRPC ProtocolError: %s é )ÚexceptionHandlerÚsysÚ excepthookÚ initializeÚexitÚmainÚKeyboardInterruptÚstderrÚwriter Ú_ÚrequestsÚ exceptionsZSSLErrorÚexc_infoÚOSErrorr ZMalformedURIErrorÚlenÚstrÚIOErrorÚ SystemExitr ZAuthenticationErrorÚ xmlrpclibZ ProtocolError)r Úer r r ÚrunT s<