Changeset c155a16 in sasview for src/sas/sasgui/guiframe/proxy.py
- Timestamp:
- Apr 4, 2017 10:06:27 AM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 463e7ffc
- Parents:
- 6722fae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/proxy.py
rd85c194 rc155a16 6 6 import logging 7 7 import re 8 9 10 logger = logging.getLogger() 8 11 9 12 ''' … … 71 74 proxy_url_list = [] 72 75 for this_pac_url in pac_urls_list: 73 logg ing.debug('Trying pac file (%s)...' % this_pac_url)76 logger.debug('Trying pac file (%s)...' % this_pac_url) 74 77 try: 75 78 response = urllib2.urlopen( 76 79 this_pac_url, timeout=self.timeout) 77 logg ing.debug('Succeeded (%s)...' % this_pac_url)80 logger.debug('Succeeded (%s)...' % this_pac_url) 78 81 except Exception: 79 logg ing.debug('Failled (%s)...' % this_pac_url)82 logger.debug('Failled (%s)...' % this_pac_url) 80 83 continue 81 84 pacStr = response.read() … … 120 123 response = None 121 124 try: 122 logg ing.debug("Trying Direct connection to %s..."%self.url)125 logger.debug("Trying Direct connection to %s..."%self.url) 123 126 response = urllib2.urlopen(req, timeout=self.timeout) 124 127 except Exception, e: 125 logg ing.debug("Failed!")126 logg ing.debug(e)128 logger.debug("Failed!") 129 logger.debug(e) 127 130 try: 128 logg ing.debug("Trying to use system proxy if it exists...")131 logger.debug("Trying to use system proxy if it exists...") 129 132 self._set_proxy() 130 133 response = urllib2.urlopen(req, timeout=self.timeout) 131 134 except Exception, e: 132 logg ing.debug("Failed!")133 logg ing.debug(e)135 logger.debug("Failed!") 136 logger.debug(e) 134 137 pac_urls = self._get_addresses_of_proxy_pac() 135 138 proxy_urls = self._parse_proxy_pac(pac_urls) 136 139 for proxy in proxy_urls: 137 140 try: 138 logg ing.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) 139 142 self._set_proxy(proxy) 140 143 response = urllib2.urlopen(req, timeout=self.timeout) 141 144 except Exception, e: 142 logg ing.debug("Failed!")143 logg ing.debug(e)145 logger.debug("Failed!") 146 logger.debug(e) 144 147 if response is not None: 145 logg ing.debug("The connection to %s was successful."%self.url)148 logger.debug("The connection to %s was successful."%self.url) 146 149 else: 147 logg ing.warning("Connection to %s failed..."%self.url)150 logger.warning("Connection to %s failed..."%self.url) 148 151 return response 149 152
Note: See TracChangeset
for help on using the changeset viewer.