[Pkg-privacy-commits] [obfsproxy] 13/353: PEP 8
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:33 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository obfsproxy.
commit 87bbc3ce5d3f2ede644bf8ea6341fadc1b9d147e
Author: Brandon Wiley <brandon at blanu.net>
Date: Mon Jul 2 12:15:07 2012 -0500
PEP 8
---
src/obfsproxy/__init__.py | 1 +
src/obfsproxy/cli/obfsproxy.py | 7 +++++--
src/obfsproxy/framework/__init__.py | 1 +
src/obfsproxy/framework/external/__init__.py | 1 +
src/obfsproxy/framework/loopback.py | 1 +
src/obfsproxy/framework/managed/__init__.py | 1 +
src/obfsproxy/framework/managed/client.py | 27 +++++++++++++++++----------
src/obfsproxy/framework/managed/server.py | 26 ++++++++++++++++----------
src/obfsproxy/framework/proxy.py | 1 +
src/obfsproxy/framework/shared.py | 2 ++
src/obfsproxy/framework/socks.py | 1 +
src/obfsproxy/manager/__init__.py | 1 +
src/obfsproxy/manager/clientManager.py | 1 +
src/obfsproxy/manager/manager.py | 1 +
src/obfsproxy/manager/serverManager.py | 1 +
src/obfsproxy/transports/__init__.py | 1 +
16 files changed, 52 insertions(+), 22 deletions(-)
diff --git a/src/obfsproxy/__init__.py b/src/obfsproxy/__init__.py
index 836e3e8..e0e3e1a 100644
--- a/src/obfsproxy/__init__.py
+++ b/src/obfsproxy/__init__.py
@@ -1,2 +1,3 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
diff --git a/src/obfsproxy/cli/obfsproxy.py b/src/obfsproxy/cli/obfsproxy.py
index 8cc0686..f219a99 100644
--- a/src/obfsproxy/cli/obfsproxy.py
+++ b/src/obfsproxy/cli/obfsproxy.py
@@ -1,5 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
import argparse
from pyptlib.framework.server import ManagedServer
@@ -25,6 +26,7 @@ if __name__ == '__main__':
default=False,
help='enabled managed mode, for use when called by tor'
)
+
# parser.add_argument('--dest', nargs=1,
# help='set destination, enable client mode instead of server mode'
# )
@@ -39,14 +41,15 @@ if __name__ == '__main__':
print args
- daemon=None
+ daemon = None
if managed:
if dest:
daemon = ManagedClient()
else:
daemon = ManagedServer()
else:
- print('Unsupported mode. Only managed mode is available at the moment.')
+ print 'Unsupported mode. Only managed mode is available at the moment.'
+
# if dest:
# daemon = ExternalClient()
# else:
diff --git a/src/obfsproxy/framework/__init__.py b/src/obfsproxy/framework/__init__.py
index 836e3e8..e0e3e1a 100644
--- a/src/obfsproxy/framework/__init__.py
+++ b/src/obfsproxy/framework/__init__.py
@@ -1,2 +1,3 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
diff --git a/src/obfsproxy/framework/external/__init__.py b/src/obfsproxy/framework/external/__init__.py
index 836e3e8..e0e3e1a 100644
--- a/src/obfsproxy/framework/external/__init__.py
+++ b/src/obfsproxy/framework/external/__init__.py
@@ -1,2 +1,3 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
diff --git a/src/obfsproxy/framework/loopback.py b/src/obfsproxy/framework/loopback.py
index 38ef29f..ce6d094 100644
--- a/src/obfsproxy/framework/loopback.py
+++ b/src/obfsproxy/framework/loopback.py
@@ -1,5 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
import monocle
from monocle import _o
monocle.init('tornado')
diff --git a/src/obfsproxy/framework/managed/__init__.py b/src/obfsproxy/framework/managed/__init__.py
index 836e3e8..e0e3e1a 100644
--- a/src/obfsproxy/framework/managed/__init__.py
+++ b/src/obfsproxy/framework/managed/__init__.py
@@ -1,2 +1,3 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
diff --git a/src/obfsproxy/framework/managed/client.py b/src/obfsproxy/framework/managed/client.py
index 1fe97fa..49d6f19 100755
--- a/src/obfsproxy/framework/managed/client.py
+++ b/src/obfsproxy/framework/managed/client.py
@@ -11,24 +11,30 @@ from monocle.stack.network import add_service
from obfsproxy.framework.socks import SocksHandler
from obfsproxy.transports.dummy import DummyClient
-from pyptlib.easy.client import init, reportSucess, reportFailure, reportEnd
+from pyptlib.easy.client import init, reportSucess, reportFailure, \
+ reportEnd
+
class TransportLaunchException(Exception):
- pass
+
+ pass
+
class ManagedClient:
+
def __init__(self):
- self.handler=SocksHandler()
-
+ self.handler = SocksHandler()
+
supportedTransports = ['dummy', 'rot13']
- matchedTransports=init(supportedTransports)
+ matchedTransports = init(supportedTransports)
for transport in matchedTransports:
- try:
- self.launchClient(transport, 8182)
- reportSuccess(transport, 5, ('127.0.0.1', 8182), None, None)
- except TransportLaunchException:
- reportFailure(transport, 'Failed to launch')
+ try:
+ self.launchClient(transport, 8182)
+ reportSuccess(transport, 5, ('127.0.0.1', 8182), None,
+ None)
+ except TransportLaunchException:
+ reportFailure(transport, 'Failed to launch')
reportEnd()
eventloop.run()
@@ -42,5 +48,6 @@ class ManagedClient:
self.handler.setTransport(client)
add_service(Service(self.handler, port=port))
+
if __name__ == '__main__':
client = ManagedClient()
diff --git a/src/obfsproxy/framework/managed/server.py b/src/obfsproxy/framework/managed/server.py
index 2d6671b..a2c4516 100755
--- a/src/obfsproxy/framework/managed/server.py
+++ b/src/obfsproxy/framework/managed/server.py
@@ -11,24 +11,29 @@ from monocle.stack.network import add_service
from obfsproxy.framework.proxy import ProxyHandler
from obfsproxy.transports.dummy import DummyClient
-from pyptlib.easy.server import init, reportSucess, reportFailure, reportEnd
+from pyptlib.easy.server import init, reportSucess, reportFailure, \
+ reportEnd
+
class TransportLaunchException(Exception):
- pass
+
+ pass
+
class ManagedServer:
+
def __init__(self):
- self.handler=ProxyHandler()
-
+ self.handler = ProxyHandler()
+
supportedTransports = ['dummy', 'rot13']
- matchedTransports=init(supportedTransports)
+ matchedTransports = init(supportedTransports)
for transport in matchedTransports:
- try:
- self.launchServer(transport, 8182)
- reportSuccess(transport, ('127.0.0.1', 8182), None)
- except TransportLaunchException:
- reportFailure(transport, 'Failed to launch')
+ try:
+ self.launchServer(transport, 8182)
+ reportSuccess(transport, ('127.0.0.1', 8182), None)
+ except TransportLaunchException:
+ reportFailure(transport, 'Failed to launch')
reportEnd()
eventloop.run()
@@ -42,5 +47,6 @@ class ManagedServer:
self.handler.setTransport(server)
add_service(Service(self.handler, port=port))
+
if __name__ == '__main__':
server = ManagedServer()
diff --git a/src/obfsproxy/framework/proxy.py b/src/obfsproxy/framework/proxy.py
index d518033..18bbeb9 100644
--- a/src/obfsproxy/framework/proxy.py
+++ b/src/obfsproxy/framework/proxy.py
@@ -1,5 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
from struct import unpack
from socket import inet_ntoa
diff --git a/src/obfsproxy/framework/shared.py b/src/obfsproxy/framework/shared.py
index 488914e..9cc2359 100644
--- a/src/obfsproxy/framework/shared.py
+++ b/src/obfsproxy/framework/shared.py
@@ -1,5 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
import monocle
from monocle import _o, Return
@@ -15,6 +16,7 @@ def pump(
transform,
debug=False,
):
+
while True:
try:
message = (yield input.read_some())
diff --git a/src/obfsproxy/framework/socks.py b/src/obfsproxy/framework/socks.py
index 5070e25..107cfd0 100644
--- a/src/obfsproxy/framework/socks.py
+++ b/src/obfsproxy/framework/socks.py
@@ -1,5 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
from struct import unpack
from socket import inet_ntoa
diff --git a/src/obfsproxy/manager/__init__.py b/src/obfsproxy/manager/__init__.py
index 836e3e8..e0e3e1a 100644
--- a/src/obfsproxy/manager/__init__.py
+++ b/src/obfsproxy/manager/__init__.py
@@ -1,2 +1,3 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
diff --git a/src/obfsproxy/manager/clientManager.py b/src/obfsproxy/manager/clientManager.py
index 6d51d9b..7b1fbc5 100644
--- a/src/obfsproxy/manager/clientManager.py
+++ b/src/obfsproxy/manager/clientManager.py
@@ -1,5 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
import os
from pyptlib.manager.manager import Manager
diff --git a/src/obfsproxy/manager/manager.py b/src/obfsproxy/manager/manager.py
index 869e11f..424936f 100644
--- a/src/obfsproxy/manager/manager.py
+++ b/src/obfsproxy/manager/manager.py
@@ -1,5 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
import os
import sys
import subprocess
diff --git a/src/obfsproxy/manager/serverManager.py b/src/obfsproxy/manager/serverManager.py
index a3a3efe..d9f0c78 100644
--- a/src/obfsproxy/manager/serverManager.py
+++ b/src/obfsproxy/manager/serverManager.py
@@ -1,5 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
import os
from pyptlib.manager.manager import Manager
diff --git a/src/obfsproxy/transports/__init__.py b/src/obfsproxy/transports/__init__.py
index 836e3e8..e0e3e1a 100644
--- a/src/obfsproxy/transports/__init__.py
+++ b/src/obfsproxy/transports/__init__.py
@@ -1,2 +1,3 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/obfsproxy.git
More information about the Pkg-privacy-commits
mailing list