diff options
| author | Andreas Schneider <asn@cryptomilk.org> | 2013-07-02 17:49:30 +0200 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2013-07-02 17:49:30 +0200 |
| commit | 5fd8133a218441631ed1d6eb13755645ac8fb796 (patch) | |
| tree | dbd77da3e3e4e9e0b9b65ccfe04efdd7db75c687 /src/socket.py | |
| parent | c731e1fa213c323a8e824fc57b4d1fc0c019928f (diff) | |
| download | socket_wrapper-5fd8133a218441631ed1d6eb13755645ac8fb796.tar.gz socket_wrapper-5fd8133a218441631ed1d6eb13755645ac8fb796.tar.xz socket_wrapper-5fd8133a218441631ed1d6eb13755645ac8fb796.zip | |
src: Remove unused and obsolete files.
Diffstat (limited to 'src/socket.py')
| -rw-r--r-- | src/socket.py | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/socket.py b/src/socket.py deleted file mode 100644 index ccbb820..0000000 --- a/src/socket.py +++ /dev/null @@ -1,50 +0,0 @@ -# Wrapper for socket wrapper (based on python socket wrapper) -# Copyright (C) Amitay Isaacs 2011 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# - -import _socket -from _socket import * - -from samba.socket_wrapper import socket - - -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 - - -_GLOBAL_DEFAULT_TIMEOUT = object() |
