20
20
import lzma
21
21
import bz2
22
22
import zipfile
23
-
24
- from Orange .widgets .settings import PerfectDomainContextHandler
25
- from Orange .widgets .utils .itemdelegates import TableDataDelegate
26
23
from itertools import chain
27
24
28
25
from xml .sax .saxutils import escape
39
36
Qt , QFileInfo , QTimer , QSettings , QObject , QSize , QMimeDatabase , QMimeType
40
37
)
41
38
from AnyQt .QtGui import (
42
- QStandardItem , QStandardItemModel , QPalette , QColor , QIcon , QTextOption
39
+ QStandardItem , QStandardItemModel , QPalette , QColor , QIcon ,
43
40
)
44
41
from AnyQt .QtWidgets import (
45
- QLabel , QComboBox , QPushButton , QDialog , QDialogButtonBox , QGridLayout ,
42
+ QLabel , QComboBox , QPushButton , QDialog , QDialogButtonBox ,
46
43
QVBoxLayout , QSizePolicy , QFileIconProvider , QFileDialog ,
47
44
QApplication , QMessageBox , QTextBrowser ,
48
45
QStyle , QMenu , QHBoxLayout , QTableView , QHeaderView
55
52
56
53
from pandas .api import types as pdtypes
57
54
55
+ from orangewidget .settings import Setting , SettingProvider , widget_settings_dir
56
+
58
57
import Orange .data
59
58
from Orange .data import Table , ContinuousVariable , StringVariable
60
59
from Orange .misc .collections import natural_sorted
61
60
62
- from Orange .widgets import widget , gui , settings
61
+ from Orange .widgets import widget , gui
63
62
from Orange .widgets .data .owtable import DataTableView , RichTableModel , is_sortable , TableSliceProxy
63
+ from Orange .widgets .settings import PerfectDomainContextHandler
64
+ from Orange .widgets .utils .settings import (
65
+ QSettings_readArray , QSettings_writeArray
66
+ )
64
67
from Orange .widgets .utils .concurrent import PyOwned
65
68
from Orange .widgets .utils import (
66
69
textimport , concurrent as qconcurrent , unique_everseen , enum_get , qname
71
74
PathItem , VarPath , AbsPath , samepath , prettyfypath , isprefixed ,
72
75
)
73
76
from Orange .widgets .utils .overlay import OverlayWidget
74
- from Orange .widgets .utils .settings import (
75
- QSettings_readArray , QSettings_writeArray
76
- )
77
- from orangewidget .settings import Setting , ContextSetting , SettingProvider
77
+ from Orange .widgets .utils .itemdelegates import TableDataDelegate
78
78
79
79
if typing .TYPE_CHECKING :
80
80
# pylint: disable=invalid-name
@@ -658,13 +658,13 @@ class Warning(widget.OWWidget.Warning):
658
658
'the Import Options to avoid this.' )
659
659
660
660
#: Paths and options of files accessed in a 'session'
661
- _session_items = settings . Setting (
661
+ _session_items = Setting (
662
662
[], schema_only = True ) # type: List[Tuple[str, dict]]
663
663
664
- _session_items_v2 = settings . Setting (
664
+ _session_items_v2 = Setting (
665
665
[], schema_only = True ) # type: List[Tuple[Dict[str, str], dict]]
666
666
#: Saved dialog state (last directory and selected filter)
667
- dialog_state = settings . Setting ({
667
+ dialog_state = Setting ({
668
668
"directory" : "" ,
669
669
"filter" : ""
670
670
}) # type: Dict[str, str]
@@ -678,7 +678,7 @@ class Warning(widget.OWWidget.Warning):
678
678
# with older saved workflows, where types not guessed differently, when
679
679
# compatibility_mode=True widget have older guessing behaviour
680
680
settings_version = 3
681
- compatibility_mode = settings . Setting (False , schema_only = True )
681
+ compatibility_mode = Setting (False , schema_only = True )
682
682
683
683
MaxHistorySize = 50
684
684
@@ -968,7 +968,7 @@ def _path_must_be_relative_mb(self, prefix: str) -> QMessageBox:
968
968
return mb
969
969
970
970
@Slot ()
971
- def browse (self , prefixname = None , directory = None ):
971
+ def browse (self ):
972
972
"""
973
973
Open a file dialog and select a user specified file.
974
974
"""
@@ -1089,7 +1089,7 @@ def _local_settings(cls):
1089
1089
# type: () -> QSettings
1090
1090
"""Return a QSettings instance with local persistent settings."""
1091
1091
filename = "{}.ini" .format (qname (cls ))
1092
- fname = os .path .join (settings . widget_settings_dir (), filename )
1092
+ fname = os .path .join (widget_settings_dir (), filename )
1093
1093
return QSettings (fname , QSettings .IniFormat )
1094
1094
1095
1095
def _add_recent (self , filename , options = None ):
0 commit comments