-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathListFilesRequest.py
31 lines (26 loc) · 919 Bytes
/
ListFilesRequest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding:utf-8 -*-
from Requests import Requests
import network
class ListFilesRequest(Requests) :
def __init__(self, key, message_type, status) :
Requests.__init__(self, key, message_type)
self.status = status
def run(self, socket) :
self.content = {}
self.content["username"] = self.status["cur_username"]
self.content["password"] = self.status["cur_password"]
msg = self.prepare_message(socket)
network.send(socket, msg)
self.response(socket)
def response(self, socket) :
body = Requests.response(self, socket)
if body["status"] == "1025" :
print("Your uploaded files:")
print("FILE NAME ---------- SIZE")
print(body["content"]["uploads"])
print("\nYour shared files:")
print("FILE NAME ---------- SIZE")
print(body["content"]["shared"])
else :
print(body["status"] + " - Request failed")
print(body)