예제 #1
0
파일: display.py 프로젝트: Unilat/bugs
 def connectSocket(self):
     address = "sarcasm.ath.cx"
     port = 54363
     try:
         self.connect = Sockets.ClientConnection(address, port)
         self.connect.openSocket()
     except:
         handleError()
         self.connect.close()
예제 #2
0
 def connectSocket(self):
     address = "sarcasm.ath.cx"
     port = 54363
     try:
         self.connect = Sockets.ClientConnection(address, port)
         self.connect.openSocket()
     except:
         handleError()
         self.connect.close()
예제 #3
0
파일: Client.py 프로젝트: Calpoog/bugs
def sendBugLanguageCode(address, data, port=5000):
    '''
    This would be used to send the compiled code to the server.
    '''
    try:
        connect = Sockets.ClientConnection(address, port)
        connect.openSocket()
    except:
        handleError()
    else:
        connect.send(data)
        callback = connect.recv()
    finally:
        connect.close()
    return callback == data
예제 #4
0
파일: Client.py 프로젝트: Unilat/bugs
def sendBugLanguageCode(address, data, port=5000):
    '''
    This would be used to send the compiled code to the server.
    '''
    try:
        connect = Sockets.ClientConnection(address, port)
        connect.openSocket()
    except:
        handleError()
    else:
        connect.send(data)
        callback = connect.recv()
    finally:
        connect.close()
    return callback == data
예제 #5
0
def recieveBugLanguageCode(port=54363):
    '''
    Theorectically this could be called by program to get code from clients.
    Possibly more filled out 
    '''
    data = None
    try:
        connect = Sockets.ServerConnection(port)
        connect.openSocket()
        connect.listen()
        connect.acceptConnection()
        data = connect.recv()
    except:
        handleError()
    finally:
        connect.close()
    return data
예제 #6
0
파일: Server.py 프로젝트: Unilat/bugs
def recieveBugLanguageCode(port=54363):
    '''
    Theorectically this could be called by program to get code from clients.
    Possibly more filled out 
    '''
    data = None
    try:
        connect = Sockets.ServerConnection(port)
        connect.openSocket()
        connect.listen()
        connect.acceptConnection()
        data = connect.recv()
    except:
        handleError()
    finally:
        connect.close()
    return data
예제 #7
0
파일: Server.py 프로젝트: Unilat/bugs
def sendDisplays(port=54363):
    data = None
    try:
        connect = Sockets.ServerConnection(port)
        connect.openSocket()
        connect.listen()
        connect.acceptConnection()
        grids = [[23,43,21,30,],[43,0,0,0,],[62,0,0,0],
        [0,52,0,43,22,21,0, 0, 0,0, 0, 0, 0,63,0, 0,0, 0, 41, 22,0,0, 0,0, 0, 0, 0,50, 0, 0,0, 0, 0, 0,0,0, 0,0,21, 0, 0,0,0, 62,0, 0, 0,40,0,],
        [0,0,0,23,23,21,0,52, 0,0, 0, 0, 0,63,0, 0,0, 0, 41, 42,0,0, 0,0, 0, 0, 0,50, 0, 0,0, 0, 0, 0,0,0, 0,0,22, 0, 0,0,0, 60,0, 0, 0,40,0,],
        [0,0,0,43,23,21,0,51, 0,0, 0, 0, 0,63,0, 0,0, 0, 42, 42,0,0, 0,0, 0, 0, 0,50, 0, 0,0, 0, 0, 0,0,0, 0,0,22, 0, 0,0,0, 63,0, 0, 0,40,0,],
        [0,0,0,43,23,21,0, 0,51,0, 0, 0, 0,63,0, 0,0, 0, 41, 43,0,0, 0,0, 0, 0, 0,50, 0, 0,0, 0, 0, 0,0,0, 0,0,21, 0, 0,0,0, 61,0, 0, 0,40,0,],]
        for data in grids:
            connect.send(data)
            connect.recv()
    except:
        handleError()
    finally:
        print "Close"
        connect.close()
예제 #8
0
def sendDisplays(port=54363):
    data = None
    try:
        connect = Sockets.ServerConnection(port)
        connect.openSocket()
        connect.listen()
        connect.acceptConnection()
        grids = [
            [
                23,
                43,
                21,
                30,
            ],
            [
                43,
                0,
                0,
                0,
            ],
            [62, 0, 0, 0],
            [
                0,
                52,
                0,
                43,
                22,
                21,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                63,
                0,
                0,
                0,
                0,
                41,
                22,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                50,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                21,
                0,
                0,
                0,
                0,
                62,
                0,
                0,
                0,
                40,
                0,
            ],
            [
                0,
                0,
                0,
                23,
                23,
                21,
                0,
                52,
                0,
                0,
                0,
                0,
                0,
                63,
                0,
                0,
                0,
                0,
                41,
                42,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                50,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                22,
                0,
                0,
                0,
                0,
                60,
                0,
                0,
                0,
                40,
                0,
            ],
            [
                0,
                0,
                0,
                43,
                23,
                21,
                0,
                51,
                0,
                0,
                0,
                0,
                0,
                63,
                0,
                0,
                0,
                0,
                42,
                42,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                50,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                22,
                0,
                0,
                0,
                0,
                63,
                0,
                0,
                0,
                40,
                0,
            ],
            [
                0,
                0,
                0,
                43,
                23,
                21,
                0,
                0,
                51,
                0,
                0,
                0,
                0,
                63,
                0,
                0,
                0,
                0,
                41,
                43,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                50,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                21,
                0,
                0,
                0,
                0,
                61,
                0,
                0,
                0,
                40,
                0,
            ],
        ]
        for data in grids:
            connect.send(data)
            connect.recv()
    except:
        handleError()
    finally:
        print "Close"
        connect.close()