Package proton :: Module _url :: 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 specified 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.

Warning: The placement of user and password in URLs is not recommended. It can result in credentials leaking out in program logs. Use connection configuration attributes instead.

Nested Classes
  Port
An integer port number that can be constructed from a service name string
Instance Methods
 
__init__(self, url=None, defaults=True, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
path(self, p) source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code
 
__eq__(self, x) source code
 
__ne__(self, 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
  AMQPS = "amqps"
  AMQP = "amqp"
Instance Variables
 
port(self, p)
Integer port.
source code
  host
Host name, ipv6 literal or ipv4 dotted quad.
  host_port
Returns host:port
  password
Password
  scheme
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__

path(self, p)

source code 
Decorators:
  • @path.setter

__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

Instance Variable Details

port(self, p)

source code 
Integer port.
Decorators:
  • @port.setter

scheme

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