Packages.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Proxifier 作者: donjajo 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号