Package gnue :: Package common :: Package utils :: Module uuid
[show private | hide private]

Module gnue.common.utils.uuid

This module implements an UUID generator as described in the internet draft at 'http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-05.txt' or also described in the RPC-RFC.
Classes
Generator This class implements an UUID generator described in the internet draft at 'http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-05.txt' or also described in the RPC-RFC.

Exceptions
InvalidNamespaceError 'namespace' is not recognized as valid namespace argument.
InvalidVersionError The version '<version>' is not a valid UUID version.
MissingNamespaceError No namespace given for SHA1-/MD5-based UUIDs.

Function Summary
list of tuples get_hardware_addresses()
Retrieve a list of all available network interfaces and their hardware addresses.

Variable Summary
int MD5 = 3                                                                     
int RANDOM = 4                                                                     
int SHA1 = 5                                                                     
int TIME = 1                                                                     
Generator UUID = <gnue.common.utils.uuid.Generator instance at 0xb...

Function Details

get_hardware_addresses()

Retrieve a list of all available network interfaces and their hardware addresses. After creating an instance of this class the attribute nics is a sequence of tuples (name, hwaddr, hwstr) where name is the name of the interface, hwaddr is a list of integers and hwstr is the string representation of the hardware-address.

On systems identifying as 'linux2' the proc-filesystem will be searched for interface information first. If that fails (or isn't available) we try to get a list of interfaces via sockets.

On OS X the NetworkInterfaces.plist will be examined.

On win32 systems the Windows Management Instrumentation will be queried.

If no interface could be detected at all, an interface will be generated using the random number source. It will have the name 'generated'.
Returns:
list of tuples (ifname, hwaddr, hwstr) as described above
           (type=list of tuples)

Variable Details

MD5

Type:
int
Value:
3                                                                     

RANDOM

Type:
int
Value:
4                                                                     

SHA1

Type:
int
Value:
5                                                                     

TIME

Type:
int
Value:
1                                                                     

UUID

Type:
Generator
Value:
<gnue.common.utils.uuid.Generator instance at 0xb768174c>              


GNUe Home

Public API

Developer's Corner