From affa49242b5c3eb766872b480b1235f4d08fb02e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 13 Sep 2022 12:06:24 +0000 Subject: [PATCH] python: Add new open() interface to easily open a database Signed-off-by: Michael Tremer --- src/python/location/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/python/location/__init__.py b/src/python/location/__init__.py index 9b570c7..f635737 100644 --- a/src/python/location/__init__.py +++ b/src/python/location/__init__.py @@ -22,3 +22,13 @@ from _location import * # Initialise logging from . import logger + +def open(path=None): + """ + Opens the database at path, or opens the default database. + """ + if not path: + path = DATABASE_PATH + + # Open the database + return Database(path) -- 2.39.5