Skip to content

Commit db28d5b

Browse files
committed
Fix group name handling in "Open from directory" feature to avoid unexpected group name creation
Fix #177
1 parent c1579ab commit db28d5b

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ See DataLab [roadmap page](https://datalab-platform.com/en/contributing/roadmap.
66

77
🛠️ Bug fixes:
88

9+
* Fixed [Issue #177](https://github.com/DataLab-Platform/DataLab/issues/177) - "Open from directory" feature: unexpected group name (a group named "." is created instead of the root folder name)
910
* Fixed [Issue #169](https://github.com/DataLab-Platform/DataLab/issues/169) - Signal / Fourier analysis: magnitude spectrum feature does not work as expected with logarithmic scale enabled
1011
* Fixed [Issue #168](https://github.com/DataLab-Platform/DataLab/issues/168) - Average profile visualization: empty profile is displayed when the target rectangular area is outside the image area (this has been fixed upstream, in PlotPy v2.7.4, and so requires the latest version of PlotPy)
1112

cdl/core/gui/panel/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,10 @@ def load_from_directory(self, directory: str | None = None) -> list[TypeObj]:
936936
)
937937
if new_objs:
938938
objs += new_objs
939-
grp = self.add_group(osp.relpath(path, directory))
939+
grp_name = osp.relpath(path, directory)
940+
if grp_name == ".":
941+
grp_name = osp.basename(path)
942+
grp = self.add_group(grp_name)
940943
for obj in new_objs:
941944
self.add_object(obj, group_id=grp.uuid, set_current=False)
942945
return objs

doc/locale/fr/LC_MESSAGES/contributing/changelog.po

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: DataLab \n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2025-04-19 14:24+0200\n"
10+
"POT-Creation-Date: 2025-04-25 19:20+0200\n"
1111
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language: fr\n"
@@ -16,7 +16,7 @@ msgstr ""
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=utf-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
19-
"Generated-By: Babel 2.14.0\n"
19+
"Generated-By: Babel 2.17.0\n"
2020

2121
msgid "Changelog"
2222
msgstr "Historique des modifications"
@@ -30,6 +30,9 @@ msgstr "DataLab Version 0.19.2"
3030
msgid "🛠️ Bug fixes:"
3131
msgstr "🛠️ Corrections de bugs :"
3232

33+
msgid "Fixed [Issue #177](https://github.com/DataLab-Platform/DataLab/issues/177) - \"Open from directory\" feature: unexpected group name (a group named \".\" is created instead of the root folder name)"
34+
msgstr "Correction de l'[Issue #177](https://github.com/DataLab-Platform/DataLab/issues/177) - Fonctionnalité \"Ouvrir depuis le répertoire\" : nom de groupe inattendu (un groupe nommé \".\" est créé au lieu du nom du dossier racine)"
35+
3336
msgid "Fixed [Issue #169](https://github.com/DataLab-Platform/DataLab/issues/169) - Signal / Fourier analysis: magnitude spectrum feature does not work as expected with logarithmic scale enabled"
3437
msgstr "Correction de l'[Issue #169](https://github.com/DataLab-Platform/DataLab/issues/169) - Analyse de signal / Fourier : la fonction de spectre de magnitude ne fonctionne pas comme prévu avec l'échelle logarithmique activée"
3538

0 commit comments

Comments
 (0)