Skip to content

Commit b667d31

Browse files
committed
main: Fix widget settings directory path to clear
Since biolabgh-3772 the `environ.widget_settings_dir` is no longer the authoritative directory path. Change the application name to 'Orange' to preserve historical directory layout (the application name is used as the path component in the settings path).
1 parent 8a01b2a commit b667d31

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

Orange/canvas/config.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Config(config.Config):
3030
Orange application configuration
3131
"""
3232
OrganizationDomain = "biolab.si"
33-
ApplicationName = "Orange Canvas"
33+
ApplicationName = "Orange"
3434
ApplicationVersion = Orange.__version__
3535

3636
@staticmethod
@@ -203,12 +203,11 @@ def log_dir():
203203
return logdir
204204

205205

206-
def widget_settings_dir():
206+
def widget_settings_dir(versioned=True):
207207
"""
208208
Return the widget settings directory.
209209
"""
210-
from Orange.misc import environ
211-
return environ.widget_settings_dir()
210+
return config.widget_settings_dir(versioned)
212211

213212

214213
def widgets_entry_points():

Orange/misc/environ.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@
99
1010
where DATA_HOME is a platform dependent application directory
1111
(:ref:`data_dir_base`) and VERSION is Orange.__version__ string.
12-
13-
``canvas`` subdirectory is reserved for settings/preferences stored
14-
by Orange Canvas
15-
``widget`` subdirectory is reserved for settings/preferences stored
16-
by OWWidget
17-
1812
"""
19-
2013
import os
2114
import sys
15+
import warnings
2216

2317
import Orange
2418

@@ -65,7 +59,13 @@ def widget_settings_dir(versioned=True):
6559
6660
This a subdirectory of ``data_dir(versioned)`` named "widgets"
6761
"""
68-
return os.path.join(data_dir(versioned=versioned), "widgets")
62+
warnings.warn(
63+
f"'{__name__}.widget_settings_dir' is deprecated. "
64+
"Use 'Orange.widgets.settings.widget_settings_dir'",
65+
DeprecationWarning, stacklevel=2
66+
)
67+
from Orange.canvas import config
68+
return config.widget_settings_dir(versioned)
6969

7070

7171
def cache_dir(*args):

0 commit comments

Comments
 (0)