Changeset 49e3d00fb36203be049e055aa6c0f4283d419c14

Show
Ignore:
Timestamp:
11/28/06 00:55:00 (2 years ago)
Author:
Jason Michalski <armooo@armooo.net>
git-committer:
Jason Michalski <armooo@armooo.net> 1164696900 +0000
git-parent:

[b9245da7891242ec6b47b1f5257e75e14b49f817]

git-author:
Jason Michalski <armooo@armooo.net> 1164696900 +0000
Message:

pyTivo
- Stop the beacon should exit cleanly now

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • beacon.py

    rb9245da r49e3d00  
    3131        self.UDPSock.sendto(self.format_beacon(), ('255.255.255.255', 2190)) 
    3232 
    33     def send_beacon_timer(self): 
     33    def start(self): 
    3434        self.send_beacon() 
    35         t = Timer(60, self.send_beacon_timer) 
    36         t.start() 
     35        self.timer = Timer(60, self.start) 
     36        self.timer.start() 
     37 
     38    def stop(self): 
     39        self.timer.cancel() 
    3740 
    3841if __name__ == '__main__': 
  • pyTivo.py

    rb9245da r49e3d00  
    1515b = beacon.Beacon() 
    1616b.add_service('TiVoMediaServer:' + str(port) + '/http') 
    17 b.send_beacon_timer() 
     17b.start() 
    1818 
    19 httpd.serve_forever() 
     19try: 
     20    httpd.serve_forever() 
     21except KeyboardInterrupt: 
     22    b.stop() 
  • pyTivoService.py

    rb9245da r49e3d00  
    3737        b = beacon.Beacon() 
    3838        b.add_service('TiVoMediaServer:' + str(port) + '/http') 
    39         b.send_beacon_timer() 
     39        b.start() 
    4040         
    4141        while 1: 
     
    4646            rc = win32event.WaitForSingleObject(self.stop_event, 5) 
    4747            if rc == win32event.WAIT_OBJECT_0: 
     48                b.stop() 
    4849                break 
    4950