def notify_clients(self, client, repo, revision):
		command = E.packet(E.command("new_version"), E.repo("%s" % (repo)), E.readable("New revision is %s" % (revision)))
		message = etree.tostring(command, pretty_print=False)
		
		if repo in self.repolist:
			for registration in self.repolist[repo]:
				if registration != client:
					# no point informing the client that told us...
					registration.send(message)
def watch(repo):
	s = connect()
	command = E.packet(E.command("register"), E.repo(repo))
	message = etree.tostring(command, pretty_print=False)
	s.send(message)
	
	running = True
	while running:
		rdy_read, rdy_write, rdy_err = select.select([s], [], [s], 0)
		data = s.recv(4096)
		if not data:
			running = False # server died on us..
		print "Received: %s" % (data)
	
	s.close()
def notify(repo, rev):
	s = connect()
	command = E.packet(E.command("new_version"), E.repo(repo), E.readable("New revision is %s" % (rev)))
	message = etree.tostring(command, pretty_print=False)
	s.send(message)
	s.close()