from xmlrpclib  import *
from SimpleXMLRPCServer import *
from time import *
from math import *

def upcoming_show():
	global i
	i = i + 1
	#show='http://localhost/t1.ogg'
	show='http://localhost/ogg/test.ogg'
	timestamp= floor(time())+60
	if i == 20:
		show='http://localhost/ogg/play20.ogg'
		timestamp = floor(time())
	if i == 30:
		timestamp = floor(time())
		show='http://localhost/ogg/play30.ogg'
	#if i== 40:
	#	i=0
	return (timestamp,show)


i=0
server = SimpleXMLRPCServer(("localhost", 8070))
server.register_function(upcoming_show)
server.register_introspection_functions()
server.serve_forever()

