E5Network/E5NetworkProxyFactory.py

changeset 945
8cd4d08fa9f6
parent 882
34b86be88bf0
child 1058
fa1c0fa31041
--- a/E5Network/E5NetworkProxyFactory.py	Fri Mar 11 08:55:14 2011 +0100
+++ b/E5Network/E5NetworkProxyFactory.py	Fri Mar 11 16:51:57 2011 +0100
@@ -20,6 +20,7 @@
 import Preferences
 import Globals
 
+
 def schemeFromProxyType(proxyType):
     """
     Module function to determine the scheme name from the proxy type.
@@ -38,6 +39,7 @@
         scheme = "NoProxy"
     return scheme
 
+
 def proxyAuthenticationRequired(proxy, auth):
     """
     Module slot to handle a proxy authentication request.
@@ -45,7 +47,7 @@
     @param proxy reference to the proxy object (QNetworkProxy)
     @param auth reference to the authenticator object (QAuthenticator)
     """
-    info = QCoreApplication.translate("E5NetworkProxyFactory", 
+    info = QCoreApplication.translate("E5NetworkProxyFactory",
         "<b>Connect to proxy '{0}' using:</b>")\
         .format(Qt.escape(proxy.hostName()))
     
@@ -62,6 +64,7 @@
             proxy.setUser(username)
             proxy.setPassword(password)
 
+
 class E5NetworkProxyFactory(QNetworkProxyFactory):
     """
     Class implementing a network proxy factory.
@@ -104,7 +107,7 @@
                                 proxyType = QNetworkProxy.FtpCachingProxy
                             else:
                                 proxyType = QNetworkProxy.HttpProxy
-                            proxy = QNetworkProxy(proxyType, url.host(), url.port(), 
+                            proxy = QNetworkProxy(proxyType, url.host(), url.port(),
                                                   url.userName(), url.password())
                             proxyList = [proxy]
                             break
@@ -128,26 +131,26 @@
                 host = Preferences.getUI("ProxyHost/{0}".format(protocol))
                 if not host:
                     E5MessageBox.critical(None,
-                        QCoreApplication.translate("E5NetworkProxyFactory", 
+                        QCoreApplication.translate("E5NetworkProxyFactory",
                             "Proxy Configuration Error"),
-                        QCoreApplication.translate("E5NetworkProxyFactory", 
+                        QCoreApplication.translate("E5NetworkProxyFactory",
                             """Proxy usage was activated"""
                             """ but no proxy host for protocol"""
                             """ '{0}' configured.""").format(protocol))
                     return [QNetworkProxy(QNetworkProxy.DefaultProxy)]
                 else:
                     if protocol == "Http":
-                        proxy = QNetworkProxy(QNetworkProxy.HttpProxy, host, 
+                        proxy = QNetworkProxy(QNetworkProxy.HttpProxy, host,
                             Preferences.getUI("ProxyPort/Http"),
                             Preferences.getUI("ProxyUser/Http"),
                             Preferences.getUI("ProxyPassword/Http"))
                     elif protocol == "Https":
-                        proxy = QNetworkProxy(QNetworkProxy.HttpCachingProxy, host, 
+                        proxy = QNetworkProxy(QNetworkProxy.HttpCachingProxy, host,
                             Preferences.getUI("ProxyPort/Https"),
                             Preferences.getUI("ProxyUser/Https"),
                             Preferences.getUI("ProxyPassword/Https"))
                     elif protocol == "Ftp":
-                        proxy = QNetworkProxy(QNetworkProxy.FtpCachingProxy, host, 
+                        proxy = QNetworkProxy(QNetworkProxy.FtpCachingProxy, host,
                             Preferences.getUI("ProxyPort/Ftp"),
                             Preferences.getUI("ProxyUser/Ftp"),
                             Preferences.getUI("ProxyPassword/Ftp"))

eric ide

mercurial