Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-1044

Python examples need updating for tutorial

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • M4
    • None
    • Python Examples, Website
    • None

    Description

      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.
      1. Set parameters for login

      host="127.0.0.1"
      port=5672
      user="guest"
      password="guest"
      amqp_spec="/usr/share/amqp/amqp.0-10.xml"

      1. If an alternate host or port has been specified, use that instead
      2. (this is used in our unit tests)
        #
      3. If AMQP_SPEC is defined, use it to locate the spec file instead of
      4. looking for it in the default location.

      if len(sys.argv) > 1 :
      sys.argv[1]
      if len(sys.argv) > 2 :
      int(sys.argv[2])

      try:
      amqp_spec = os.environ["AMQP_SPEC"]
      except KeyError:
      amqp_spec="/usr/share/amqp/amqp.0-10.xml"

      Attachments

        1. cpp-examples.diff
          54 kB
          Jonathan Robie
        2. python-examples.diff
          70 kB
          Jonathan Robie

        Activity

          People

            Unassigned Unassigned
            jonathan.robie Jonathan Robie
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: