server: indent stuff
authorAdriana Draghici <adriana008@gmail.com>
Fri, 19 Mar 2010 12:58:21 +0000 (12:58 +0000)
committerAdriana Draghici <adriana008@gmail.com>
Fri, 19 Mar 2010 12:58:21 +0000 (12:58 +0000)
bt_comm/server/Server.py

index 52aab51..4da3f7a 100644 (file)
@@ -21,6 +21,7 @@ WAITING_STATUS_DATA = 5
 DEBUG = True
 
 
+
 def recv_pickled_data(clientsock):
     #  while chunk:            
     #          chunk = clientsock.recv(BUFFER_SIZE)
@@ -144,25 +145,27 @@ def doServer(ip, port):
         # recv_pickled_data(clientsock)
         clientsock.close()
 
+
 class MyDaemon(Daemon):
-       def run(self, ip, port):
-               doServer(ip, port)      
+    def run(self, ip, port):
+        doServer(ip, port)     
        
 if __name__ == "__main__":
+
        if len(sys.argv) == 4:
         daemon = MyDaemon('/tmp/daemon-example.pid', sys.argv[2], int(sys.argv[3]))
-               if 'start' == sys.argv[1]:
-                       daemon.start()
-               elif 'stop' == sys.argv[1]:
-                       daemon.stop()
-               elif 'restart' == sys.argv[1]:
-                       daemon.restart()
-               else:
-                       print "Unknown command"
-                       sys.exit(2)
-               sys.exit(0)
-       else:
-               print "usage: %s start|stop|restart <host_ip> <port>" % sys.argv[0]
-               sys.exit(2)
+        if 'start' == sys.argv[1]:
+            daemon.start()
+        elif 'stop' == sys.argv[1]:
+            daemon.stop()
+        elif 'restart' == sys.argv[1]:
+            daemon.restart()
+        else:
+            print "Unknown command"
+            sys.exit(2)
+        sys.exit(0)
+    else:
+        print "usage: %s start|stop|restart <host_ip> <port>" % sys.argv[0]
+        sys.exit(2)