~justin-fathomdb/nova/justinsb-openstack-api-volumes

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/core/examples/shoutcast.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (c) 2009 Twisted Matrix Laboratories.
 
2
# See LICENSE for details.
 
3
 
 
4
"""
 
5
Example Shoutcast client. Run with:
 
6
 
 
7
python shoutcast.py localhost 8080
 
8
"""
 
9
 
 
10
import sys
 
11
 
 
12
from twisted.internet import protocol, reactor
 
13
from twisted.protocols.shoutcast import ShoutcastClient
 
14
 
 
15
class Test(ShoutcastClient):
 
16
    def gotMetaData(self, data):
 
17
        print "meta:", data
 
18
 
 
19
    def gotMP3Data(self, data):
 
20
        pass
 
21
 
 
22
host = sys.argv[1]
 
23
port = int(sys.argv[2])
 
24
 
 
25
protocol.ClientCreator(reactor, Test).connectTCP(host, port)
 
26
reactor.run()
 
 
b'\\ No newline at end of file'