diff --git a/sylvilagus/python/sylvilagus/chapter02/__init__.py b/sylvilagus/python/sylvilagus/ch02/__init__.py similarity index 100% rename from sylvilagus/python/sylvilagus/chapter02/__init__.py rename to sylvilagus/python/sylvilagus/ch02/__init__.py diff --git a/sylvilagus/python/sylvilagus/chapter02/hello_world.py b/sylvilagus/python/sylvilagus/ch02/hello_world.py similarity index 85% rename from sylvilagus/python/sylvilagus/chapter02/hello_world.py rename to sylvilagus/python/sylvilagus/ch02/hello_world.py index d5edff1..a389d3e 100644 --- a/sylvilagus/python/sylvilagus/chapter02/hello_world.py +++ b/sylvilagus/python/sylvilagus/ch02/hello_world.py @@ -1,9 +1,10 @@ +import os + import pika def get_conn_params(): - credentials = pika.PlainCredentials('guest', 'guest') - return pika.ConnectionParameters('localhost', credentials=credentials) + return pika.URLParameters(os.environ['SYLVILAGUS_AMQP_URI']) def get_nonblocking_channel(declare_exchange=True): diff --git a/sylvilagus/python/sylvilagus/chapter02/hello_world_consumer.py b/sylvilagus/python/sylvilagus/ch02/hello_world_consumer.py similarity index 94% rename from sylvilagus/python/sylvilagus/chapter02/hello_world_consumer.py rename to sylvilagus/python/sylvilagus/ch02/hello_world_consumer.py index e1802e4..edf817f 100644 --- a/sylvilagus/python/sylvilagus/chapter02/hello_world_consumer.py +++ b/sylvilagus/python/sylvilagus/ch02/hello_world_consumer.py @@ -4,7 +4,7 @@ import sys import pika -from sylvilagus.chapter02 import hello_world +from sylvilagus.ch02 import hello_world def msg_consumer(channel, method, header, body): diff --git a/sylvilagus/python/sylvilagus/chapter02/hello_world_producer.py b/sylvilagus/python/sylvilagus/ch02/hello_world_producer.py similarity index 92% rename from sylvilagus/python/sylvilagus/chapter02/hello_world_producer.py rename to sylvilagus/python/sylvilagus/ch02/hello_world_producer.py index 96e78a5..04142af 100644 --- a/sylvilagus/python/sylvilagus/chapter02/hello_world_producer.py +++ b/sylvilagus/python/sylvilagus/ch02/hello_world_producer.py @@ -4,7 +4,7 @@ import sys import pika -from sylvilagus.chapter02 import hello_world +from sylvilagus.ch02 import hello_world def main(args=sys.argv[:]): diff --git a/sylvilagus/python/sylvilagus/chapter02/hello_world_producer_with_confirms.py b/sylvilagus/python/sylvilagus/ch02/hello_world_producer_with_confirms.py similarity index 93% rename from sylvilagus/python/sylvilagus/chapter02/hello_world_producer_with_confirms.py rename to sylvilagus/python/sylvilagus/ch02/hello_world_producer_with_confirms.py index 30c91ab..579e2a6 100644 --- a/sylvilagus/python/sylvilagus/chapter02/hello_world_producer_with_confirms.py +++ b/sylvilagus/python/sylvilagus/ch02/hello_world_producer_with_confirms.py @@ -5,7 +5,7 @@ import sys import pika -from sylvilagus.chapter02 import hello_world +from sylvilagus.ch02 import hello_world def main(sysargs=sys.argv[:]):