Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/proxy.py

    rd85c194 r463e7ffc  
    66import logging 
    77import re 
     8 
     9 
     10logger = logging.getLogger(__name__) 
    811 
    912''' 
     
    7174        proxy_url_list = [] 
    7275        for this_pac_url in pac_urls_list: 
    73             logging.debug('Trying pac file (%s)...' % this_pac_url) 
     76            logger.debug('Trying pac file (%s)...' % this_pac_url) 
    7477            try: 
    7578                response = urllib2.urlopen( 
    7679                    this_pac_url, timeout=self.timeout) 
    77                 logging.debug('Succeeded (%s)...' % this_pac_url) 
     80                logger.debug('Succeeded (%s)...' % this_pac_url) 
    7881            except Exception: 
    79                 logging.debug('Failled (%s)...' % this_pac_url) 
     82                logger.debug('Failled (%s)...' % this_pac_url) 
    8083                continue 
    8184            pacStr = response.read() 
     
    120123        response = None 
    121124        try: 
    122             logging.debug("Trying Direct connection to %s..."%self.url) 
     125            logger.debug("Trying Direct connection to %s..."%self.url) 
    123126            response = urllib2.urlopen(req, timeout=self.timeout) 
    124127        except Exception, e: 
    125             logging.debug("Failed!") 
    126             logging.debug(e) 
     128            logger.debug("Failed!") 
     129            logger.debug(e) 
    127130            try: 
    128                 logging.debug("Trying to use system proxy if it exists...") 
     131                logger.debug("Trying to use system proxy if it exists...") 
    129132                self._set_proxy() 
    130133                response = urllib2.urlopen(req, timeout=self.timeout) 
    131134            except Exception, e: 
    132                 logging.debug("Failed!") 
    133                 logging.debug(e) 
     135                logger.debug("Failed!") 
     136                logger.debug(e) 
    134137                pac_urls = self._get_addresses_of_proxy_pac() 
    135138                proxy_urls = self._parse_proxy_pac(pac_urls) 
    136139                for proxy in proxy_urls: 
    137140                    try: 
    138                         logging.debug("Trying to use the proxy %s found in proxy.pac configuration"%proxy) 
     141                        logger.debug("Trying to use the proxy %s found in proxy.pac configuration"%proxy) 
    139142                        self._set_proxy(proxy) 
    140143                        response = urllib2.urlopen(req, timeout=self.timeout) 
    141144                    except Exception, e: 
    142                         logging.debug("Failed!") 
    143                         logging.debug(e) 
     145                        logger.debug("Failed!") 
     146                        logger.debug(e) 
    144147        if response is not None: 
    145             logging.debug("The connection to %s was successful."%self.url) 
     148            logger.debug("The connection to %s was successful."%self.url) 
    146149        else: 
    147             logging.warning("Connection to %s failed..."%self.url) 
     150            logger.warning("Connection to %s failed..."%self.url) 
    148151        return response 
    149152 
Note: See TracChangeset for help on using the changeset viewer.