From 836afb7b3fed7cb0d1ccc04cd613b8f9624f45d2 Mon Sep 17 00:00:00 2001 From: Pierre Date: Tue, 16 Apr 2024 19:42:03 +0200 Subject: [PATCH] git subrepo pull uno subrepo: subdir: "uno" merged: "422ff83" upstream: origin: "https://github.com/prrvchr/uno.git" branch: "main" commit: "422ff83" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" --- uno/.gitrepo | 4 ++-- uno/lib/uno/embedded/documenthandler.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/uno/.gitrepo b/uno/.gitrepo index f97a4905..9b16dab8 100644 --- a/uno/.gitrepo +++ b/uno/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/prrvchr/uno.git branch = main - commit = 0322c8b67a80923af08794d2df4241011e021577 - parent = e89721142aa70e6e0566d7158aa1814d6ea876e5 + commit = 422ff83478fdfab3785a998566fa5465f13dfadc + parent = 91cb8ccbddc1962bf37b645793722bb351ec8400 method = merge cmdver = 0.4.3 diff --git a/uno/lib/uno/embedded/documenthandler.py b/uno/lib/uno/embedded/documenthandler.py index e910be7b..5574c01f 100644 --- a/uno/lib/uno/embedded/documenthandler.py +++ b/uno/lib/uno/embedded/documenthandler.py @@ -68,6 +68,7 @@ def __init__(self, ctx, lock, logger, url, index): self._lock = lock self._logger = logger self._listening = False + self._created = False self._path, self._folder = self._getDataBaseInfo(url) self._url = url self._index = index @@ -130,9 +131,11 @@ def setListener(self, document): document.addCloseListener(self) def removeFolder(self): - sf = getSimpleFile(self._ctx) - if sf.isFolder(self._path): - sf.kill(self._path) + # XXX: The database folder will be deleted only if it was created + if self._created: + sf = getSimpleFile(self._ctx) + if sf.isFolder(self._path): + sf.kill(self._path) # DocumentHandler getter methods def getConnectionUrl(self, storage): @@ -140,6 +143,8 @@ def getConnectionUrl(self, storage): exist = storage.hasElements() sf = getSimpleFile(self._ctx) if not sf.exists(self._path): + # XXX: The database folder will be deleted only if it was created + self._created = True sf.createFolder(self._path) if exist: count = self._extractStorage(sf, storage, self._path)