# HG changeset patch # User gyorgyf # Date 1373383847 -3600 # Node ID fe04ff3547c7fd2d6c6a87f1311e3028dc5ee8fb # Parent cb57e554ae805ab289139c2dfa138ae100c956f3 added more sophisticated testing diff -r cb57e554ae80 -r fe04ff3547c7 mcserver/mcserver.py --- a/mcserver/mcserver.py Tue Jul 09 16:20:08 2013 +0100 +++ b/mcserver/mcserver.py Tue Jul 09 16:30:47 2013 +0100 @@ -67,8 +67,14 @@ # return str() @cp.expose + def test(self): + print "Server test function accessed." + cp.log.error("Server test function accessed.") + return "Server: Test passed." + + @cp.expose def mood(self,x,y): - print "Received coordinates", x,y, "\n" + print "Received coordinates", x,y i = Input(x,y,self.age,self.dist) if i in self.inputs : self.inputs[self.inputs.index(i)].inc() @@ -114,7 +120,7 @@ result = w.stdout.readlines() exitcode = w.wait() if not result : - print "getProcessPid:: Unable to obtain process pid. (lsof returned nothing. exitcode: %s)" %str(exitcode) + print "getProcessPid:: Unable to obtain process pid. (lsof returned nothing. exitcode: %s) This is fine in most cases..." %str(exitcode) return False import pprint pprint.pprint(result) @@ -172,6 +178,7 @@ ip = cp.server.socket_host print "Trying to bind: %(ip)s:%(port)s" %locals() getProcessPids(port,kill=True) + print "Starting..." cp.quickstart() if __name__ == "__main__": diff -r cb57e554ae80 -r fe04ff3547c7 visualclient/visclient.py --- a/visualclient/visclient.py Tue Jul 09 16:20:08 2013 +0100 +++ b/visualclient/visclient.py Tue Jul 09 16:30:47 2013 +0100 @@ -540,11 +540,12 @@ try: print "Testing connection." - self.conn.putrequest("GET","/moodconductor/index.html", skip_host=True) + # self.conn.putrequest("GET","/moodconductor/index.html", skip_host=True) + self.conn.putrequest("GET","/moodconductor/test", skip_host=True) self.conn.putheader("Host", "www.isophonics.net") self.conn.endheaders() res = self.conn.getresponse() - res.read() + print res.read() if res.status == 200 : self.indicators["conn"].on() else :