Skip to content

Commit 847db84

Browse files
committed
Rename pyzmqtulip to aiozmq
1 parent efe1d48 commit 847db84

File tree

16 files changed

+40
-40
lines changed

16 files changed

+40
-40
lines changed

README.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ Event loop
99
To use tulip with zmq event loop you have to install new event loop::
1010

1111
import tulip
12-
import zmqtulip
12+
import aiozmq
1313

14-
loop = zmqtulip.new_event_loop()
14+
loop = aiozmq.new_event_loop()
1515
tulip.set_event_loop(loop)
1616

1717

1818
Usage
1919
-----
2020

21-
Instead of using `zmq.Context` directly, use `zmqtulip.Context`.
21+
Instead of using `zmq.Context` directly, use `aiozmq.Context`.
2222
All `recvXXX` methods of Socket object are coroutines::
2323

2424
# simple client
2525

2626
import tulip
2727
import zmq
28-
import zmqtulip
28+
import aiozmq
2929

3030
@tulip.coroutine
3131
def read_socket(sock):
@@ -35,10 +35,10 @@ All `recvXXX` methods of Socket object are coroutines::
3535
# do_some_work(msg)
3636

3737
if __name__ == '__main__':
38-
loop = zmqtulip.new_event_loop()
38+
loop = aiozmq.new_event_loop()
3939
tulip.set_event_loop(loop)
4040

41-
ctx = zmqtulip.Context(loop=loop) # create a new context
41+
ctx = aiozmq.Context(loop=loop) # create a new context
4242
sock = ctx.socket(zmq.PULL)
4343
sock.connect('ipc:///tmp/zmqtest')
4444

@@ -59,4 +59,4 @@ Requirements
5959
License
6060
-------
6161

62-
pyzmqtulip is offered under the BSD license.
62+
pyaiozmq is offered under the BSD license.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/simple.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import tulip
22
import zmq
3-
import zmqtulip
3+
import aiozmq
44

5-
loop = zmqtulip.new_event_loop()
5+
loop = aiozmq.new_event_loop()
66
tulip.set_event_loop(loop)
77

88
# server
9-
ctx = zmqtulip.Context(loop=loop)
9+
ctx = aiozmq.Context(loop=loop)
1010
#sock1 = ctx.socket(zmq.PUSH)
1111
#sock1.bind('ipc:///tmp/zmqtest')
1212

@@ -25,7 +25,7 @@ def send_data():
2525

2626

2727
# client
28-
ctx = zmqtulip.Context(loop=loop) # create a new context to kick the wheels
28+
ctx = aiozmq.Context(loop=loop) # create a new context to kick the wheels
2929
sock2 = ctx.socket(zmq.PULL)
3030
sock2.connect('ipc:///tmp/zmqtest')
3131

examples/srv.py

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import email.message
66
import os
77
import sys
8-
import zmqtulip
8+
import aiozmq
99
try:
1010
import ssl
1111
except ImportError: # pragma: no cover
@@ -138,7 +138,7 @@ def main():
138138
else:
139139
sslcontext = None
140140

