Giacomo Terragni, Eric Banzuzi, Rosamelia Carioni, Chiara Paglioni, Elena Perego
Python 3 with these packages:
- requests
- flask
- cryptography
Make sure your terminal is at the same location as app.py.
Initialize a server by typing:
flask run
You should be able to see the following in your terminal:
Open a new terminal in the same location as client.py and start the program by typing:
python client.py
The following window will open up:
Upload the .json file that you want to read by pressing the Open File button. Make sure the file is in the following format:
{"id": "100",
"password": "eleele",
"server":
{
"ip": "127.0.0.1",
"port": "5000"
},
"actions": {
"delay": "4",
"steps": [
"INCREASE 2000",
"DECREASE 100",
"DECREASE 100",
"DECREASE 100",
"DECREASE 100"
]
}
}
If everything went well, you should see this in the terminal where the client was read:
The errors for each action are handled separately. If the client has an invalid value for the amount of INCREASE or DECREASE inside the actions, the user will see the errors in the terminal as output. For example, for this client:
You should see the following output:
All outputs from the actions executed on the clients counter are stored in a log file in app/logs/logs.txt. If you wish to store the data in a different file, change the value of variable FILENAME in app.py to the new file's name.
The file information is in the following format:
ID: 100 | NEW LOG IN | COUNTER: 0
ID: 100 | INCREASE 10 | COUNTER: 10
ID: 100 | DECREASE 1 | COUNTER: 9