[Pkg-privacy-commits] [obfsproxy] 69/353: Fix imports to suit the new directory structure.
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:41 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 46883876741b835682ba30f0ecdaecc23883d4a6
Author: George Kadianakis <desnacked at riseup.net>
Date: Mon Sep 17 18:21:10 2012 +0300
Fix imports to suit the new directory structure.
---
obfsproxy.py | 17 ++++++++---------
obfsproxy/managed/client.py | 8 ++++----
obfsproxy/managed/server.py | 8 ++++----
obfsproxy/network/socks.py | 2 +-
obfsproxy/test/tester.py | 2 +-
obfsproxy/transports/obfs2.py | 2 +-
obfsproxy/transports/obfs3.py | 2 +-
tools/manager/clientManager.py | 2 +-
tools/manager/serverManager.py | 2 +-
9 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/obfsproxy.py b/obfsproxy.py
old mode 100644
new mode 100755
index 1387acf..3833a35
--- a/obfsproxy.py
+++ b/obfsproxy.py
@@ -10,8 +10,7 @@ Currently, not all of the obfsproxy command line options have been implemented.
import os
import sys
import argparse
-print sys.path
-import obfsproxy.transports.base as base
+import obfsproxy.transports.transports as transports
import obfsproxy.common.log as log
# XXX kill these
@@ -24,8 +23,8 @@ sys.path.insert(0,
from pyptlib.easy.util import checkClientMode
-from obfsproxy.framework.managed.server import ManagedServer
-from obfsproxy.framework.managed.client import ManagedClient
+from obfsproxy.managed.server import ManagedServer
+from obfsproxy.managed.client import ManagedClient
def set_up_cli_parsing():
"""Set up our CLI parser. Register our arguments and options and
@@ -54,7 +53,7 @@ def set_up_cli_parsing():
"""Add a subparser for each transport. Also add a
transport-specific function to later validate the parsed
arguments."""
- for transport, transport_class in base.transports.items():
+ for transport, transport_class in transports.transports.items():
subparser = subparsers.add_parser(transport, help='%s help' % transport)
transport_class['client'].register_external_mode_cli(subparser) # XXX
subparser.set_defaults(validation_function=transport_class['client'].validate_external_mode_cli)
@@ -77,16 +76,16 @@ def do_external_mode(args):
assert(args)
assert(args.name)
- assert(args.name in base.transports)
+ assert(args.name in transports.transports)
- transportClass = base.get_transport_class_from_name_and_mode(args.name, args.mode)
+ transportClass = transports.get_transport_class_from_name_and_mode(args.name, args.mode)
if (transportClass is None):
log.error("Transport class was not found for '%s' in mode '%s'" % (args.name, args.mode))
sys.exit(1)
# XXX functionify
- import obfsproxy.framework.network as network
- import obfsproxy.framework.socks as socks
+ import obfsproxy.network.network as network
+ import obfsproxy.network.socks as socks
from twisted.internet import reactor, error, address, tcp
if (args.mode == 'client') or (args.mode == 'server'):
diff --git a/obfsproxy/managed/client.py b/obfsproxy/managed/client.py
index 7e646ff..56ad728 100644
--- a/obfsproxy/managed/client.py
+++ b/obfsproxy/managed/client.py
@@ -2,10 +2,10 @@
# -*- coding: utf-8 -*-
# XXX put listener/client-creation functions in their own file
-import obfsproxy.framework.socks as socks
+import obfsproxy.network.socks as socks
from twisted.internet import reactor, error, address, tcp
-import obfsproxy.transports.base as base
+import obfsproxy.transports.transports as transports
from pyptlib.easy.client import init, reportSuccess, reportFailure, \
reportEnd
@@ -16,7 +16,7 @@ import pprint
class ManagedClient:
def __init__(self):
- managedInfo = init(base.transports.keys())
+ managedInfo = init(transports.transports.keys())
if managedInfo is None: # XXX what should we return?
return
@@ -46,7 +46,7 @@ class ManagedClient:
representing where we managed to bind.
"""
- clientClass = base.get_transport_class_from_name_and_mode(name, 'client')
+ clientClass = transports.get_transport_class_from_name_and_mode(name, 'client')
if not clientClass:
log.error("Could not find transport class for '%s' (%s)." % (name, 'client'))
return False, None
diff --git a/obfsproxy/managed/server.py b/obfsproxy/managed/server.py
index 1d4844b..dad5370 100644
--- a/obfsproxy/managed/server.py
+++ b/obfsproxy/managed/server.py
@@ -2,10 +2,10 @@
# -*- coding: utf-8 -*-
# XXX put listener/client-creation functions in their own file
-import obfsproxy.framework.network as network
+import obfsproxy.network.network as network
from twisted.internet import reactor, error, address, tcp
-import obfsproxy.transports.base as base
+import obfsproxy.transports.transports as transports
from pyptlib.easy.server import init, reportSuccess, reportFailure, \
reportEnd
@@ -16,7 +16,7 @@ import pprint
class ManagedServer:
def __init__(self):
- managedInfo = init(base.transports.keys())
+ managedInfo = init(transports.transports.keys())
if managedInfo is None: # XXX what is this function supposed to return?!
log.warning("pyptlib failed to init().")
return
@@ -47,7 +47,7 @@ class ManagedServer:
representing where we managed to bind.
"""
- serverClass = base.get_transport_class_from_name_and_mode(name, 'server')
+ serverClass = transports.get_transport_class_from_name_and_mode(name, 'server')
if not serverClass:
log.error("Could not find transport class for '%s' (%s)." % (name, 'server'))
return False, None
diff --git a/obfsproxy/network/socks.py b/obfsproxy/network/socks.py
index debd185..20c05d6 100644
--- a/obfsproxy/network/socks.py
+++ b/obfsproxy/network/socks.py
@@ -2,7 +2,7 @@ from twisted.protocols import socks
from twisted.internet.protocol import Protocol, Factory, ClientFactory
import obfsproxy.common.log as log
-import obfsproxy.framework.network as network
+import obfsproxy.network.network as network
class MySOCKSv4Outgoing(socks.SOCKSv4Outgoing, object):
"""
diff --git a/obfsproxy/test/tester.py b/obfsproxy/test/tester.py
index 39ccec4..1c912e6 100644
--- a/obfsproxy/test/tester.py
+++ b/obfsproxy/test/tester.py
@@ -46,7 +46,7 @@ class Obfsproxy(subprocess.Popen):
"""
def __init__(self, *args, **kwargs):
"""Spawns obfsproxy with 'args'"""
- argv = ["./src/cli.py", "--no-log"]
+ argv = ["../../obfsproxy.py", "--no-log"]
if len(args) == 1 and (isinstance(args[0], list) or
isinstance(args[0], tuple)):
argv.extend(args[0])
diff --git a/obfsproxy/transports/obfs2.py b/obfsproxy/transports/obfs2.py
index 2ae4dfb..38593a5 100644
--- a/obfsproxy/transports/obfs2.py
+++ b/obfsproxy/transports/obfs2.py
@@ -12,7 +12,7 @@ import hmac
import hashlib
import b64
-from obfsproxy.crypto.aes import AESCoder
+from obfsproxy.common.aes import AESCoder
from obfsproxy.transports.base import BaseDaemon
MAGIC_VALUE = decode('2BF5CA7E')
diff --git a/obfsproxy/transports/obfs3.py b/obfsproxy/transports/obfs3.py
index 92e8832..2bb34a3 100644
--- a/obfsproxy/transports/obfs3.py
+++ b/obfsproxy/transports/obfs3.py
@@ -9,7 +9,7 @@ from dust.extensions.lite.lite_socket2 import makeSession, \
makeEphemeralSession, createEphemeralKeypair
from dust.core.dust_packet import IV_SIZE, KEY_SIZE
-from obfsproxy.crypto.aes import AESCoder
+from obfsproxy.common.aes import AESCoder
from obfsproxy.transports.base import BaseDaemon
HANDSHAKE = 0
diff --git a/tools/manager/clientManager.py b/tools/manager/clientManager.py
index 1b418e9..3e77a9a 100644
--- a/tools/manager/clientManager.py
+++ b/tools/manager/clientManager.py
@@ -10,7 +10,7 @@ Managers are only necessary for testing. In actual deployment, Tor can be used.
import os
import sys
-from obfsproxy.manager.manager import Manager
+from manager import Manager
class ClientManager(Manager):
diff --git a/tools/manager/serverManager.py b/tools/manager/serverManager.py
index 1c4ba63..df9ffeb 100644
--- a/tools/manager/serverManager.py
+++ b/tools/manager/serverManager.py
@@ -10,7 +10,7 @@ Managers are only necessary for testing. In actual deployment, Tor can be used.
import os
import sys
-from obfsproxy.manager.manager import Manager
+from manager import Manager
class ServerManager(Manager):
--
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