Skip to content

Commit 6f72b74

Browse files
committed
collectionseditor: fixed save array feature
1 parent daef7dc commit 6f72b74

File tree

2 files changed

+43
-35
lines changed

2 files changed

+43
-35
lines changed

.vscode/settings.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
{
2-
"python.formatting.provider": "black",
2+
"editor.rulers": [
3+
88
4+
],
5+
"files.trimFinalNewlines": true,
6+
"files.trimTrailingWhitespace": true,
37
"editor.formatOnSave": true,
4-
],
8+
"python.sortImports.args": [
9+
"--profile",
10+
"black"
11+
],
12+
"[python]": {
13+
"editor.codeActionsOnSave": {
14+
"source.organizeImports": true
15+
}
16+
},
17+
"python.linting.pycodestyleArgs": [
18+
"--max-line-length=88",
19+
"--ignore=E203,W503"
20+
],
21+
"python.linting.pycodestyleEnabled": true,
22+
"python.formatting.provider": "black",
523
}

guidata/widgets/collectionseditor.py

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,45 +32,15 @@
3232
import warnings
3333

3434
import PIL.Image
35-
36-
from guidata.utils import getcwd_or_home
35+
from guidata.config import CONF, _
3736
from guidata.configtools import get_font, get_icon
3837
from guidata.qthelpers import (
3938
add_actions,
4039
create_action,
4140
mimedata2url,
4241
win32_fix_title_bar_background,
4342
)
44-
from guidata.config import CONF, _
45-
from qtpy.QtWidgets import (
46-
QAbstractItemDelegate,
47-
QApplication,
48-
QDateEdit,
49-
QDateTimeEdit,
50-
QDialog,
51-
QHBoxLayout,
52-
QInputDialog,
53-
QItemDelegate,
54-
QLineEdit,
55-
QMenu,
56-
QMessageBox,
57-
QPushButton,
58-
QTableView,
59-
QVBoxLayout,
60-
QWidget,
61-
)
62-
from qtpy.QtCore import (
63-
QAbstractTableModel,
64-
QModelIndex,
65-
Qt,
66-
Signal,
67-
Slot,
68-
QDateTime,
69-
)
70-
from qtpy.QtGui import (
71-
QColor,
72-
QKeySequence,
73-
)
43+
from guidata.utils import getcwd_or_home
7444
from guidata.widgets.importwizard import ImportWizard
7545
from guidata.widgets.nsview import (
7646
DataFrame,
@@ -96,6 +66,26 @@
9666
value_to_display,
9767
)
9868
from guidata.widgets.texteditor import TextEditor
69+
from qtpy.compat import getsavefilename
70+
from qtpy.QtCore import QAbstractTableModel, QDateTime, QModelIndex, Qt, Signal, Slot
71+
from qtpy.QtGui import QColor, QKeySequence
72+
from qtpy.QtWidgets import (
73+
QAbstractItemDelegate,
74+
QApplication,
75+
QDateEdit,
76+
QDateTimeEdit,
77+
QDialog,
78+
QHBoxLayout,
79+
QInputDialog,
80+
QItemDelegate,
81+
QLineEdit,
82+
QMenu,
83+
QMessageBox,
84+
QPushButton,
85+
QTableView,
86+
QVBoxLayout,
87+
QWidget,
88+
)
9989

10090
if ndarray is not FakeObject:
10191
from guidata.widgets.arrayeditor import ArrayEditor
@@ -1280,7 +1270,7 @@ def save_array(self):
12801270
if self.array_filename is None:
12811271
self.array_filename = getcwd_or_home()
12821272
self.redirect_stdio.emit(False)
1283-
filename, _selfilter = get_save_filename(
1273+
filename, _selfilter = getsavefilename(
12841274
self, title, self.array_filename, _("NumPy arrays") + " (*.npy)"
12851275
)
12861276
self.redirect_stdio.emit(True)

0 commit comments

Comments
 (0)