gmyth-stream/server/main.py
branchtrunk
changeset 497 08a2d7d67ae5
parent 484 27e83a8f68d7
child 498 7a0c3906dce2
     1.1 --- a/gmyth-stream/server/main.py	Tue Apr 03 16:42:04 2007 +0100
     1.2 +++ b/gmyth-stream/server/main.py	Wed Apr 04 17:08:11 2007 +0100
     1.3 @@ -21,7 +21,7 @@
     1.4  
     1.5  lib.log("Starting GMyth-Stream server")
     1.6  
     1.7 -while (server.finish == 0):
     1.8 +while (server.finish is 0):
     1.9      con, client = server.getRequest()
    1.10  
    1.11      while True:
    1.12 @@ -31,17 +31,17 @@
    1.13  
    1.14          lib.log("Received %s from: %s" % (msg, client) )
    1.15  
    1.16 -        if (msg == "SETUP"):
    1.17 +        if msg is "SETUP":
    1.18              setup = server.getMsg(1024).strip().split(" ")
    1.19              size = len(setup)
    1.20              options = []
    1.21  
    1.22 -            if ( size < 10 ):
    1.23 +            if size < 10:
    1.24                  server.sendMsg(lib.log("Wrong SETUP command from: %s" % client[0]))
    1.25  
    1.26              else:
    1.27  
    1.28 -                if ( size > 10 ):
    1.29 +                if size > 10:
    1.30                      i = 10
    1.31                      while (i < size):
    1.32                          options.append(setup[i])
    1.33 @@ -52,21 +52,21 @@
    1.34                                    setup[6], setup[7], setup[8],
    1.35                                    setup[9], options)
    1.36  
    1.37 -                if (ret == 0):
    1.38 +                if ret is 0:
    1.39                      server.Ack("SETUP")
    1.40                  else:
    1.41                      server.sendMsg(lib.log(ret))
    1.42  
    1.43  
    1.44 -        elif (msg == "PLAY"):
    1.45 +        elif msg is "PLAY":
    1.46              media.play()
    1.47              server.Ack("PLAY")
    1.48  
    1.49 -        elif (msg == "STOP"):
    1.50 +        elif msg is "STOP":
    1.51              media.stop()
    1.52              server.Ack("STOP")
    1.53  
    1.54 -        elif (msg == "CLOSE"):
    1.55 +        elif msg is "CLOSE":
    1.56              server.finish = 1
    1.57              media.stop()
    1.58              server.Ack("CLOSE")