From e784849db6164b9724924186f7c468608f6e3af5 Mon Sep 17 00:00:00 2001 From: Javier Luraschi Date: Wed, 17 Jul 2024 21:56:12 -0700 Subject: [PATCH] detect json file when hidden --- python/hal9/iobind.py | 5 ++++- python/pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python/hal9/iobind.py b/python/hal9/iobind.py index b2467fe2..361859f2 100644 --- a/python/hal9/iobind.py +++ b/python/hal9/iobind.py @@ -14,7 +14,8 @@ def add_extension(path, contents): return Path(path) def find_extension(file_path): - if Path(file_path + '.json').exists(): + json_hidden = get_hidden(Path(file_path + '.json')) + if Path(file_path + '.json').exists() or Path(json_hidden).exists(): return Path(file_path + '.json') return Path(file_path + '.pkl') @@ -44,6 +45,7 @@ def load(name, default): file_path = get_hidden(file_path) extension = get_extension(file_path) + if not extension: extension = "pkl" @@ -58,6 +60,7 @@ def load(name, default): contents = file.read() else: contents = default + return contents def save(name, contents, hidden = False): diff --git a/python/pyproject.toml b/python/pyproject.toml index b678fc92..81dd4f30 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hal9" -version = "2.4.7" +version = "2.4.8" description = "" authors = ["Javier Luraschi "] readme = "README.md"