From d9f6ed1c6e93f58de474eb0d1326e223ea8e55ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=BF=83=E7=A6=BE?= Date: Thu, 16 Jul 2020 12:58:32 +0800 Subject: [PATCH] Update document of callbacks --- dockerjudge/__init__.py | 14 +++++++------- docs/__init__.rst | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/dockerjudge/__init__.py b/dockerjudge/__init__.py index 7f73b5e..bdbb38e 100644 --- a/dockerjudge/__init__.py +++ b/dockerjudge/__init__.py @@ -66,13 +66,13 @@ def judge(processor, source, tests, config=None, Tese case - === ================================== ===================== - Key Value type Description - === ================================== ===================== - `0` :class:`dockerjudge.status.Status` Status code - `1` `tuple` `stdout` and `stderr` - `2` `float` Time used - === ================================== ===================== + === =================================== ===================== + Key Value type Description + === =================================== ===================== + `0` :class:`~dockerjudge.status.Status` Status code + `1` `tuple` `stdout` and `stderr` + `2` `float` Time used + === =================================== ===================== """ config = config or {} container = client.containers.run( diff --git a/docs/__init__.rst b/docs/__init__.rst index 8c97419..fa79369 100644 --- a/docs/__init__.rst +++ b/docs/__init__.rst @@ -1,6 +1,35 @@ +========================= :mod:`dockerjudge` - Main ========================= .. automodule:: dockerjudge +Judge +===== + .. autofunction:: dockerjudge.judge + +Callback +======== + +Compile +------- + +========= ================= ================================================= +Parameter Type Description +========= ================= ================================================= +`0` `int` Return value of the compiler +`1` `byte` or `tuple` Output of compiler, value type depends on `demux` +========= ================= ================================================= + +Judge +----- + +========= =================================== =============================== +Parameter Type Description +========= =================================== =============================== +`0` `int` Test case id, starting from `0` +`1` :class:`~dockerjudge.status.Status` Status +`2` `tuple` Output `(stdout, stderr)` +`3` `float` Time used +========= =================================== ===============================