Package noaadata :: Module tideserver
[hide private]
[frames] | no frames]

Source Code for Module noaadata.tideserver

 1  #!/usr/bin/env python 
 2  __version__ = '$Revision: 2075 $'.split()[1] 
 3  __date__ = '$Date: 2006-05-03 04:18:20 -0400 (Wed, 03 May 2006) $'.split()[1] 
 4  __author__ = 'Kurt Schwehr' 
 5   
 6  __doc__=''' 
 7  Connect to the NOAA SOAP server and rebroadcast the results. 
 8   
 9  @author: U{'''+__author__+'''<http://schwehr.org/>} 
10  @version: ''' + __version__ +''' 
11  @license: GPL v2 
12  @copyright: (C) 2006 Kurt Schwehr 
13  @var __date__: Date of last svn commit 
14  @undocumented: __version__ __author__ __doc__ parser 
15   
16  @bug: FIX: NOT WRITTEN YET.  Doh! 
17   
18  ''' 
19  import sys #, os, shutil 
20  import time 
21  import socket 
22  import thread 
23  import select 
24  #import tty,termios 
25  #import calendar 
26   
27   
28 -class TideDataServer:
29 ''' 30 wheee 31 ''' 32
33 - def __init__(self,options):
34 self.running = True 35 self.options = options
36 37 ###################################################################### 38 if __name__=='__main__': 39 from optparse import OptionParser 40 41 # FIX: is importing __init__ safe? 42 parser = OptionParser(usage="%prog [options]", 43 version="%prog "+__version__+' ('+__date__+')') 44 45 parser.add_option('-i','--in-port',dest='inPort',type='int', default=31401, 46 help='Where the data comes from [default: %default]') 47 parser.add_option('-I','--in-host',dest='inHost',type='string',default='localhost', 48 help='What host to read data from [default: %default]') 49 parser.add_option('--in-gethostname',dest='inHostname', action='store_true', default=False, 50 help='Where the data comes from ['+socket.gethostname()+']') 51 52 53 parser.add_option('-o','--out-port', dest="outPort", type='int',default=31500, 54 help='Where the data will be available to others [default: %default]') 55 parser.add_option('-O','--out-host',dest='outHost',type='string', default='localhost', 56 help='What machine the source port is on [default: %default]') 57 parser.add_option('--out-gethostname',dest='outHostname', action='store_true', default=False, 58 help='Use the default hostname ['+socket.gethostname()+']') 59 parser.add_option('-v','--verbose',dest='verbose',default=False,action='store_true', 60 help='Make the test output verbose') 61