• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(710)  |  Call(634)  |  Derive(0)  |  Import(76)
Get fully qualified domain name from name.

An empty argument is interpreted as meaning the local host.

First the hostname returned by gethostbyaddr() is checked, then
possibly existing aliases. In case no FQDN is available, hostname
from gethostname() is returned.

        def getfqdn(name=''):
    """Get fully qualified domain name from name.

    An empty argument is interpreted as meaning the local host.

    First the hostname returned by gethostbyaddr() is checked, then
    possibly existing aliases. In case no FQDN is available, hostname
    from gethostname() is returned.
    """
    name = name.strip()
    if not name or name == '0.0.0.0':
        name = gethostname()
    try:
        hostname, aliases, ipaddrs = gethostbyaddr(name)
    except error:
        pass
    else:
        aliases.insert(0, hostname)
        for name in aliases:
            if '.' in name:
                break
        else:
            name = hostname
    return name
        


src/m/o/moofs-HEAD/moofs/src/host/communication/Communicator.py   moofs(Download)
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
from MooConnection import MooConnection
        #        pass
        try:
            self.receiver = socket(AF_INET, SOCK_STREAM)
            self.receiver.bind((getfqdn(), port))
            self.receiver.listen(5)
            self.receiver.settimeout(5)
            TaskQueue().put(ConnectionCreateTask(self))
    def getAddress(self):
        return (getfqdn(), self.port)
 
    # Creates a new connection with the address given.
    # You should not need it, since sendMessage creates
    # connections on demand.
    def connect(self, address):
    def receiveConnection(self):
        try:
            (sock, info) = self.receiver.accept()
            name = gethostbyaddr(info[0])
            name = name[0]
            name = getfqdn(name)
            mooConn = MooConnection(sock)

src/p/r/Products.ECAssignmentBox-1.4.2/Products/ECAssignmentBox/tool/ECABTool.py   Products.ECAssignmentBox(Download)
import urllib
#import interfaces
from string import join, split
from socket import getfqdn, gethostname
from urlparse import urlsplit, urlunsplit
 
from email.MIMEText import MIMEText
            hostname = hostpart
 
        if hostname == 'localhost' or hostname == '127.0.0.1':
            hostname = getfqdn(gethostname())
        else:
            hostname = getfqdn(hostname)
 

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/ftplib.py   ironruby(Download)
# Import SOCKS module if it exists, else standard socket module socket
try:
    import SOCKS; socket = SOCKS; del SOCKS # import SOCKS as socket
    from socket import getfqdn; socket.getfqdn = getfqdn; del getfqdn
except ImportError:
    import socket
from socket import _GLOBAL_DEFAULT_TIMEOUT

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/ftplib.py   ironruby(Download)
# Import SOCKS module if it exists, else standard socket module socket
try:
    import SOCKS; socket = SOCKS; del SOCKS # import SOCKS as socket
    from socket import getfqdn; socket.getfqdn = getfqdn; del getfqdn
except ImportError:
    import socket
from socket import _GLOBAL_DEFAULT_TIMEOUT

src/p/y/pypy3-HEAD/lib-python/3.1.2/ftplib.py   pypy3(Download)
# Import SOCKS module if it exists, else standard socket module socket
try:
    import SOCKS; socket = SOCKS; del SOCKS # import SOCKS as socket
    from socket import getfqdn; socket.getfqdn = getfqdn; del getfqdn
except ImportError:
    import socket
from socket import _GLOBAL_DEFAULT_TIMEOUT

src/p/y/pyvm-HEAD/projects/python_in_a_can/trunk/win32/python-2.7/Lib/ftplib.py   pyvm(Download)
# Import SOCKS module if it exists, else standard socket module socket
try:
    import SOCKS; socket = SOCKS; del SOCKS # import SOCKS as socket
    from socket import getfqdn; socket.getfqdn = getfqdn; del getfqdn
except ImportError:
    import socket
from socket import _GLOBAL_DEFAULT_TIMEOUT

src/s/t/stackless-HEAD/Lib/ftplib.py   stackless(Download)
# Import SOCKS module if it exists, else standard socket module socket
try:
    import SOCKS; socket = SOCKS; del SOCKS # import SOCKS as socket
    from socket import getfqdn; socket.getfqdn = getfqdn; del getfqdn
except ImportError:
    import socket
from socket import _GLOBAL_DEFAULT_TIMEOUT

src/p/y/pywii-HEAD/Python-3.1.2/Lib/ftplib.py   pywii(Download)
# Import SOCKS module if it exists, else standard socket module socket
try:
    import SOCKS; socket = SOCKS; del SOCKS # import SOCKS as socket
    from socket import getfqdn; socket.getfqdn = getfqdn; del getfqdn
except ImportError:
    import socket
from socket import _GLOBAL_DEFAULT_TIMEOUT

src/b/d/bdk-c-HEAD/trunk/workspace/script/python/Lib/ftplib.py   bdk-c(Download)
# Import SOCKS module if it exists, else standard socket module socket
try:
    import SOCKS; socket = SOCKS; del SOCKS # import SOCKS as socket
    from socket import getfqdn; socket.getfqdn = getfqdn; del getfqdn
except ImportError:
    import socket
from socket import _GLOBAL_DEFAULT_TIMEOUT

src/p/y/python2.6-cmake-HEAD/Lib/ftplib.py   python2.6-cmake(Download)
# Import SOCKS module if it exists, else standard socket module socket
try:
    import SOCKS; socket = SOCKS; del SOCKS # import SOCKS as socket
    from socket import getfqdn; socket.getfqdn = getfqdn; del getfqdn
except ImportError:
    import socket
from socket import _GLOBAL_DEFAULT_TIMEOUT

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8  Next