Merge lp:~oubiwann/txamqp/385371-top-level-reorg into lp:txamqp

Proposed by Duncan McGreggor
Status: Rejected
Rejected by: Esteve Fernandez
Proposed branch: lp:~oubiwann/txamqp/385371-top-level-reorg
Merge into: lp:txamqp
Diff against target: None lines
To merge this branch: bzr merge lp:~oubiwann/txamqp/385371-top-level-reorg
Reviewer Review Type Date Requested Status
Esteve Fernandez Disapprove
Christopher Armstrong Pending
Thomas Herve Pending
Review via email: mp+7258@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Duncan McGreggor (oubiwann) wrote :

Could I get a review for these changes? Thomas and Chris, I believe this branch reflects a change that you guys were thinking about at UDS?

28. By Duncan McGreggor

- Fixed long lines.
- Updated example code to use PEP-8 formatting guidelines.
- Broke out callback as a top-level function (for clarity).
- Removed trailing whitespace.

29. By Duncan McGreggor

- Renamed files to remove contextually redundant "txamqp_".
- Updated README.

Revision history for this message
Thomas Herve (therve) wrote :

> Could I get a review for these changes? Thomas and Chris, I believe this
> branch reflects a change that you guys were thinking about at UDS?

I'd like to discuss it with Esteve first.

Revision history for this message
Esteve Fernandez (esteve) wrote :

> Could I get a review for these changes? Thomas and Chris, I believe this
> branch reflects a change that you guys were thinking about at UDS?

I agree with moving the specs directory to the top level directory, but not so much with removing src. IMHO, having an extra top level directory is not that cumbersome as you say, also it makes it easier to separate source code from other stuff (like Debian files, specs, etc.)

As for the README file, while I really appreciate it, it's worth pointing to the original article and giving credit to its authors (Matt Heitzenroder and Dan Reverri) instead of ripping off their work. Matt and Dan have done a much better work promoting and explaining txAMQP and txThrift in their blog than I have.

BTW, if you guys were thinking about this at UDS, why not mentioning it to upstream? I was in town after all :-)

PS: the blog post where you took the examples you added, actually links to http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/#comment-681, which in turn link to my space at fluidinfo.com. Linking to http://fluidinfo.com/stuff/esteve would have been shorter :-)

Revision history for this message
Duncan McGreggor (oubiwann) wrote :

Esteve Fernandez wrote:
>> Could I get a review for these changes? Thomas and Chris, I believe
>> this branch reflects a change that you guys were thinking about at
>> UDS?
>
> I agree with moving the specs directory to the top level directory,
> but not so much with removing src. IMHO, having an extra top level
> directory is not that cumbersome as you say, also it makes it easier
> to separate source code from other stuff (like Debian files, specs,
> etc.)

Okay, cool. Sounds like a difference of personal preference :-)

> As for the README file, while I really appreciate it, it's worth
> pointing to the original article and giving credit to its authors
> (Matt Heitzenroder and Dan Reverri) instead of ripping off their
> work.

Wow, you see that as ripping off? I see it as their contribution to the
source examples...

> BTW, if you guys were thinking about this at UDS, why not mentioning
> it to upstream? I was in town after all :-)

I think "thinking about this" is probably too strong a phrase. It was
half-mentioned in passing as being a little cumbersome, that's all.

Revision history for this message
Thomas Herve (therve) wrote :

> > Could I get a review for these changes? Thomas and Chris, I believe this
> > branch reflects a change that you guys were thinking about at UDS?
>
> I agree with moving the specs directory to the top level directory, but not so
> much with removing src. IMHO, having an extra top level directory is not that
> cumbersome as you say, also it makes it easier to separate source code from
> other stuff (like Debian files, specs, etc.)

The problem with the src/ directory is that it makes it harder to use import it in general, and to use trial in particular.

> BTW, if you guys were thinking about this at UDS, why not mentioning it to
> upstream? I was in town after all :-)

Sorry I hoped we talked about more important stuff :). I think we just mentioned that quickly in a discussion.

