[Pkg-privacy-commits] [pyptlib] 35/136: Fixed imports and undefined symbols to get client and server mode obfsproxy working

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:25:04 UTC 2015


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

infinity0 pushed a commit to branch master
in repository pyptlib.

commit 976555cefcb74a31b7da497141d83fbb24d0e9d4
Author: Brandon Wiley <brandon at blanu.net>
Date:   Wed Jul 4 16:40:43 2012 -0500

    Fixed imports and undefined symbols to get client and server mode obfsproxy working
---
 src/pyptlib/client.py      |  2 +-
 src/pyptlib/easy/client.py |  5 ++++-
 src/pyptlib/easy/server.py | 10 +++++-----
 src/pyptlib/easy/util.py   | 12 ++++++++++++
 src/pyptlib/server.py      |  2 +-
 5 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/pyptlib/client.py b/src/pyptlib/client.py
index 6e97422..11e51e2 100644
--- a/src/pyptlib/client.py
+++ b/src/pyptlib/client.py
@@ -3,7 +3,7 @@
 
 import os
 
-from pyptlib.config.config import Config
+from pyptlib.config import Config
 
 __docformat__ = 'restructuredtext'
 
diff --git a/src/pyptlib/easy/client.py b/src/pyptlib/easy/client.py
index cfa6ce9..b11f4a5 100644
--- a/src/pyptlib/easy/client.py
+++ b/src/pyptlib/easy/client.py
@@ -21,7 +21,7 @@ def init(transports):
 
     matchedTransports = []
     for transport in transports:
-        if config.checkTransportEnabled(supportedTransport):
+        if config.checkTransportEnabled(transport):
             matchedTransports.append(transport)
 
     return matchedTransports
@@ -35,14 +35,17 @@ def reportSuccess(
     optArgs,
     ):
 
+    config = ClientConfig()
     config.writeMethod(name, socksVersion, address, args, optArgs)
 
 
 def reportFailure(name, message):
+    config = ClientConfig()
     config.writeMethodError(name, message)
 
 
 def reportEnd():
+    config = ClientConfig()
     config.writeMethodEnd()
 
 
diff --git a/src/pyptlib/easy/server.py b/src/pyptlib/easy/server.py
index f3891aa..e86eecc 100644
--- a/src/pyptlib/easy/server.py
+++ b/src/pyptlib/easy/server.py
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 
 from pyptlib.config import EnvException
-from pyptlib.client import ServerConfig
+from pyptlib.server import ServerConfig
 
 
 def init(transports):
@@ -21,7 +21,7 @@ def init(transports):
 
     matchedTransports = []
     for transport in transports:
-        if config.checkTransportEnabled(supportedTransport):
+        if config.checkTransportEnabled(transport):
             matchedTransports.append(transport)
 
     return matchedTransports
@@ -30,18 +30,18 @@ def init(transports):
 def reportSuccess(
     name,
     address,
-    args,
     options,
     ):
 
+    config = ServerConfig()
     config.writeMethod(name, address, options)
 
 
 def reportFailure(name, message):
+    config = ServerConfig()
     config.writeMethodError(name, message)
 
 
 def reportEnd():
+    config = ServerConfig()
     config.writeMethodEnd()
-
-
diff --git a/src/pyptlib/easy/util.py b/src/pyptlib/easy/util.py
new file mode 100644
index 0000000..dad436d
--- /dev/null
+++ b/src/pyptlib/easy/util.py
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+from pyptlib.config import EnvException
+from pyptlib.client import ClientConfig
+
+def checkClientMode():
+  try:
+    client=ClientConfig()
+    return True
+  except EnvException:
+    return False
diff --git a/src/pyptlib/server.py b/src/pyptlib/server.py
index 9ece16d..7383660 100644
--- a/src/pyptlib/server.py
+++ b/src/pyptlib/server.py
@@ -3,7 +3,7 @@
 
 import os
 
-from pyptlib.config.config import Config
+from pyptlib.config import Config
 
 __docformat__ = 'restructuredtext'
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/pyptlib.git



More information about the Pkg-privacy-commits mailing list