Skip to content

Commit 7c4c4b5

Browse files
authored
Merge pull request biolab#3932 from ales-erjavec/fixes/clear-widgets-settings-dir
[FIX] main: Fix widget settings directory path to clear
2 parents 793a35a + 2d26147 commit 7c4c4b5

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

Orange/canvas/config.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Orange Canvas Configuration
33
44
"""
5+
import warnings
6+
57
import os
68
import sys
79
import itertools
@@ -15,7 +17,7 @@
1517
from AnyQt.QtGui import QPainter, QFont, QFontMetrics, QColor, QPixmap, QIcon
1618
from AnyQt.QtCore import Qt, QPoint, QRect
1719

18-
from orangewidget.workflow import widgetsscheme, discovery, config
20+
from orangewidget.workflow import config
1921

2022
import Orange
2123

@@ -30,7 +32,7 @@ class Config(config.Config):
3032
Orange application configuration
3133
"""
3234
OrganizationDomain = "biolab.si"
33-
ApplicationName = "Orange Canvas"
35+
ApplicationName = "Orange"
3436
ApplicationVersion = Orange.__version__
3537

3638
@staticmethod
@@ -132,9 +134,6 @@ def examples_entry_points():
132134
pkg_resources.iter_entry_points("orange.widgets.tutorials")
133135
)
134136

135-
widget_discovery = discovery.WidgetDiscovery
136-
workflow_constructor = widgetsscheme.WidgetsScheme
137-
138137
APPLICATION_URLS = {
139138
#: Submit a bug report action in the Help menu
140139
"Bug Report": "https://github.com/biolab/orange3/issues",
@@ -159,10 +158,9 @@ def init():
159158

160159
def data_dir():
161160
"""
162-
Return the application data directory. If the directory path
161+
Return the Orange application data directory. If the directory path
163162
does not yet exists then create it.
164163
"""
165-
166164
from Orange.misc import environ
167165
path = os.path.join(environ.data_dir(), "canvas")
168166
try:
@@ -173,9 +171,9 @@ def data_dir():
173171

174172

175173
def cache_dir():
176-
"""Return the application cache directory. If the directory path
174+
"""
175+
Return the Orange application cache directory. If the directory path
177176
does not yet exists then create it.
178-
179177
"""
180178
from Orange.misc import environ
181179
path = os.path.join(environ.cache_dir(), "canvas")
@@ -206,9 +204,15 @@ def log_dir():
206204
def widget_settings_dir():
207205
"""
208206
Return the widget settings directory.
207+
208+
.. deprecated:: 3.23
209209
"""
210-
from Orange.misc import environ
211-
return environ.widget_settings_dir()
210+
warnings.warn(
211+
f"'{__name__}.widget_settings_dir' is deprecated.",
212+
DeprecationWarning, stacklevel=2
213+
)
214+
import orangewidget.settings
215+
return orangewidget.settings.widget_settings_dir()
212216

213217

214218
def widgets_entry_points():

Orange/misc/environ.py

Lines changed: 8 additions & 9 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

@@ -63,9 +57,14 @@ def widget_settings_dir(versioned=True):
6357
"""
6458
Return the platform dependent directory where widgets save their settings.
6559
66-
This a subdirectory of ``data_dir(versioned)`` named "widgets"
60+
.. deprecated:: 3.23
6761
"""
68-
return os.path.join(data_dir(versioned=versioned), "widgets")
62+
warnings.warn(
63+
f"'{__name__}.widget_settings_dir' is deprecated.",
64+
DeprecationWarning, stacklevel=2
65+
)
66+
import orangewidget.settings
67+
return orangewidget.settings.widget_settings_dir(versioned)
6968

7069

7170
def cache_dir(*args):

0 commit comments

Comments
 (0)