Skip to content

Commit c17d5f6

Browse files
author
minjk-bl
committed
Edit File app to support installation of read_spss
1 parent ae0441f commit c17d5f6

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

visualpython/js/com/component/PopupComponent.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,11 +950,27 @@ define([
950950
$(this.wrapSelector()).show();
951951
}
952952

953+
showInstallButton() {
954+
$(this.wrapSelector('#popupInstall')).show();
955+
}
956+
957+
showImportButton() {
958+
$(this.wrapSelector('#popupImport')).show();
959+
}
960+
953961
hide() {
954962
this.taskItem && this.taskItem.blurItem();
955963
$(this.wrapSelector()).hide();
956964
}
957965

966+
hideInstallButton() {
967+
$(this.wrapSelector('#popupInstall')).hide();
968+
}
969+
970+
hideImportButton() {
971+
$(this.wrapSelector('#popupImport')).hide();
972+
}
973+
958974
isHidden() {
959975
return !$(this.wrapSelector()).is(':visible');
960976
}

visualpython/js/m_apps/File.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ define([
209209
// reload
210210
that.renderPage(pageType);
211211
that._bindEventByType(pageType);
212+
213+
if (value === 'spss') {
214+
// show install button
215+
that.showInstallButton();
216+
} else {
217+
that.hideInstallButton();
218+
}
212219
});
213220

214221
// open file navigation
@@ -424,6 +431,10 @@ define([
424431

425432
}
426433

434+
generateInstallCode() {
435+
return [ '!pip install pyreadstat' ];
436+
}
437+
427438
generateCode() {
428439
var pageType = $(this.wrapSelector('#vp_fileioType')).val();
429440
var sbCode = new com_String;

0 commit comments

Comments
 (0)