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
def v1endpoint(self, port):
"""Return an OpenID 1.1 OpenIDServiceEndpoint for the server."""
base = "http://%s:%s" % (socket.getfqdn('127.0.0.1'), port)
ep = OpenIDServiceEndpoint()
ep.claimed_id = base + "/id/bob"
ep.server_url = base + "/openidserver"
ep.type_uris = [OPENID_1_1_TYPE]
src/p/o/polinax-HEAD/libs/external_libs/python-openid-2.1.1/openid/test/test_examples.py polinax(Download)
def v1endpoint(self, port):
"""Return an OpenID 1.1 OpenIDServiceEndpoint for the server."""
base = "http://%s:%s" % (socket.getfqdn('127.0.0.1'), port)
ep = OpenIDServiceEndpoint()
ep.claimed_id = base + "/id/bob"
ep.server_url = base + "/openidserver"
ep.type_uris = [OPENID_1_1_TYPE]
src/y/o/yos-social-python-HEAD/test/unit/openid/test_examples.py yos-social-python(Download)
def v1endpoint(self, port):
"""Return an OpenID 1.1 OpenIDServiceEndpoint for the server."""
base = "http://%s:%s" % (socket.getfqdn('127.0.0.1'), port)
ep = OpenIDServiceEndpoint()
ep.claimed_id = base + "/id/bob"
ep.server_url = base + "/openidserver"
ep.type_uris = [OPENID_1_1_TYPE]
src/p/y/python-openid-HEAD/openid/test/test_examples.py python-openid(Download)
def v1endpoint(self, port):
"""Return an OpenID 1.1 OpenIDServiceEndpoint for the server."""
base = "http://%s:%s" % (socket.getfqdn('127.0.0.1'), port)
ep = OpenIDServiceEndpoint()
ep.claimed_id = base + "/id/bob"
ep.server_url = base + "/openidserver"
ep.type_uris = [OPENID_1_1_TYPE]
src/a/s/askbot-0.6.14/askbot/deps/openid/test/test_examples.py askbot(Download)
def v1endpoint(self, port):
"""Return an OpenID 1.1 OpenIDServiceEndpoint for the server."""
base = "http://%s:%s" % (socket.getfqdn('127.0.0.1'), port)
ep = OpenIDServiceEndpoint()
ep.claimed_id = base + "/id/bob"
ep.server_url = base + "/openidserver"
ep.type_uris = [OPENID_1_1_TYPE]
src/p/y/python-openid-2.2.5/openid/test/test_examples.py python-openid(Download)
def v1endpoint(self, port):
"""Return an OpenID 1.1 OpenIDServiceEndpoint for the server."""
base = "http://%s:%s" % (socket.getfqdn('127.0.0.1'), port)
ep = OpenIDServiceEndpoint()
ep.claimed_id = base + "/id/bob"
ep.server_url = base + "/openidserver"
ep.type_uris = [OPENID_1_1_TYPE]
src/p/y/python-big-HEAD/examples/pping.py python-big(Download)
#!/usr/bin/env python import sys, getopt, time, socket from nws.sleigh import sshcmd, rshcmd from nws.sleigh import Sleigh defaultNodeList = [socket.getfqdn()] * 3
src/p/y/python-big-HEAD/examples/worker.py python-big(Download)
def worker(*s, **kw):
ws = nws.client.NetWorkSpace(*s, useUse=True)
id = SleighRank
ws.store("foo_%d" % id, socket.getfqdn())
time.sleep(1)
return (id, socket.getfqdn()) + s
src/n/w/nwsclient-1.6.3/examples/pping.py nwsclient(Download)
#!/usr/bin/env python import sys, getopt, time, socket from nws.sleigh import sshcmd, rshcmd from nws.sleigh import Sleigh defaultNodeList = [socket.getfqdn()] * 3
src/p/y/pymacadmin-HEAD/examples/crankd/socks-proxy/ProxyManager.py pymacadmin(Download)
# We want to enable the server when our hostname is not on the corporate network:
# BUG: This does not handle multi-homed systems well:
current_address = socket.gethostbyname(socket.getfqdn())
new_state = not current_address.startswith('10.0.1.')
logging.info(
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next