141-
loop = zmqtulip.new_event_loop()
141+
loop = aiozmq.new_event_loop()
142142
tulip.set_event_loop(loop)
143143
f = loop.start_serving(
144144
lambda: HttpServer(debug=True, keep_alive=75), args.host, args.port,

examples/tcp_echo.py

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import argparse
44
import signal
55
import tulip
6-
import zmqtulip
6+
import aiozmq
77

88

99
class EchoServer(tulip.Protocol):
@@ -99,7 +99,7 @@ def start_server(loop, host, port):
9999
print('Please specify --server or --client\n')
100100
ARGS.print_help()
101101
else:
102-
loop = zmqtulip.new_event_loop()
102+
loop = aiozmq.new_event_loop()
103103
loop.add_signal_handler(signal.SIGINT, loop.stop)
104104

105105
tulip.set_event_loop(loop)

examples/udp_echo.py

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
import signal
66
import tulip
7-
import zmqtulip
7+
import aiozmq
88

99

1010
class MyServerUdpEchoProtocol:
@@ -84,7 +84,7 @@ def start_client(loop, addr):
8484
print('Please specify --server or --client\n')
8585
ARGS.print_help()
8686
else:
87-
loop = zmqtulip.new_event_loop()
87+
loop = aiozmq.new_event_loop()
8888
loop.add_signal_handler(signal.SIGINT, loop.stop)
8989

9090
tulip.set_event_loop(loop)

examples/wssrv.py

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import socket
77
import signal
88
import time
9-
import zmqtulip
9+
import aiozmq
1010
import tulip
1111
import tulip.http
1212
from tulip.http import websocket
@@ -302,7 +302,7 @@ def main():
302302
args.host, port = args.host.split(':', 1)
303303
args.port = int(port)
304304

305-
tulip.set_event_loop(zmqtulip.new_event_loop())
305+
tulip.set_event_loop(aiozmq.new_event_loop())
306306

307307
superviser = Superviser(args)
308308
superviser.start()

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ zip_ok = false
33

44
[nosetests]
55
nocapture = 1
6-
cover-package = zmqtulip
6+
cover-package = aiozmq
77
cover-erase = 1

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ def read(f):
1414

1515
def read_version():
1616
regexp = re.compile(r"^__version__\W*=\W*'([\d.]+)'")
17-
init_py = os.path.join(os.path.dirname(__file__), 'zmqtulip', '__init__.py')
17+
init_py = os.path.join(os.path.dirname(__file__), 'aiozmq', '__init__.py')
1818
with open(init_py) as f:
1919
for line in f:
2020
match = regexp.match(line)
2121
if match is not None:
2222
return match.group(1)
2323
else:
24-
raise RuntimeError('Cannot find version in zmqtulip/__init__.py')
24+
raise RuntimeError('Cannot find version in aiozmq/__init__.py')
2525

2626

27-
setup(name='pyzmqtulip',
27+
setup(name='pyaiozmq',
2828
version=read_version(),
2929
description=('zmq integration with tulip.'),
3030
long_description='\n\n'.join((read('README.rst'), read('CHANGES.txt'))),
@@ -35,7 +35,7 @@ def read_version():
3535
'Programming Language :: Python :: 3.3'],
3636
author='Nikolay Kim',
3737
author_email='[email protected]',
38-
url='https://github.com/fafhrd91/pyzmqtulip/',
38+
url='https://github.com/fafhrd91/pyaiozmq/',
3939
license='BSD',
4040
packages=find_packages(),
4141
install_requires = install_requires,

tests/core_test.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
import unittest
44
import unittest.mock
55
import zmq
6-
import zmqtulip
7-
import zmqtulip.core
6+
import aiozmq
7+
import aiozmq.core
88

99

1010
class CoreTests(unittest.TestCase):
1111

1212
def setUp(self):
13-
self.loop = zmqtulip.new_event_loop()
14-
self.ctx = zmqtulip.Context(loop=self.loop)
13+
self.loop = aiozmq.new_event_loop()
14+
self.ctx = aiozmq.Context(loop=self.loop)
1515
asyncio.set_event_loop(None)
1616

1717
def tearDown(self):
@@ -20,21 +20,21 @@ def tearDown(self):
2020
def test_context_global_event_loop(self):
2121
asyncio.set_event_loop(self.loop)
2222
try:
23-
ctx = zmqtulip.Context()
23+
ctx = aiozmq.Context()
2424
self.assertIs(ctx._loop, self.loop)
2525
finally:
2626
asyncio.set_event_loop(None)
2727

2828
def test_context_socket(self):
29-
ctx = zmqtulip.Context(loop=self.loop)
29+
ctx = aiozmq.Context(loop=self.loop)
3030
self.assertIs(ctx._loop, self.loop)
3131

3232
socket = ctx.socket(zmq.PUB)
3333
socket.close()
34-
self.assertIsInstance(socket, zmqtulip.core.Socket)
34+
self.assertIsInstance(socket, aiozmq.core.Socket)
3535
self.assertIs(socket._loop, self.loop)
3636

37-
@unittest.mock.patch('zmqtulip.core.zmq.Socket')
37+
@unittest.mock.patch('aiozmq.core.zmq.Socket')
3838
def test_recv_err(self, zmqSocket):
3939
err = zmq.ZMQError()
4040
err.errno = -1
@@ -61,9 +61,9 @@ def test_send_checks(self):
6161
class CoreIntegrationalTests(unittest.TestCase):
6262

6363
def setUp(self):
64-
self.loop = zmqtulip.new_event_loop()
65-
self.srv_ctx = zmqtulip.Context(loop=self.loop)
66-
self.c_ctx = zmqtulip.Context(loop=self.loop)
64+
self.loop = aiozmq.new_event_loop()
65+
self.srv_ctx = aiozmq.Context(loop=self.loop)
66+
self.c_ctx = aiozmq.Context(loop=self.loop)
6767
asyncio.set_event_loop(None)
6868

6969
def tearDown(self):

tests/events_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from asyncio import test_utils
3030

3131

32-
import zmqtulip
32+
import aiozmq
3333

3434

3535
def data_file(filename):
@@ -1619,4 +1619,4 @@ def connect(cmd=None, **kwds):
16191619
class ZmqSelectorEventLoopTests(EventLoopTestsMixin, unittest.TestCase):
16201620

16211621
def create_event_loop(self):
1622-
return zmqtulip.new_event_loop()
1622+
return aiozmq.new_event_loop()

tests/zmq_events_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import unittest
22
import asyncio
3-
import zmqtulip
3+
import aiozmq
44
import zmq
55

66
from test import support # import from standard python test suite
77

88

9-
class Protocol(zmqtulip.ZmqProtocol):
9+
class Protocol(aiozmq.ZmqProtocol):
1010

1111
def __init__(self, loop):
1212
self.transport = None
@@ -41,7 +41,7 @@ def msg_received(self, data, *multipart):
4141
class ZmqEventLoopTests(unittest.TestCase):
4242

4343
def setUp(self):
44-
self.loop = zmqtulip.ZmqEventLoop()
44+
self.loop = aiozmq.ZmqEventLoop()
4545
asyncio.set_event_loop(None)
4646

4747
def tearDown(self):

0 commit comments

Comments
 (0)