état au 6 février 2022
This commit is contained in:
parent
9365de1dcb
commit
57d21cc96d
41
commands.py
41
commands.py
|
@ -1,4 +1,4 @@
|
|||
|
||||
import pickle
|
||||
|
||||
# Isengard commands
|
||||
|
||||
|
@ -32,6 +32,13 @@ def cmdmainteneur(owners, nick, text, sbuf):
|
|||
host = splittedtext[1]
|
||||
maintainer = splittedtext[2]
|
||||
|
||||
sbuf.buf[host] = {}
|
||||
sbuf.buf[host]["destmuc"] = None
|
||||
sbuf.buf[host]["status_state"] = None
|
||||
sbuf.buf[host]["status_type"] = None
|
||||
sbuf.buf[host]["text"] = None
|
||||
sbuf.buf[host]["raw"] = None
|
||||
sbuf.buf[host]["needUpdate"] = False
|
||||
sbuf.buf[host]["maintainer"] = maintainer
|
||||
|
||||
return "le responsable est à présent " \
|
||||
|
@ -43,9 +50,39 @@ def cmdmainteneur(owners, nick, text, sbuf):
|
|||
|
||||
return "Syntaxe invalide"
|
||||
|
||||
def cmdsave(owners, nick, text, sbuf):
|
||||
"""
|
||||
Save
|
||||
"""
|
||||
|
||||
if not nick in owners:
|
||||
return "désolé mais vous n'êtes pas autorisé à utiliser cette commande."
|
||||
|
||||
try:
|
||||
with open('current_buffer', 'wb') as current_buffer_file:
|
||||
pickle.dump(sbuf.buf, current_buffer_file)
|
||||
return "OK"
|
||||
|
||||
except Exception as e:
|
||||
print(repr(e))
|
||||
return "Erreur à l'exécution"
|
||||
|
||||
def cmdload(owners, nick, text, sbuf):
|
||||
"""
|
||||
Save
|
||||
"""
|
||||
|
||||
if not nick in owners:
|
||||
return "désolé mais vous n'êtes pas autorisé à utiliser cette commande."
|
||||
|
||||
try:
|
||||
with open('current_buffer', 'rb') as current_buffer_file:
|
||||
sbuf.buf = pickle.load(current_buffer_file)
|
||||
return "OK"
|
||||
|
||||
except Exception as e:
|
||||
print(repr(e))
|
||||
return "Erreur à l'exécution"
|
||||
|
||||
|
||||
# Commands
|
||||
|
@ -54,6 +91,8 @@ commandtable = {
|
|||
|
||||
"ping" : cmdping,
|
||||
"mainteneur" : cmdmainteneur,
|
||||
"save" : cmdsave,
|
||||
"load" : cmdload,
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -57,5 +57,9 @@ topictable = {
|
|||
"à vos ordres !", "yop !", "hello", "chalut"],
|
||||
|
||||
"Bonjour" : ["yop, c'est moi ! ;)", "ici la Tour, la seule et unique !",
|
||||
"à vos ordres !", "yop !", "hello"]
|
||||
"à vos ordres !", "yop !", "hello"],
|
||||
|
||||
"Merci" : ["de rien !", "you're welcome :)", "c'est naturel.", "pas de soucis !"],
|
||||
|
||||
"merci" : ["de rien !", "you're welcome :)", "c'est naturel.", "pas de soucis !"]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue