refs #1164 ogRaiseError function call correction

pull/1/head
Antonio Guerrero 2024-11-20 23:33:39 -06:00
parent bb0805e237
commit 038d432264
1 changed files with 25 additions and 5 deletions

View File

@ -271,12 +271,20 @@ def ogDeleteTree(*args):
# Comprobar que existe el directorio y borrarlo con su contenido.
DIR = ogGetPath(*args)
if not DIR:
SystemLib.ogRaiseError(OG_ERR_NOTFOUND, *args)
SystemLib.ogRaiseError(
"session",
ogGlobals.OG_ERR_NOTFOUND,
f"Not found: {args}"
)
return
try:
shutil.rmtree(DIR)
except OSError as e:
SystemLib.ogRaiseError(OG_ERR_NOTFOUND, *args)
SystemLib.ogRaiseError(
"session",
ogGlobals.OG_ERR_NOTFOUND,
f"{e}"
)
return
@ -401,10 +409,18 @@ def ogIsNewerFile(*args):
# Comprobar que existen los ficheros origen y destino.
if not SOURCE:
SystemLib.ogRaiseError(OG_ERR_NOTFOUND, *args[:-1])
SystemLib.ogRaiseError(
"session",
ogGlobals.OG_ERR_NOTFOUND,
f"Not found: {args[:-1]}"
)
return
if not TARGET:
SystemLib.ogRaiseError(OG_ERR_NOTFOUND, *args)
SystemLib.ogRaiseError(
"session",
ogGlobals.OG_ERR_NOTFOUND,
f"Not found: {args[-1]}"
)
return
# Devolver si el primer fichero se ha modificado después que el segundo.
@ -420,7 +436,11 @@ def ogMakeChecksumFile(*args):
# Comprobar que existe el fichero y guardar su checksum.
FILE = ogGetPath(*args)
if not FILE:
SystemLib.ogRaiseError(OG_ERR_NOTFOUND, *args)
SystemLib.ogRaiseError(
"session",
ogGlobals.OG_ERR_NOTFOUND,
f"Not found: {args}"
)
return
checksum = ogCalculateChecksum(FILE)
with open(f"{FILE}.sum", "w") as f: