All Samples(321) | Call(302) | Derive(0) | Import(19)
gethostbyaddr(host) -> (name, aliaslist, addresslist) Return the true host name, a list of aliases, and a list of IP addresses, for a host. The host argument is a string giving a host name or IP number.
src/m/o/moofs-HEAD/moofs/src/host/communication/Communicator.py moofs(Download)
from socket import socket from socket import AF_INET from socket import SOCK_STREAM from socket import gethostbyaddr from socket import getfqdn from threading import RLock from TaskQueue import TaskQueue
def receiveConnection(self):
try:
(sock, info) = self.receiver.accept()
name = gethostbyaddr(info[0])
name = name[0]
name = getfqdn(name)
mooConn = MooConnection(sock)
src/g/i/gitserve-0.2.0/src/gitserve/__init__.py gitserve(Download)
from pkg_resources import resource_filename
from CGIHTTPServer import CGIHTTPRequestHandler
from socket import error as SocketError
from socket import gethostname, gethostbyaddr
def become_daemon(home='.', out_log='/dev/null', err_log='/dev/null'):
"Robustly turn into a UNIX daemon, running in our_home_dir."
elif not options.address:
options.address = gethostname()
else:
options.address = gethostbyaddr(options.address)[0]
except SocketError, e:
parser.error(e)
gitweb_url = "http://%s:%d/%s/" % (options.address, options.port, repo_name)
src/h/a/hachoir-parser-1.3.4/hachoir_parser/network/common.py hachoir-parser(Download)
from hachoir_core.field import FieldSet, Field, Bits from hachoir_core.bits import str2hex from hachoir_parser.network.ouid import REGISTERED_OUID from hachoir_core.endian import BIG_ENDIAN from socket import gethostbyaddr, herror as socket_host_error def ip2name(addr):
# FIXME: Workaround Python bug
# Need double try/except to catch the bug
try:
name = gethostbyaddr(addr)[0]
except KeyboardInterrupt:
raise
except (socket_host_error, ValueError):
src/n/s/nst-HEAD/releases/nst-2.13.0-1713/yum/pkgs/nstipgeolocate/src/ipgeolocate/__init__.py nst(Download)
import os import sys from optparse import OptionParser from socket import gethostbyname, gethostbyaddr from cgi import escape from datetime import datetime import time
def resolveHostName(self, addrIPv4):
""" Returns a Host Name for the given IPv4 address, otherwise returns the IPv4 Address """
try:
_hostName = gethostbyaddr(addrIPv4)
except:
_results = addrIPv4
else:
src/n/s/nst-HEAD/releases/2.13.0-1729/yum/pkgs/nstipgeolocate/src/ipgeolocate/__init__.py nst(Download)
import os import sys from optparse import OptionParser from socket import gethostbyname, gethostbyaddr from cgi import escape from datetime import datetime import time
def resolveHostName(self, addrIPv4):
""" Returns a Host Name for the given IPv4 address, otherwise returns the IPv4 Address """
try:
_hostName = gethostbyaddr(addrIPv4)
except:
_results = addrIPv4
else:
src/z/o/Zope2-2.12.12/src/Zope2/Startup/__init__.py Zope2(Download)
import sys import socket from re import compile from socket import gethostbyaddr import ZConfig from ZConfig.components.logger import loghandler
identify it by its ip (and not the host name).
'''
if isIp_(host): return [host]
return gethostbyaddr(host)[2]
src/z/o/Zope2-2.12.12/src/Zope2/Startup/handlers.py Zope2(Download)
import os import sys import time import logging from re import compile from socket import gethostbyaddr
"""
if isIp_(host):
return [host]
return gethostbyaddr(host)[2]
src/n/s/nst-HEAD/trunk/yum/pkgs/nstipgeolocate/src/ipgeolocate/__init__.py nst(Download)
import os import sys from optparse import OptionParser from socket import gethostbyname, gethostbyaddr from cgi import escape from datetime import datetime import time
def resolveHostName(self, addrIPv4):
""" Returns a Host Name for the given IPv4 address, otherwise returns the IPv4 Address """
try:
_hostName = gethostbyaddr(addrIPv4)
except:
_results = addrIPv4
else:
src/p/y/pyblosxom-HEAD/trunk/pyblosxom/plugins/comments/plugins/comments.py pyblosxom(Download)
from email.Utils import formatdate
except ImportError:
from rfc822 import formatdate
from socket import gethostbyaddr
author = escape_SMTP_commands(clean_author(comment['author']))
description = escape_smtp_commands(comment['description'])
if 'link' in comment:
message.append("URL: %s" % comment['link'])
try:
host_name = gethostbyaddr(ipaddress)[0]
message.append("Hostname: %s (%s)" % (host_name, ipaddress))
# FIXME - bare except here--bad!
except:
src/p/y/pyblosxom-HEAD/trunk/contrib/plugins/comments/plugins/comments.py pyblosxom(Download)
from email.Utils import formatdate
except ImportError:
from rfc822 import formatdate
from socket import gethostbyaddr
author = escape_SMTP_commands(clean_author(comment['author']))
description = escape_SMTP_commands(comment['description'])
if 'link' in comment:
message.append("URL: %s" % comment['link'])
try:
host_name = gethostbyaddr(ipaddress)[0]
message.append("Hostname: %s (%s)" % (host_name, ipaddress))
except:
message.append("IP: %s" % ipaddress)
1 | 2 Next