end ?
This commit is contained in:
parent
ef0de22c54
commit
59d43d3572
BIN
client/download/homerRasta.jpg
Normal file
BIN
client/download/homerRasta.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 135 KiB |
BIN
client/download/wallpaper targaryen_sigil.jpg
Normal file
BIN
client/download/wallpaper targaryen_sigil.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 MiB |
@ -538,9 +538,11 @@ class start(QtGui.QMainWindow):
|
||||
self.s.send("/userlistaway".encode())
|
||||
|
||||
if self.codeNb(txt.split(" ")[0]) == "HAS_ASKED_FILE":
|
||||
self.ShowMessageOK(txt.split(" ")[1]+" share a file with you, do you want download "+' '.join(txt.split(" ")[2].split("/")[-1:])+" ?")
|
||||
self.questionMessage(txt.split(" ")[1],txt.split(" ")[2])
|
||||
self.fileNom = ' '.join(txt.split(" ")[2].split("/")[-1:])
|
||||
nomfichierEn = ' '.join(txt.split(" ")[2:])
|
||||
nomfichier = ' '.join(nomfichierEn.split("/")[-1:])
|
||||
self.ShowMessageOK(txt.split(" ")[1]+" share a file with you, do you want download "+nomfichier+" ?")
|
||||
self.questionMessage(txt.split(" ")[1],nomfichierEn)
|
||||
self.fileNom = nomfichier
|
||||
|
||||
if self.codeNb(txt.split(" ")[0]) == "SUCC_ASKED_FILE":
|
||||
self.ShowMessageOK("Succes asked file")
|
||||
@ -555,7 +557,8 @@ class start(QtGui.QMainWindow):
|
||||
ms = socket(AF_INET, SOCK_STREAM)
|
||||
print(txt.split(" ")[2]+" "+txt.split(" ")[3])
|
||||
ms.connect((str(txt.split(" ")[2]), int(txt.split(" ")[3])))
|
||||
f = open(txt.split(" ")[4], "rb")
|
||||
namefichier = ' '.join(txt.split(" ")[4:])
|
||||
f = open(namefichier, "rb")
|
||||
data = f.read()
|
||||
f.close()
|
||||
ms.send(data)
|
||||
|
@ -181,16 +181,16 @@ def handle_request(connection, data):
|
||||
reject_private_message(connection, array_data[1])
|
||||
return
|
||||
if array_data[0] == "/pm":
|
||||
private_message(connection, array_data[1], " ".join(array_data[2:]))
|
||||
private_message(connection, array_data[1], " ".join(array_data[2:]).strip())
|
||||
return
|
||||
if array_data[0] == "/pmfile":
|
||||
ask_file(connection, array_data[1], " ".join(array_data[2:]))
|
||||
ask_file(connection, array_data[1], " ".join(array_data[2:]).strip())
|
||||
return
|
||||
if array_data[0] == "/acceptfile":
|
||||
accept_file(connection, array_data[1], " ".join(array_data[3:]), array_data[2])
|
||||
accept_file(connection, array_data[1], " ".join(array_data[3:]).strip(), array_data[2])
|
||||
return
|
||||
if array_data[0] == "/rejectfile":
|
||||
reject_file(connection, array_data[1], " ".join(array_data[2:]))
|
||||
reject_file(connection, array_data[1], " ".join(array_data[2:]).strip())
|
||||
return
|
||||
connection.sendall("{}".format(COMMAND_NOT_FOUND).encode())
|
||||
else:
|
||||
@ -310,7 +310,7 @@ def ask_private_message(connection, pseudo):
|
||||
ERR_ALREADY_ASKED_FOR_PM), Log.lvl.INFO)
|
||||
else:
|
||||
askPM.append(pm)
|
||||
log.printL("askPm {}".format(askPM), Log.lvl.DEBUG)
|
||||
#log.printL("askPm {}".format(askPM), Log.lvl.DEBUG)
|
||||
c.sendall("{} {}".format(ASKING_FOR_PM, usersConnected[connection][1]).encode())
|
||||
log.printL("Send to {} : {} {}".format(usersConnected[c][0], ASKING_FOR_PM,
|
||||
usersConnected[connection][1]), Log.lvl.INFO)
|
||||
|
Reference in New Issue
Block a user