From 91a242dff1550d38095d2721705f58436aa44162 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 14 Nov 2024 18:30:23 -0500 Subject: [PATCH] Change naming for json data functions --- gramps/gen/db/generic.py | 6 +++--- gramps/gen/db/upgrade.py | 4 ++-- gramps/plugins/db/dbapi/dbapi.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index d44dff643a..5afa3d6354 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -623,13 +623,13 @@ def _initialize(self, directory, username, password): """ raise NotImplementedError - def upgrade_table_for_json_access(self, table_name): + def upgrade_table_for_json_data(self, table_name): """ Overload this method to add JSON access """ raise NotImplementedError - def supports_json_access(self): + def use_json_data(self): """ Overload this method to check if the database stores objects in JSON format """ @@ -688,7 +688,7 @@ def load( self._create_schema() need_to_set_version = True - if self.supports_json_access(): + if self.use_json_data(): self.set_serializer("json") else: self.set_serializer("blob") diff --git a/gramps/gen/db/upgrade.py b/gramps/gen/db/upgrade.py index f226d853d3..2c8d2738c9 100644 --- a/gramps/gen/db/upgrade.py +++ b/gramps/gen/db/upgrade.py @@ -73,7 +73,7 @@ def gramps_upgrade_21(self): self.set_total(length) # First, do metadata: - self.upgrade_table_for_json_access("metadata") + self.upgrade_table_for_json_data("metadata") keys = self._get_metadata_keys() for key in keys: self.set_serializer("blob") @@ -85,7 +85,7 @@ def gramps_upgrade_21(self): self._txn_begin() for table_name in self._get_table_func(): # For each table, alter the database in an appropriate way: - self.upgrade_table_for_json_access(table_name.lower()) + self.upgrade_table_for_json_data(table_name.lower()) get_obj_from_handle = self._get_table_func(table_name, "handle_func") get_handles = self._get_table_func(table_name, "handles_func") diff --git a/gramps/plugins/db/dbapi/dbapi.py b/gramps/plugins/db/dbapi/dbapi.py index f15667e057..a2a90394c8 100644 --- a/gramps/plugins/db/dbapi/dbapi.py +++ b/gramps/plugins/db/dbapi/dbapi.py @@ -82,7 +82,7 @@ class DBAPI(DbGeneric): def _initialize(self, directory, username, password): raise NotImplementedError - def supports_json_access(self): + def use_json_data(self): """ A DBAPI level method for testing if the database supports JSON access. @@ -91,7 +91,7 @@ def supports_json_access(self): # if the database has been converted to use JSON data return self.dbapi.column_exists("metadata", "json_data") - def upgrade_table_for_json_access(self, table_name): + def upgrade_table_for_json_data(self, table_name): """ A DBAPI level method for upgrading the given table adding a json_data column.