from mxUID import * from mxUID import __version__ ### Python part of module initialization # Set IDs import os,string try: import socket except ImportError: # Use the data from the root stat as host id _hostid = reduce(lambda x,y: (x+y) % 65536, os.stat('/')) else: ip = socket.gethostbyname(socket.gethostname()) ip = map(int, string.split(ip, '.')) _hostid = reduce(lambda x,y: (x+y) % 65536, ip) del ip, socket setids(_hostid, os.getpid(), 0xbeef) del os,string