Package proton :: Class Url

[frames] | no frames]

# Class Url

source code

    object --+
             |
            Url

Simple URL parser/constructor, handles URLs of the form:

<scheme>://<user>:<password>@<host>:<port>/<path>

All components can be None if not specifeid in the URL string.

The port can be specified as a service name, e.g. 'amqp' in the URL string but Url.port always gives the integer value.

Nested Classes
| PartDescriptor
| Port An integer port number that can be constructed from a service name string

Instance Methods

__del__(self) | source code

__eq__(self, x) | source code

__init__(self, url=None, defaults=True, **kwargs) x.__init__(...) initializes x; see help(type(x)) for signature | source code

__ne__(self, x) | source code

__repr__(self) repr(x) | source code

__str__(self) str(x) | source code

defaults(self) Fill in missing values (scheme, host or port) with defaults | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Class Variables
| AMQP = ``'``amqp``'``
| AMQPS = ``'``amqps``'``
| path = `<proton.PartDescriptor object>`
| username = `<proton.PartDescriptor object>`

Instance Variables
| host = `<proton.PartDescriptor object>` Host name, ipv6 literal or ipv4 dotted quad.
| host_port Returns host:port
| password = `<proton.PartDescriptor object>` Password
| port Integer port.
| scheme = `<proton.PartDescriptor object>` Url scheme e.g.
| user Username

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, url=None, defaults=True, **kwargs)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  - `url` - URL string to parse.
  - `defaults` - If true, fill in missing default values in the URL. If false, you can fill them in later by calling self.defaults()
  - `kwargs` - scheme, user, password, host, port, path. If specified, replaces corresponding part in url string.
Overrides: object.__init__

### __repr__(self)
(Representation operator)

source code

repr(x)

Overrides: object.__repr__
  (inherited documentation)

### __str__(self)
(Informal representation operator)

source code

str(x)

Overrides: object.__str__
  (inherited documentation)

### defaults(self)

source code

Fill in missing values (scheme, host or port) with defaults

Returns:
  self

Instance Variable Details

### port

Integer port.

Get Method:
  _get_port(self)
Set Method:
  _set_port(self, value)

### scheme

Url scheme e.g. 'amqp' or 'amqps'

Value:

      <proton.PartDescriptor object>