During the 0-10 conversion, the Python examples have evolved in a direction that doesn't match the way they are used in the tutorial. This patch simplifies the examples.
In addition to overall simplification, it does the following:
- Eliminates use of random numbers for session names, using uuid4 instead
- Separates initialization for the tutorial text from initialization needed for our test environment.
- Set parameters for login
- If an alternate host or port has been specified, use that instead
- (this is used in our unit tests)
- If AMQP_SPEC is defined, use it to locate the spec file instead of
- looking for it in the default location.
if len(sys.argv) > 1 :
if len(sys.argv) > 2 :
amqp_spec = os.environ["AMQP_SPEC"]