def Set( self ):
if self.package_installed( 'wget' ):
print( '\r\n\r\n[WGET]' )
if self.verbose:
print '%s Wget is installed, opening %s for writing ' % ( self.date(), self.wgetrc )
try:
self.backup_config( self.wgetrc )
config = ConfigObj( self.wgetrc )
config[ 'http_proxy' ] = self.http
config[ 'https_proxy' ] = self.http
config[ 'ftp_proxy' ] = self.http
config[ 'use_proxy' ] = 'on'
config.write( open( self.wgetrc, 'w' ) )
if self.verbose:
print( '%s Proxy configuration written successfully to %s ' % ( self.date(), self.wgetrc ) )
except ( IOError, ConfigObjError ), e:
print( 'Unable to set wget proxy: Error reading wget config in \'%s\' - %s' % ( self.wgetrc, e ) )
os.exit( 1 )
else:
print( '%s Wget not installed, skipping' % self.date() )
super( Wget, self ).Set()
评论列表
文章目录