-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages.py
59 lines (46 loc) · 1.66 KB
/
messages.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- coding: utf-8 -*-
from __future__ import print_function
def show(msg) :
print(msg)
def create_account(connection) :
apresentation = "Digite"
def show_new_client(host, port) :
print("Novo cliente conectado")
print(">>> IP:", host)
print(">>> PORT:", port)
def action_not_found() :
print("A acao escolhida nao existe")
def create_successfull(connection=None) :
msg = "A conta foi criada com sucesso!\n"
if connection :
connection.send(msg)
else :
print(msg)
def create_not_successfull(connection, err) :
msg = "A conta não foi criada devido ao erro abaixo\n"
err = ">>> " + err + "\n"
msg = msg + err
connection.send(msg)
def sending_file() :
print("Enviando arquivo...")
def end_sending_file() :
print("Arquivo enviado com sucesso!")
def receiving_file() :
print("Recebendo arquivo...")
def end_receiving_file() :
print("Arquivo recebido com sucesso!")
def invalid_opt() :
print("\nWARNING: Your option was invalid, please choose a possible option.\n")
def begin_registration(key, socket) :
host, port = socket.getpeername()
print("---------------NEW REGISTRATION---------------")
print("FROM: %s:%s" % (host, port))
print("The server will start the registration: %s request" % (key))
print("---------------NEW REGISTRATION---------------\n\n")
def end_registration(key, socket, content) :
host, port = socket.getpeername()
print("--------------END REGISTRATION----------------")
print("FROM: %s:%s" % (host, port))
print("REGISTRATION TYPE: %s" % key)
print("RESULT: \"%s\"" % content)
print("--------------END REGISTRATION----------------\n\n")