This commit is contained in:
Tobias Oberstein 2015-09-05 12:30:52 +02:00
parent a54d0d9a36
commit a1bf3fd7c8
14 changed files with 16 additions and 22 deletions

View File

@ -16,7 +16,8 @@ autopep8:
# This will run pep8, pyflakes and can skip lines that end with # noqa
flake8:
flake8 --ignore=E501,E901,F401,F403,F811,F821,F841 .
flake8 --ignore=E501,E901 .
# flake8 --ignore=E501,E901,F401,F403,F811,F821,F841 .
pylint:
pylint -d line-too-long,invalid-name .

View File

@ -19,7 +19,6 @@ import sys
import time
import random
import colors
import subprocess
prompt = 'user@machine:~/autobahn-python$ '

View File

@ -60,7 +60,7 @@ if __name__ == '__main__':
options = ssl.create_default_context(cadata=open(cert_path, 'r').read())
# ...which we pass as "ssl=" to ApplicationRunner (passed to loop.create_connection)
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "wss://127.0.0.1:8083/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", u"wss://127.0.0.1:8083/ws"),
u"crossbardemo",
ssl=options, # try removing this, but still use self-signed cert
debug_wamp=False, # optional; log many WAMP details

View File

@ -25,7 +25,6 @@ from colorama import Fore
from twisted.internet.protocol import ProcessProtocol
from twisted.internet.defer import inlineCallbacks, Deferred, returnValue
from twisted.internet.error import ProcessExitedAlready
from twisted.python.failure import Failure
from twisted.internet import reactor
from twisted.internet.task import react
@ -102,8 +101,7 @@ def start_crossbar():
env = environ.copy()
env["PYTHONUNBUFFERED"] = "1"
transport = reactor.spawnProcess(
protocol, exe, args, path='.', env=env)
reactor.spawnProcess(protocol, exe, args, path='.', env=env)
yield launched
returnValue(protocol)
@ -119,7 +117,7 @@ def start_example(py_fname, color, prefix='', exe=sys.executable):
env = environ.copy()
env["PYTHONUNBUFFERED"] = "1"
transport = reactor.spawnProcess(protocol, exe, args, path='.', env=env)
reactor.spawnProcess(protocol, exe, args, path='.', env=env)
yield launched
returnValue(protocol)

View File

@ -116,7 +116,7 @@ if __name__ == '__main__':
# run WAMP application component
##
from autobahn.twisted.wamp import ApplicationRunner
router = args.router or 'ws://127.0.0.1:9000'
router = args.router or u'ws://127.0.0.1:9000'
runner = ApplicationRunner(router, u"realm1", standalone=not args.router,
debug=False, # low-level logging

View File

@ -63,7 +63,7 @@ if __name__ == '__main__':
)
# ...which we pass as "ssl=" to ApplicationRunner (passed to SSL4ClientEndpoint)
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "wss://127.0.0.1:8083/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", u"wss://127.0.0.1:8083/ws"),
u"crossbardemo",
ssl=options, # try removing this, but still use self-signed cert
debug_wamp=False, # optional; log many WAMP details

View File

@ -75,8 +75,8 @@ if __name__ == '__main__':
parser.add_argument("--websocket", default="tcp:127.0.0.1:9000",
help='WebSocket client Twisted endpoint descriptor, e.g. "tcp:127.0.0.1:9000" or "unix:/tmp/mywebsocket".')
parser.add_argument("--wsurl", default="ws://127.0.0.1:9000",
help='WebSocket URL (must suit the endpoint), e.g. "ws://127.0.0.1:9000".')
parser.add_argument("--wsurl", default=u"ws://127.0.0.1:9000",
help='WebSocket URL (must suit the endpoint), e.g. ws://127.0.0.1:9000.')
args = parser.parse_args()

View File

@ -70,8 +70,8 @@ if __name__ == '__main__':
parser.add_argument("--websocket", default="tcp:9000",
help='WebSocket server Twisted endpoint descriptor, e.g. "tcp:9000" or "unix:/tmp/mywebsocket".')
parser.add_argument("--wsurl", default="ws://127.0.0.1:9000",
help='WebSocket URL (must suit the endpoint), e.g. "ws://127.0.0.1:9000".')
parser.add_argument("--wsurl", default=u"ws://127.0.0.1:9000",
help='WebSocket URL (must suit the endpoint), e.g. ws://127.0.0.1:9000.')
parser.add_argument("--web", default="tcp:8080",
help='Web server endpoint descriptor, e.g. "tcp:8080".')

View File

@ -355,7 +355,7 @@ if __name__ == '__main__':
DEFAULT_WORKERS = psutil.NUM_CPUS
parser = argparse.ArgumentParser(description='Autobahn WebSocket Echo Multicore Server')
parser.add_argument('--wsuri', dest='wsuri', type=str, default='ws://127.0.0.1:9000', help='The WebSocket URI the server is listening on, e.g. ws://localhost:9000.')
parser.add_argument('--wsuri', dest='wsuri', type=str, default=u'ws://127.0.0.1:9000', help='The WebSocket URI the server is listening on, e.g. ws://localhost:9000.')
parser.add_argument('--port', dest='port', type=int, default=8080, help='Port to listen on for embedded Web server. Set to 0 to disable.')
parser.add_argument('--workers', dest='workers', type=int, default=DEFAULT_WORKERS, help='Number of workers to spawn - should fit the number of (physical) CPU cores.')
parser.add_argument('--noaffinity', dest='noaffinity', action="store_true", default=False, help='Do not set worker/CPU affinity.')

View File

@ -85,8 +85,6 @@ class MyServerProtocol(WebSocketServerProtocol):
if __name__ == '__main__':
import sys
from twisted.python import log
from twisted.internet import reactor

View File

@ -25,7 +25,6 @@
###############################################################################
import hashlib
from pprint import pprint
from ranstring import randomByteString
from twisted.internet import reactor
@ -66,7 +65,6 @@ class FrameBasedHashClientProtocol(WebSocketClientProtocol):
def onMessage(self, payload, isBinary):
print("Digest for frame {} computed by server: {}".format(self.count, payload.decode('utf8')))
# pprint(self.trafficStats.__json__())
self.count += 1
if self.count < FRAME_COUNT:

View File

@ -29,8 +29,8 @@ import autobahn
from autobahn.twisted.websocket import WebSocketServerProtocol, \
WebSocketServerFactory
from autobahn.websocket.protocol import WebSocketProtocol
from autobahn.websocket.compress import *
from autobahn.websocket.compress import PerMessageDeflateOffer, \
PerMessageDeflateOfferAccept
USE_STREAMING_TESTEE = False

View File

@ -51,7 +51,7 @@ if __name__ == '__main__':
wrappedFactory = Factory.forProtocol(HelloClientProtocol)
factory = WrappingWebSocketClientFactory(wrappedFactory,
"ws://127.0.0.1:9000",
u"ws://127.0.0.1:9000",
debug=False,
enableCompression=False,
autoFragmentSize=1024)

View File

@ -51,7 +51,7 @@ if __name__ == '__main__':
wrappedFactory = Factory.forProtocol(HelloServerProtocol)
factory = WrappingWebSocketServerFactory(wrappedFactory,
"ws://127.0.0.1:9000",
u"ws://127.0.0.1:9000",
debug=False,
enableCompression=False,
autoFragmentSize=1024)