home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import socket
-
- try:
- import msvcrt
- except ImportError:
- msvcrt = None
- print 'problem'
-
- port = 8081
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- s.bind(('', port))
- s.settimeout(0.05)
- print 'Starting logserver on port:', port
- print 'Press q to quit logserver', port
- singleline = False
-
- def check_key():
- if msvcrt is None:
- return False
- if msvcrt.kbhit() != 0:
- q = msvcrt.getch()
- return q in 'q'
- return False
-
- while None:
-
- try:
- (data, addr) = s.recvfrom(1024)
- except socket.timeout:
- if check_key():
- print 'Quitting logserver'
- break
-
- except:
- check_key()
-
- if data.startswith('@@'):
- continue
-
- if singleline:
- print '\r', ' ' * 78, '\r', data,
- continue
- print data
- continue
- return None
-