Module 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.

@ivar scheme: Url scheme e.g. 'amqp' or 'amqps'
@ivar user: Username
@ivar password: Password
@ivar host: Host name, ipv6 literal or ipv4 dotted quad.
@ivar port: Integer port.
@ivar host_port: Returns host:port

Nested Classes
  Port
An integer port number that can be constructed from a service name string
  PartDescriptor
Instance Methods
 
__init__(self, url=None, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code
 
__del__(self) 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
  AMQPS = "amqps"
  AMQP = "amqp"
  scheme = PartDescriptor('scheme')
  username = PartDescriptor('username')
  password = PartDescriptor('password')
  host = PartDescriptor('host')
  path = PartDescriptor('path')
  port = property(_get_port, _set_port)
Properties

Inherited from object: __class__

Method Details

__init__(self, url=None, **kwargs)
(Constructor)

source code 

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

Parameters:
  • url - URL string to parse.
  • kwargs - scheme, user, password, host, port, path. If specified, replaces corresponding part in url string.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

defaults(self)

source code 

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

Returns:
self