Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

amq_manager.py 655B

123456789101112131415161718
  1. from __future__ import absolute_import
  2. def get_manager(client, hostname=None, port=None, userid=None,
  3. password=None):
  4. import pyrabbit
  5. opt = client.transport_options.get
  6. def get(name, val, default):
  7. return (val if val is not None
  8. else opt('manager_%s' % name) or
  9. getattr(client, name, None) or default)
  10. host = get('hostname', hostname, 'localhost')
  11. port = port if port is not None else opt('manager_port', 15672)
  12. userid = get('userid', userid, 'guest')
  13. password = get('password', password, 'guest')
  14. return pyrabbit.Client('%s:%s' % (host, port), userid, password)