But as Duncan said, this is also a matter of personal preference, so I understand if you don't want to change it, even just for not breaking current users expectations.

Thanks!

Revision history for this message
Esteve Fernandez (esteve) wrote :

> Wow, you see that as ripping off? I see it as their contribution to the
> source examples...

Sorry if it sounded too harsh ("ripping off"), but their names weren't in the README file nor was a link to their blog article. The README file is an exact copy of that article (http://app.arat.us/blog/?p=38) They did all the work of documenting how to get Bazaar, RabbitMQ, etc. running and I think they deserve to be credited somewhere.

In any case, I don't think running rabbitmq-server directly is a good idea, given that the Debian package already comes with an init.d script.

Revision history for this message
Duncan McGreggor (oubiwann) wrote :

Esteve Fernandez wrote:
>> Wow, you see that as ripping off? I see it as their contribution to the
>> source examples...
>>
>
> Sorry if it sounded too harsh ("ripping off"), but their names weren't in the README file nor was a link to their blog article. The README file is an exact copy of that article (http://app.arat.us/blog/?p=38) They did all the work of documenting how to get Bazaar, RabbitMQ, etc. running and I think they deserve to be credited somewhere.
>
Indeed. I guess you didn't see the bzr log? I gave them credit there.
Good point, though: they should definitely be credited someplace more
visible than that.

Revision history for this message
Matt Heitzenroder (roder) wrote :

Thanks everyone. I just wanted to chime in to say we're honored that
you've chosen to include our (all credit belongs to Dan) humble blog
posts . We are so grateful for txamqp, please keep up the good work.
We hope we can find a real way of giving back more :)

Cheers,
Matt

On Jun 10, at 8:54 AM, Duncan McGreggor wrote:

> Esteve Fernandez wrote:
>>> Wow, you see that as ripping off? I see it as their contribution
>>> to the
>>> source examples...
>>>
>>
>> Sorry if it sounded too harsh ("ripping off"), but their names
>> weren't in the README file nor was a link to their blog article.
>> The README file is an exact copy of that article (http://app.arat.us/blog/?p=38
>> ) They did all the work of documenting how to get Bazaar, RabbitMQ,
>> etc. running and I think they deserve to be credited somewhere.
>>
> Indeed. I guess you didn't see the bzr log? I gave them credit there.
> Good point, though: they should definitely be credited someplace more
> visible than that.
>
> --
> https://code.launchpad.net/~oubiwann/txamqp/385371-top-level-reorg/
> +merge/7258
> You are subscribed to branch lp:txamqp.

Revision history for this message
Esteve Fernandez (esteve) :
review: Disapprove

Unmerged revisions

29. By Duncan McGreggor

- Renamed files to remove contextually redundant "txamqp_".
- Updated README.

28. By Duncan McGreggor

- Fixed long lines.
- Updated example code to use PEP-8 formatting guidelines.
- Broke out callback as a top-level function (for clarity).
- Removed trailing whitespace.

27. By Duncan McGreggor

Updated setup.py file.

26. By Duncan McGreggor

Renamed the example directory.

25. By Duncan McGreggor

More READM tweaks.

24. By Duncan McGreggor

More cleanup on the pub-sub example README.

23. By Duncan McGreggor

Added pub-sub example from http://app.arat.us/blog/?p=38.

22. By Duncan McGreggor

Moved thrift example into its own directory.

21. By Duncan McGreggor

Removed empty directory.

20. By Duncan McGreggor

