diff options
| -rw-r--r-- | snekbox/api/resources/eval.py | 2 | ||||
| -rw-r--r-- | snekbox/memfs.py | 10 | 
2 files changed, 6 insertions, 6 deletions
diff --git a/snekbox/api/resources/eval.py b/snekbox/api/resources/eval.py index 38a5625..cedeb2e 100644 --- a/snekbox/api/resources/eval.py +++ b/snekbox/api/resources/eval.py @@ -117,5 +117,5 @@ class EvalResource:          resp.media = {              "stdout": result.stdout,              "returncode": result.returncode, -            "files": [f.json for f in result.files], +            "files": [f.as_dict for f in result.files],          } diff --git a/snekbox/memfs.py b/snekbox/memfs.py index fcb4a32..6a3a635 100644 --- a/snekbox/memfs.py +++ b/snekbox/memfs.py @@ -21,7 +21,7 @@ def parse_files(      fs: MemFS,      files_limit: int,      files_pattern: str, -    preload_json: bool = False, +    preload_dict: bool = False,  ) -> list[FileAttachment]:      """      Parse files in a MemFS. @@ -30,15 +30,15 @@ def parse_files(          fs: The MemFS to parse.          files_limit: The maximum number of files to parse.          files_pattern: The glob pattern to match files against. -        preload_json: Whether to preload and cache JSON data. +        preload_dict: Whether to preload as_dict property data.      Returns:          List of FileAttachments sorted lexically by path name.      """ -    res = sorted(fs.attachments(files_limit, files_pattern), key=lambda file: file.path) -    if preload_json: +    res = sorted(fs.attachments(files_limit, files_pattern), key=lambda f: f.path) +    if preload_dict:          for file in res: -            _ = file.json +            _ = file.as_dict      return res  |