Changed ipauuid.py docstring slightly so epydoc formats it correctly

This commit is contained in:
Jason Gerard DeRose 2009-01-21 13:36:53 -07:00
parent 0c95e86cf3
commit 5d82e3b35a

View File

@ -1,3 +1,5 @@
# This is a backport of the Python2.5 uuid module.
r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
@ -10,36 +12,49 @@ the computer's network address. uuid4() creates a random UUID.
Typical usage:
**Important:** So that the freeIPA Python 2.4 ``uuid`` backport can be
automatically loaded when needed, import the ``uuid`` module like this:
>>> from ipalib import uuid
# make a UUID based on the host ID and current time
Make a UUID based on the host ID and current time:
>>> uuid.uuid1() #doctest: +ELLIPSIS
UUID('...')
# make a UUID using an MD5 hash of a namespace UUID and a name
Make a UUID using an MD5 hash of a namespace UUID and a name:
>>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')
# make a random UUID
Make a random UUID:
>>> uuid.uuid4() #doctest: +ELLIPSIS
UUID('...')
# make a UUID using a SHA-1 hash of a namespace UUID and a name
Make a UUID using a SHA-1 hash of a namespace UUID and a name:
>>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
# make a UUID from a string of hex digits (braces and hyphens ignored)
>>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')
Make a UUID from a string of hex digits (braces and hyphens ignored):
>>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')
>>> x
UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
Convert a UUID to a string of hex digits in standard form:
# convert a UUID to a string of hex digits in standard form
>>> str(x)
'00010203-0405-0607-0809-0a0b0c0d0e0f'
# get the raw 16 bytes of the UUID
Get the raw 16 bytes of the UUID:
>>> x.bytes
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'
# make a UUID from a 16-byte string
Make a UUID from a 16-byte string:
>>> uuid.UUID(bytes=x.bytes)
UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
"""