Moved contents of src up one level.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed directory 'src/examples' => 'examples'
2=== added directory 'examples/pub-con'
3=== added file 'examples/pub-con/README'
4--- examples/pub-con/README 1970-01-01 00:00:00 +0000
5+++ examples/pub-con/README 2009-06-09 22:17:00 +0000
6@@ -0,0 +1,71 @@
7+This is a quick post on getting started using the txAMQP library with RabbitMQ
8+on Ubuntu Jaunty.
9+
10+Install RabbitMQ
11+
12+ sudo apt-get install rabbitmq-server
13+
14+Note: Looks like the installer starts the rabbitmq-server automatically. I
15+discovered this when I tried to start it from the terminal by running:
16+
17+ sudo rabbitmq-server
18+
19+which was followed by a series of angry error messages. To confirm a node was
20+already running I ran:
21+
22+ sudo rabbitmqctl status
23+
24+In case a node is not already started you can run it attached or detached from
25+the terminal:
26+
27+ sudo rabbitmq-server
28+ sudo rabbitmq-server -detached
29+
30+The server can be stopped with:
31+
32+ sudo rabbitmqctl stop
33+
34+Install Twisted
35+
36+ sudo apt-get install python-twisted
37+
38+Install txAMQP
39+
40+The instructions below install txAQMP from trunk. There are Ubuntu packages
41+available if you prefer, refer to the following for more details:
42+
43+ https://launchpad.net/~txamqpteam/+archive/ppa
44+
45+a. Install Bazaar
46+
47+ sudo apt-get install bzr
48+
49+b. Fetch txAQMP
50+
51+ cd ~
52+ bzr branch lp:txamqp txamqp
53+
54+c. Install txAMQP
55+
56+ cd txamqp
57+ sudo python setup.py install
58+
59+Simple example
60+
61+To see this example work you will need to open two terminal windows. In the
62+first window type the following:
63+
64+ cd examples/pub-con
65+ python \
66+ txamqp_consumer.py \
67+ ../../specs/standard/amqp0-8.xml
68+
69+In the second window type:
70+
71+ cd examples/pub-con
72+ python \
73+ txamqp_publisher.py \
74+ ../../specs/standard/amqp0-8.xml \
75+ "message to send to consumer"
76+
77+You should see the message appear in the terminal window running the consumer.
78
79=== added file 'examples/pub-con/txamqp_consumer.py'
80--- examples/pub-con/txamqp_consumer.py 1970-01-01 00:00:00 +0000
81+++ examples/pub-con/txamqp_consumer.py 2009-06-09 22:04:43 +0000
82@@ -0,0 +1,56 @@
83+from twisted.internet.defer import inlineCallbacks
84+from twisted.internet import reactor
85+from twisted.internet.protocol import ClientCreator
86+from txamqp.protocol import AMQClient
87+from txamqp.client import TwistedDelegate
88+import txamqp.spec
89+
90+@inlineCallbacks
91+def gotConnection(conn, authentication):
92+ yield conn.start(authentication)
93+
94+ chan = yield conn.channel(1)
95+ yield chan.channel_open()
96+
97+ yield chan.queue_declare(queue="po_box", durable=True, exclusive=False, auto_delete=False)
98+ yield chan.exchange_declare(exchange="sorting_room", type="direct", durable=True, auto_delete=False)
99+
100+ yield chan.queue_bind(queue="po_box", exchange="sorting_room", routing_key="jason")
101+
102+ yield chan.basic_consume(queue='po_box', no_ack=True, consumer_tag="testtag")
103+
104+ def recv_callback(msg, chan, queue):
105+ print 'Received: ' + msg.content.body + ' from channel #' + str(chan.id)
106+ return (queue.get().addCallback(recv_callback, chan, queue))
107+
108+ queue = yield conn.queue("testtag")
109+ yield (queue.get().addCallback(recv_callback, chan, queue))
110+
111+ yield chan.basic_cancel("testtag")
112+
113+ yield chan.channel_close()
114+
115+ chan0 = yield conn.channel(0)
116+
117+ yield chan0.connection_close()
118+
119+ reactor.stop()
120+
121+
122+if __name__ == "__main__":
123+ import sys
124+ if len(sys.argv) != 2:
125+ print "%s path_to_spec" % sys.argv[0]
126+ sys.exit(1)
127+
128+ spec = txamqp.spec.load(sys.argv[1])
129+
130+ authentication = {"LOGIN": "guest", "PASSWORD": "guest"}
131+
132+ delegate = TwistedDelegate()
133+ d = ClientCreator(reactor, AMQClient, delegate=delegate, vhost="/",
134+ spec=spec).connectTCP("localhost", 5672)
135+
136+ d.addCallback(gotConnection, authentication)
137+
138+ reactor.run()
139
140=== added file 'examples/pub-con/txamqp_publisher.py'
141--- examples/pub-con/txamqp_publisher.py 1970-01-01 00:00:00 +0000
142+++ examples/pub-con/txamqp_publisher.py 2009-06-09 22:04:43 +0000
143@@ -0,0 +1,43 @@
144+from twisted.internet.defer import inlineCallbacks
145+from twisted.internet import reactor
146+from twisted.internet.protocol import ClientCreator
147+from txamqp.protocol import AMQClient
148+from txamqp.client import TwistedDelegate
149+from txamqp.content import Content
150+import txamqp.spec
151+
152+@inlineCallbacks
153+def gotConnection(conn, authentication, body):
154+ yield conn.start(authentication)
155+
156+ chan = yield conn.channel(1)
157+ yield chan.channel_open()
158+
159+ msg = Content(body)
160+ msg["delivery mode"] = 2
161+ chan.basic_publish(exchange="sorting_room", content=msg, routing_key="jason")
162+
163+ yield chan.channel_close()
164+
165+ chan0 = yield conn.channel(0)
166+ yield chan0.connection_close()
167+
168+ reactor.stop()
169+
170+if __name__ == "__main__":
171+ import sys
172+ if len(sys.argv) != 3:
173+ print "%s path_to_spec content" % sys.argv[0]
174+ sys.exit(1)
175+
176+ spec = txamqp.spec.load(sys.argv[1])
177+
178+ authentication = {"LOGIN": "guest", "PASSWORD": "guest"}
179+
180+ delegate = TwistedDelegate()
181+ d = ClientCreator(reactor, AMQClient, delegate=delegate, vhost="/",
182+ spec=spec).connectTCP("localhost", 5672)
183+
184+ d.addCallback(gotConnection, authentication, sys.argv[2])
185+
186+ reactor.run()
187
188=== added directory 'examples/thrift'
189=== renamed file 'src/examples/README' => 'examples/thrift/README'
190=== renamed file 'src/examples/client.py' => 'examples/thrift/client.py'
191=== renamed file 'src/examples/server.py' => 'examples/thrift/server.py'
192=== renamed file 'src/examples/shared.thrift' => 'examples/thrift/shared.thrift'
193=== renamed file 'src/examples/tutorial.thrift' => 'examples/thrift/tutorial.thrift'
194=== modified file 'setup.py'
195--- setup.py 2009-05-22 15:29:06 +0000
196+++ setup.py 2009-06-09 22:18:42 +0000
197@@ -1,16 +1,21 @@
198 from distutils.core import setup
199 from glob import glob
200
201+
202 setup(
203 name = 'txAMQP',
204 version = '0.2',
205 author = 'Esteve Fernandez',
206 author_email = 'esteve@fluidinfo.com',
207- packages = ['txamqp', 'txamqp.contrib', 'txamqp.contrib.thrift'],
208+ packages = [
209+ 'txamqp',
210+ 'txamqp.contrib',
211+ 'txamqp.contrib.thrift',
212+ ],
213 package_dir = {
214- 'txamqp': 'src/txamqp',
215- 'txamqp.contrib': 'src/txamqp/contrib',
216- 'txamqp.contrib.thrift': 'src/txamqp/contrib/thrift',
217+ 'txamqp': 'txamqp',
218+ 'txamqp.contrib': 'txamqp/contrib',
219+ 'txamqp.contrib.thrift': 'txamqp/contrib/thrift',
220 },
221 url = 'https://launchpad.net/txamqp',
222 )
223
224=== renamed directory 'src/specs' => 'specs'
225=== removed directory 'src'
226=== renamed directory 'src/txamqp' => 'txamqp'

Subscribers

People subscribed via source and target branches

to status/vote changes: