[Pkg-anonymity-tools] [onionshare] 20/57: pep8: no space after {[ or before ]}, reindent

Ulrike Uhlig u-guest at moszumanska.debian.org
Tue May 19 18:18:54 UTC 2015


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to annotated tag 0.7
in repository onionshare.

commit 152bc32ba7fe9d3ef711d70b782f5dd3eb9b1843
Author: Thomas Waldmann <tw at waldmann-edv.de>
Date:   Tue Nov 18 18:41:45 2014 +0100

    pep8: no space after {[ or before ]}, reindent
---
 onionshare/onionshare.py |  2 +-
 onionshare/socks.py      | 50 ++++++++++++++++++++++++++----------------------
 2 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py
index 57da711..6662e98 100644
--- a/onionshare/onionshare.py
+++ b/onionshare/onionshare.py
@@ -145,7 +145,7 @@ class OnionShare(object):
                     del hsdic['HiddenServicePort'][dropme]
                 hsdic['HiddenServiceDir'] = hsdic.get('HiddenServiceDir', [])+[self.hidserv_dir]
                 hsdic['HiddenServicePort'] = hsdic.get('HiddenServicePort', [])+[
-                    '80 127.0.0.1:{0}'.format(self.port) ]
+                    '80 127.0.0.1:{0}'.format(self.port)]
 
                 self.controller.set_options(hsdic2list(hsdic))
 
diff --git a/onionshare/socks.py b/onionshare/socks.py
index 49b96b7..cbfabd0 100644
--- a/onionshare/socks.py
+++ b/onionshare/socks.py
@@ -105,25 +105,28 @@ class HTTPError(ProxyError):
     pass
 
 
-SOCKS4_ERRORS = { 0x5B: "Request rejected or failed",
-                  0x5C: "Request rejected because SOCKS server cannot connect to identd on the client",
-                  0x5D: "Request rejected because the client program and identd report different user-ids"
-                }
-
-SOCKS5_ERRORS = { 0x01: "General SOCKS server failure",
-                  0x02: "Connection not allowed by ruleset",
-                  0x03: "Network unreachable",
-                  0x04: "Host unreachable",
-                  0x05: "Connection refused",
-                  0x06: "TTL expired",
-                  0x07: "Command not supported, or protocol error",
-                  0x08: "Address type not supported"
-                }
-
-DEFAULT_PORTS = { SOCKS4: 1080,
-                  SOCKS5: 1080,
-                  HTTP: 8080
-                }
+SOCKS4_ERRORS = {
+    0x5B: "Request rejected or failed",
+    0x5C: "Request rejected because SOCKS server cannot connect to identd on the client",
+    0x5D: "Request rejected because the client program and identd report different user-ids",
+}
+
+SOCKS5_ERRORS = {
+    0x01: "General SOCKS server failure",
+    0x02: "Connection not allowed by ruleset",
+    0x03: "Network unreachable",
+    0x04: "Host unreachable",
+    0x05: "Connection refused",
+    0x06: "TTL expired",
+    0x07: "Command not supported, or protocol error",
+    0x08: "Address type not supported",
+}
+
+DEFAULT_PORTS = {
+    SOCKS4: 1080,
+    SOCKS5: 1080,
+    HTTP: 8080,
+}
 
 
 def set_default_proxy(proxy_type=None, addr=None, port=None, rdns=True, username=None, password=None):
@@ -205,10 +208,11 @@ class socksocket(socket.socket):
         self.proxy_sockname = None
         self.proxy_peername = None
 
-        self.proxy_negotiators = { SOCKS4: self._negotiate_SOCKS4,
-                                   SOCKS5: self._negotiate_SOCKS5,
-                                   HTTP: self._negotiate_HTTP
-                                 }
+        self.proxy_negotiators = {
+            SOCKS4: self._negotiate_SOCKS4,
+            SOCKS5: self._negotiate_SOCKS5,
+            HTTP: self._negotiate_HTTP,
+        }
 
     def _recvall(self, count):
         """

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/onionshare.git



More information about the Pkg-anonymity-tools mailing list