Changeset 269

Show
Ignore:
Timestamp:
07/20/05 20:18:03 (3 years ago)
Author:
athomas
Message:
  • Some internal reorg
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pycrash/trunk/crash/network.py

    r268 r269  
     1import socket 
     2 
    13class Network: 
    24    """ Represents a network and netmask. Automatically detects input format 
     
    125127    def __init__(self, network): 
    126128        Network.__init__(network, 32) 
     129 
     130def name2ip(name): 
     131    try: 
     132        return socket.gethostbyname(name) 
     133    except socket.gaierror: 
     134        return None 
     135 
  • pycrash/trunk/crash/util.py

    r268 r269  
    847847        if rc != os.EX_OK: return (rc, process.fromchild.readlines()) 
    848848        return (rc, process.fromchild.readlines()) 
    849  
    850849except ImportError: 
    851850    def execute(command): 
     
    863862    """ Replace all instances of old in seq with new """ 
    864863    return [x == old and new or old for x in seq] 
    865  
    866 def name2ip(name): 
    867     try: 
    868         return socket.gethostbyname(name) 
    869     except socket.gaierror: 
    870         return None 
    871