-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactualizar_mensajes.py
More file actions
62 lines (48 loc) · 1.61 KB
/
actualizar_mensajes.py
File metadata and controls
62 lines (48 loc) · 1.61 KB
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
60
61
62
# coding=utf-8
import json
with open("pilocuras.json") as f:
pilocuras = json.load(f)
with open("newMessages.json") as f:
new_messages = json.load(f)
new_pilocuras = []
new_new_messages = []
print "Empezemos por los mensajes en revisión, que son menos"
for mensaje in new_messages:
if mensaje["tipo"] == "normal":
print "El mensaje es:\n0:%s" % mensaje["text"]
else:
print "El mensaje es:\n1:%s\n2:%s" % (mensaje["text0"], mensaje["text1"])
while True:
i = raw_input("¿es repetible? (s/n)")
if i == "s":
mensaje["repetible"] = True
new_new_messages.append(mensaje)
break
elif i == "n":
mensaje["repetible"] = False
new_new_messages.append(mensaje)
break
else:
print "¿qué mierda ha sido eso?"
print "Ahora vamos a los mensajes en juego"
for mensaje in pilocuras:
if mensaje["tipo"] == "normal":
print "El mensaje es:\n0:%s" % mensaje["text"]
else:
print "El mensaje es:\n1:%s\n2:%s" % (mensaje["text0"], mensaje["text1"])
while True:
i = raw_input("¿es repetible? (s/n)")
if i == "s":
mensaje["repetible"] = True
new_pilocuras.append(mensaje)
break
elif i == "n":
mensaje["repetible"] = False
new_pilocuras.append(mensaje)
break
else:
print "¿qué mierda ha sido eso?"
with open("pilocuras.json", "w") as f:
json.dump(new_pilocuras, f, indent=2)
with open("newMessages.json", "w") as f:
json.dump(new_new_messages, f, indent=2)