|
6 | 6 | import Orange.data |
7 | 7 | import Orange.misc |
8 | 8 | from Orange import distance |
9 | | -from Orange.widgets import gui, settings |
| 9 | +from Orange.widgets import gui |
| 10 | +from Orange.widgets.settings import Setting |
10 | 11 | from Orange.widgets.utils.concurrent import TaskState, ConcurrentWidgetMixin |
11 | 12 | from Orange.widgets.utils.sql import check_sql_input |
12 | 13 | from Orange.widgets.utils.widgetpreview import WidgetPreview |
@@ -69,14 +70,14 @@ class Outputs: |
69 | 70 |
|
70 | 71 | settings_version = 2 |
71 | 72 |
|
72 | | - axis = settings.Setting(0) # type: int |
73 | | - metric_idx = settings.Setting(0) # type: int |
| 73 | + axis = Setting(0) # type: int |
| 74 | + metric_idx = Setting(0) # type: int |
74 | 75 |
|
75 | 76 | #: Use normalized distances if the metric supports it. |
76 | 77 | #: The default is `True`, expect when restoring from old pre v2 settings |
77 | 78 | #: (see `migrate_settings`). |
78 | | - normalized_dist = settings.Setting(True) # type: bool |
79 | | - autocommit = settings.Setting(True) # type: bool |
| 79 | + normalized_dist = Setting(True) # type: bool |
| 80 | + autocommit = Setting(True) # type: bool |
80 | 81 |
|
81 | 82 | want_main_area = False |
82 | 83 | buttons_area_orientation = Qt.Vertical |
@@ -200,13 +201,13 @@ def on_done(self, dist: Orange.misc.DistMatrix): |
200 | 201 | assert isinstance(dist, Orange.misc.DistMatrix) or dist is None |
201 | 202 | self.Outputs.distances.send(dist) |
202 | 203 |
|
203 | | - def on_exception(self, e): |
204 | | - if isinstance(e, ValueError): |
205 | | - self.Error.distances_value_error(e) |
206 | | - elif isinstance(e, MemoryError): |
| 204 | + def on_exception(self, ex): |
| 205 | + if isinstance(ex, ValueError): |
| 206 | + self.Error.distances_value_error(ex) |
| 207 | + elif isinstance(ex, MemoryError): |
207 | 208 | self.Error.distances_memory_error() |
208 | 209 | else: |
209 | | - raise e |
| 210 | + raise ex |
210 | 211 |
|
211 | 212 | def onDeleteWidget(self): |
212 | 213 | self.shutdown() |
|
0 commit comments