From 8d771abb0f83809b11212bebc4b68779b6746819 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 5 Jul 2023 18:00:43 +0900 Subject: [PATCH 01/17] Add default allocate variables --- visualpython/data/m_library/pandasLibrary.js | 18 ++++++++++++------ visualpython/html/m_apps/file.html | 2 +- visualpython/html/m_apps/sweetviz.html | 2 +- visualpython/js/m_apps/File.js | 12 +++++++++--- visualpython/js/m_apps/Frame.js | 8 ++++---- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/visualpython/data/m_library/pandasLibrary.js b/visualpython/data/m_library/pandasLibrary.js index 488f9ef5..e566ce4a 100644 --- a/visualpython/data/m_library/pandasLibrary.js +++ b/visualpython/data/m_library/pandasLibrary.js @@ -179,7 +179,8 @@ define([ "output": true, "component": [ "data_select" - ] + ], + "value": "vp_df" }, { "name": "encoding", @@ -3526,7 +3527,8 @@ define([ "output": true, "component": [ "data_select" - ] + ], + "value": "vp_df" }, { "name": "typ", @@ -3683,7 +3685,8 @@ define([ "output": true, "component": [ "data_select" - ] + ], + "value": "vp_df" } ] }, @@ -6536,7 +6539,8 @@ define([ "output": true, "component": [ "data_select" - ] + ], + "value": "vp_df" }, { "name": "sheet_name", @@ -6722,7 +6726,8 @@ define([ "output": true, "component": [ "data_select" - ] + ], + "value": "vp_df" }, { "name": "format", @@ -6767,7 +6772,8 @@ define([ "output": true, "component": [ "data_select" - ] + ], + "value": "vp_df" }, { "name": "usecols", diff --git a/visualpython/html/m_apps/file.html b/visualpython/html/m_apps/file.html index a72000de..c1117704 100644 --- a/visualpython/html/m_apps/file.html +++ b/visualpython/html/m_apps/file.html @@ -75,7 +75,7 @@ - + diff --git a/visualpython/html/m_apps/sweetviz.html b/visualpython/html/m_apps/sweetviz.html index 4769125a..0f059235 100644 --- a/visualpython/html/m_apps/sweetviz.html +++ b/visualpython/html/m_apps/sweetviz.html @@ -21,7 +21,7 @@ - +
diff --git a/visualpython/js/m_apps/File.js b/visualpython/js/m_apps/File.js index 9540c0d1..641d895b 100644 --- a/visualpython/js/m_apps/File.js +++ b/visualpython/js/m_apps/File.js @@ -177,7 +177,8 @@ define([ "data_select" ], "output": true, - "required": true + "required": true, + "value": 'vp_df' } ] } @@ -235,9 +236,14 @@ define([ type = 'open'; } + let extensionList = []; + if (that.state.fileExtension !== '') { + extensionList = [ that.state.fileExtension ]; + } + let fileNavi = new FileNavigation({ type: type, - extensions: [ that.state.fileExtension ], + extensions: extensionList, finish: function(filesPath, status, error) { let {file, path} = filesPath[0]; that.state.selectedFile = file; @@ -310,7 +316,7 @@ define([ let page = $(fileHtml); let allocateSelector = new DataSelector({ - pageThis: this, id: 'vp_sampleReturn', placeholder: 'Variable name' + pageThis: this, id: 'vp_sampleReturn', placeholder: 'Variable name', value: 'vp_df' }); $(page).find('#vp_sampleReturn').replaceWith(allocateSelector.toTagString()); diff --git a/visualpython/js/m_apps/Frame.js b/visualpython/js/m_apps/Frame.js index a07f7299..b59767e8 100644 --- a/visualpython/js/m_apps/Frame.js +++ b/visualpython/js/m_apps/Frame.js @@ -37,7 +37,7 @@ define([ this.state = { originObj: '', tempObj: '_vp', - returnObj: '_vp', + returnObj: 'vp_df', inplace: false, menu: '', menuItem: '', @@ -176,7 +176,7 @@ define([ // initialize state values that.state.originObj = origin; that.state.tempObj = '_vp'; - that.state.returnObj = that.state.tempObj; + that.state.returnObj = 'vp_df'; if (that.state.inplace === true) { that.state.returnObj = origin; } @@ -228,7 +228,7 @@ define([ // check/uncheck inplace $(this.wrapSelector('#inplace')).on('change', function() { let checked = $(this).prop('checked'); - let returnVariable = '_vp'; + let returnVariable = 'vp_df'; if (checked === true) { returnVariable = that.state.originObj; } @@ -1122,7 +1122,7 @@ define([ let page = $(frameHtml); let allocateSelector = new DataSelector({ - pageThis: this, id: 'vp_feReturn', placeholder: 'Variable name', required: true, value: '_vp' + pageThis: this, id: 'vp_feReturn', placeholder: 'Variable name', required: true, value: 'vp_df' }); $(page).find('#vp_feReturn').replaceWith(allocateSelector.toTagString()); From 0f41de24a0114cea73763c9ba730edeeb17cba3d Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 5 Jul 2023 18:00:55 +0900 Subject: [PATCH 02/17] Fix regression multi enter code --- visualpython/js/m_stats/Regression.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/visualpython/js/m_stats/Regression.js b/visualpython/js/m_stats/Regression.js index ab37b76f..0a0896a0 100644 --- a/visualpython/js/m_stats/Regression.js +++ b/visualpython/js/m_stats/Regression.js @@ -707,10 +707,8 @@ define([ code.appendLine("from IPython.display import display, Markdown"); code.appendLine("from scipy import stats"); code.appendLine("import statsmodels.api as sm"); - if (testType === 'multiple') { - if (['stepwise', 'backward', 'forward'].includes(method)) { - code.appendLine("_predict = _result.predict(sm.add_constant(vp_df[_model.exog_names[1:]]))"); - } + if (testType === 'multiple' && ['stepwise', 'backward', 'forward'].includes(method)) { + code.appendLine("_predict = _result.predict(sm.add_constant(vp_df[_model.exog_names[1:]]))"); } else { code.appendLine("_predict = _result.predict(vp_df)"); } From 549c69de00a230a7081365fabf31f71f69080ab6 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 5 Jul 2023 18:01:24 +0900 Subject: [PATCH 03/17] Add log to file navigation on error --- visualpython/js/com/component/FileNavigation.js | 1 + 1 file changed, 1 insertion(+) diff --git a/visualpython/js/com/component/FileNavigation.js b/visualpython/js/com/component/FileNavigation.js index d10de03b..603ff8a0 100644 --- a/visualpython/js/com/component/FileNavigation.js +++ b/visualpython/js/com/component/FileNavigation.js @@ -259,6 +259,7 @@ define([ if (allowExtensionList.length > 0 && !allowExtensionList.includes(extension)) { // TODO: alert //vpCommon.renderAlertModal('Not supported file type'); + vpLog.display(VP_LOG_TYPE.ERROR, 'Not supported file type: ' + extension); return; } From cc30130c2adaf44782eed62dcf7593ca55ddd6ed Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 5 Jul 2023 18:01:35 +0900 Subject: [PATCH 04/17] Add loading spinner to Package Manager --- visualpython/js/com/component/PackageManager.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/visualpython/js/com/component/PackageManager.js b/visualpython/js/com/component/PackageManager.js index 95b7cb5f..7ff40057 100644 --- a/visualpython/js/com/component/PackageManager.js +++ b/visualpython/js/com/component/PackageManager.js @@ -18,8 +18,9 @@ define([ 'vp_base/js/com/com_Const', 'vp_base/js/com/com_String', 'vp_base/js/com/component/PopupComponent', - 'vp_base/js/com/component/FileNavigation' -], function(ifHtml, ifCss, com_util, com_Const, com_String, PopupComponent, FileNavigation) { + 'vp_base/js/com/component/FileNavigation', + 'vp_base/js/com/component/LoadingSpinner' +], function(ifHtml, ifCss, com_util, com_Const, com_String, PopupComponent, FileNavigation, LoadingSpinner) { /** * PackageManager @@ -399,6 +400,7 @@ define([ $(this.wrapSelector('.vp-pm-table')).html(''); let packageList = Object.keys(this.packageLib); + let loadingSpinner = new LoadingSpinner($(this.wrapSelector('.vp-popup-body'))); vpKernel.getPackageList(packageList).then(function(resultObj) { let { result } = resultObj; let packageInfo = JSON.parse(result); @@ -418,6 +420,8 @@ define([ that.bindItemEvent(); }).catch(function() { + }).finally(function() { + loadingSpinner.remove(); }); } From af80d5a1559a4ab2c2a07e648cd115b592321e2a Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 5 Jul 2023 18:28:08 +0900 Subject: [PATCH 05/17] Remove dataselector on allocation input --- visualpython/data/m_library/pandasLibrary.js | 240 +++++++++---------- visualpython/js/m_apps/File.js | 9 +- visualpython/js/m_apps/Frame.js | 9 +- visualpython/js/m_apps/Instance.js | 9 +- visualpython/js/m_apps/PandasOption.js | 5 +- visualpython/js/m_apps/Subset.js | 15 +- 6 files changed, 145 insertions(+), 142 deletions(-) diff --git a/visualpython/data/m_library/pandasLibrary.js b/visualpython/data/m_library/pandasLibrary.js index e566ce4a..0646205b 100644 --- a/visualpython/data/m_library/pandasLibrary.js +++ b/visualpython/data/m_library/pandasLibrary.js @@ -44,7 +44,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -79,7 +79,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -110,7 +110,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -178,7 +178,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "value": "vp_df" }, @@ -349,7 +349,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -419,7 +419,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -488,7 +488,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -559,7 +559,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -648,7 +648,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -704,7 +704,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -778,7 +778,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -842,7 +842,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -921,7 +921,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -963,7 +963,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1005,7 +1005,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1057,7 +1057,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1109,7 +1109,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1161,7 +1161,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1223,7 +1223,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1282,7 +1282,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1341,7 +1341,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1400,7 +1400,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1459,7 +1459,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1518,7 +1518,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1594,7 +1594,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1670,7 +1670,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1766,7 +1766,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1798,7 +1798,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1881,7 +1881,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1965,7 +1965,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -1993,7 +1993,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2022,7 +2022,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2049,7 +2049,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2077,7 +2077,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2106,7 +2106,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2133,7 +2133,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2166,7 +2166,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2199,7 +2199,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2227,7 +2227,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2254,7 +2254,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2282,7 +2282,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2310,7 +2310,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2337,7 +2337,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2366,7 +2366,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2394,7 +2394,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2418,7 +2418,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2445,7 +2445,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2481,7 +2481,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2535,7 +2535,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2601,7 +2601,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2667,7 +2667,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2733,7 +2733,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2786,7 +2786,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2902,7 +2902,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2931,7 +2931,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3004,7 +3004,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3064,7 +3064,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3146,7 +3146,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3180,7 +3180,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3220,7 +3220,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3265,7 +3265,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3291,7 +3291,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3317,7 +3317,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3343,7 +3343,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3369,7 +3369,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3395,7 +3395,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3421,7 +3421,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3463,7 +3463,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3492,7 +3492,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3526,7 +3526,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "value": "vp_df" }, @@ -3610,7 +3610,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3684,7 +3684,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "value": "vp_df" } @@ -3725,7 +3725,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3752,7 +3752,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3795,7 +3795,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3834,7 +3834,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3877,7 +3877,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3930,7 +3930,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3982,7 +3982,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4062,7 +4062,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -4094,7 +4094,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4147,7 +4147,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4186,7 +4186,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4263,7 +4263,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4325,7 +4325,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -4356,7 +4356,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4440,7 +4440,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4529,7 +4529,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -4563,7 +4563,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -4606,7 +4606,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4664,7 +4664,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4708,7 +4708,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4798,7 +4798,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4892,7 +4892,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4960,7 +4960,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -5015,7 +5015,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5065,7 +5065,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "var_type": [ "Series" @@ -5139,7 +5139,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "var_type": [ "Series", @@ -5224,7 +5224,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -5262,7 +5262,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "var_type": [ "Series", @@ -5338,7 +5338,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "var_type": [ "Series", @@ -5389,7 +5389,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5453,7 +5453,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5523,7 +5523,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "var_type": [ "Series", @@ -5585,7 +5585,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5673,7 +5673,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5760,7 +5760,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5886,7 +5886,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5966,7 +5966,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -6061,7 +6061,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -6148,7 +6148,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -6207,7 +6207,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -6276,7 +6276,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -6538,7 +6538,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "value": "vp_df" }, @@ -6617,7 +6617,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -6644,7 +6644,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -6673,7 +6673,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -6700,7 +6700,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -6725,7 +6725,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "value": "vp_df" }, @@ -6771,7 +6771,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "value": "vp_df" }, diff --git a/visualpython/js/m_apps/File.js b/visualpython/js/m_apps/File.js index 641d895b..ce93fc74 100644 --- a/visualpython/js/m_apps/File.js +++ b/visualpython/js/m_apps/File.js @@ -315,10 +315,11 @@ define([ /** Implement generating template */ let page = $(fileHtml); - let allocateSelector = new DataSelector({ - pageThis: this, id: 'vp_sampleReturn', placeholder: 'Variable name', value: 'vp_df' - }); - $(page).find('#vp_sampleReturn').replaceWith(allocateSelector.toTagString()); + // Removed dataselector for Allocation input + // let allocateSelector = new DataSelector({ + // pageThis: this, id: 'vp_sampleReturn', placeholder: 'Variable name', value: 'vp_df' + // }); + // $(page).find('#vp_sampleReturn').replaceWith(allocateSelector.toTagString()); return page; } diff --git a/visualpython/js/m_apps/Frame.js b/visualpython/js/m_apps/Frame.js index b59767e8..a7538a1b 100644 --- a/visualpython/js/m_apps/Frame.js +++ b/visualpython/js/m_apps/Frame.js @@ -1121,10 +1121,11 @@ define([ templateForBody() { let page = $(frameHtml); - let allocateSelector = new DataSelector({ - pageThis: this, id: 'vp_feReturn', placeholder: 'Variable name', required: true, value: 'vp_df' - }); - $(page).find('#vp_feReturn').replaceWith(allocateSelector.toTagString()); + // Removed dataselector for Allocation input + // let allocateSelector = new DataSelector({ + // pageThis: this, id: 'vp_feReturn', placeholder: 'Variable name', required: true, value: 'vp_df' + // }); + // $(page).find('#vp_feReturn').replaceWith(allocateSelector.toTagString()); return page; } diff --git a/visualpython/js/m_apps/Instance.js b/visualpython/js/m_apps/Instance.js index 129162b2..2dda58e9 100644 --- a/visualpython/js/m_apps/Instance.js +++ b/visualpython/js/m_apps/Instance.js @@ -208,10 +208,11 @@ define([ }); $(page).find('#vp_instanceTarget').replaceWith(targetSelector.toTagString()); - let allocateSelector = new DataSelector({ - pageThis: this, id: 'vp_instanceAllocate', placeholder: 'Variable name' - }); - $(page).find('#vp_instanceAllocate').replaceWith(allocateSelector.toTagString()); + // Removed dataselector for Allocation input + // let allocateSelector = new DataSelector({ + // pageThis: this, id: 'vp_instanceAllocate', placeholder: 'Variable name' + // }); + // $(page).find('#vp_instanceAllocate').replaceWith(allocateSelector.toTagString()); return page; } diff --git a/visualpython/js/m_apps/PandasOption.js b/visualpython/js/m_apps/PandasOption.js index 0d6d1dfd..cb96e92c 100644 --- a/visualpython/js/m_apps/PandasOption.js +++ b/visualpython/js/m_apps/PandasOption.js @@ -17,9 +17,8 @@ define([ 'vp_base/js/com/com_util', 'vp_base/js/com/com_Const', 'vp_base/js/com/com_String', - 'vp_base/js/com/component/PopupComponent', - 'vp_base/js/com/component/DataSelector' -], function(poHTML, com_util, com_Const, com_String, PopupComponent, DataSelector) { + 'vp_base/js/com/component/PopupComponent' +], function(poHTML, com_util, com_Const, com_String, PopupComponent) { /** * PandasOption diff --git a/visualpython/js/m_apps/Subset.js b/visualpython/js/m_apps/Subset.js index 835a9196..5c923a62 100644 --- a/visualpython/js/m_apps/Subset.js +++ b/visualpython/js/m_apps/Subset.js @@ -168,13 +168,14 @@ define([ let page = $(subsetHtml); let that = this; - let allocateSelector = new DataSelector({ - pageThis: this, id: 'allocateTo', classes: VP_DS_ALLOCATE_TO, placeholder: 'New variable name', - finish: function() { - that.generateCode(); - } - }); - $(page).find('.' + VP_DS_ALLOCATE_TO).replaceWith(allocateSelector.toTagString()); + // Removed dataselector for Allocation input + // let allocateSelector = new DataSelector({ + // pageThis: this, id: 'allocateTo', classes: VP_DS_ALLOCATE_TO, placeholder: 'New variable name', + // finish: function() { + // that.generateCode(); + // } + // }); + // $(page).find('.' + VP_DS_ALLOCATE_TO).replaceWith(allocateSelector.toTagString()); return page; } From dbef5694c4bc86aa8a6bce02bd35c473ca1981f8 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 11:29:43 +0900 Subject: [PATCH 06/17] Edit SuggestInput to add scrollbar on long item list --- visualpython/css/root.css | 15 +++++++++++++++ visualpython/js/com/component/SuggestInput.js | 2 ++ 2 files changed, 17 insertions(+) diff --git a/visualpython/css/root.css b/visualpython/css/root.css index 1ad1ec16..fddf690e 100644 --- a/visualpython/css/root.css +++ b/visualpython/css/root.css @@ -378,6 +378,21 @@ button.vp-button { background: #C4C4C4; } +/* Scrollbar vertical only */ +.vp-scrollbar-vertical { + overflow-x: hidden; + overflow-y: auto; + --webkit-mask-position: left top; +} +.vp-scrollbar-vertical::-webkit-scrollbar { + width: 5px; + height: 5px; +} +.vp-scrollbar-vertical::-webkit-scrollbar-thumb { + border: 0.3px solid #C4C4C4; + background: #C4C4C4; +} + /* Scrollbar horizontal */ .vp-scrollbar-horizontal { overflow-x: auto; diff --git a/visualpython/js/com/component/SuggestInput.js b/visualpython/js/com/component/SuggestInput.js index a0ae45f8..2c7fa96e 100644 --- a/visualpython/js/com/component/SuggestInput.js +++ b/visualpython/js/com/component/SuggestInput.js @@ -168,6 +168,8 @@ define([ $(this).select(); $(com_util.formatString(".{0}", that.uuid)).autocomplete('search', $(com_util.formatString(".{0}", that.uuid)).val()); }).autocomplete('instance')._renderItem = function(ul, item) { + $(ul).addClass('vp-scrollbar-vertical'); + $(ul).css('max-height', '250px'); if (item.dtype != undefined) { return $('
  • ').attr('data-value', item.value) .append(`
    ${item.label}
    `) From e7f75722b7c2a17d0f970379e52b0b85ed3f51b2 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 11:30:01 +0900 Subject: [PATCH 07/17] Add jupyterlite build and serve command info --- jupyterlab/dev-build.jupyterlab.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jupyterlab/dev-build.jupyterlab.sh b/jupyterlab/dev-build.jupyterlab.sh index 29c2f980..7ebac489 100755 --- a/jupyterlab/dev-build.jupyterlab.sh +++ b/jupyterlab/dev-build.jupyterlab.sh @@ -50,4 +50,7 @@ jlpm run build # jupyter lite build # Run jupyterlite server -# jupyter lite serve \ No newline at end of file +# jupyter lite serve # init + build + serve + +# If something went wrong, remove _output/extensions folder and run command below +# jupyter lite init \ No newline at end of file From d0f292556c4db1317467c4ad05c8e39f2aacca8a Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 11:31:12 +0900 Subject: [PATCH 08/17] Add protector for lab and lite on launcher state --- visualpython/css/mainFrame.css | 37 +++++++++++++++++++++++ visualpython/js/com/com_Config.js | 47 +++++++++++++++++++++++++++-- visualpython/js/com/com_Kernel.js | 2 ++ visualpython/js/loadVisualpython.js | 41 ++++++++++++++++++++----- 4 files changed, 117 insertions(+), 10 deletions(-) diff --git a/visualpython/css/mainFrame.css b/visualpython/css/mainFrame.css index 1efd12b7..c22373d5 100644 --- a/visualpython/css/mainFrame.css +++ b/visualpython/css/mainFrame.css @@ -59,6 +59,43 @@ div#vp_wrapper.colab * { #vp_wrapper.lab *, #vp_wrapper.lite * { box-sizing: border-box !important; } +/* LITE: show protector */ +#vp_wrapper.lab .vp-protector, +#vp_wrapper.lite .vp-protector { + background-color: rgb(33 33 33 / 77%); + position: absolute; + width: 100%; + height: 100%; + z-index: 100; +} +#vp_wrapper.lab .vp-protector-info, +#vp_wrapper.lite .vp-protector-info { + background-color: var(--vp-background-color); + width: 250px; + height: 170px; + padding: 10px; + margin: auto; + top: calc(50% - 80px); + position: relative; + display: grid; + grid-template-rows: 20px 100px 30px; +} +#vp_wrapper.lab .vp-protector-title, +#vp_wrapper.lite .vp-protector-title { + font-weight: bold; + color: var(--vp-font-highlight); +} +#vp_wrapper.lab .vp-protector-content, +#vp_wrapper.lite .vp-protector-content { + border: 0.25px solid var(--vp-border-gray-color); + border-radius: 10px; + padding: 10px; + margin: 5px 0; +} +#vp_wrapper.lab .vp-protector-footer, +#vp_wrapper.lite .vp-protector-footer { + text-align: right; +} /* resizing handle */ #vp_wrapper > .ui-resizable-handle { diff --git a/visualpython/js/com/com_Config.js b/visualpython/js/com/com_Config.js index 09825978..a82c078b 100644 --- a/visualpython/js/com/com_Config.js +++ b/visualpython/js/com/com_Config.js @@ -52,7 +52,7 @@ define([ */ constructor(extensionType='notebook', initialData={}) { // initial mode - this.isReady = false; + this._isReady = { 'default': false }; this.extensionType = extensionType; this.parentSelector = 'body'; if (extensionType === 'notebook') { @@ -216,6 +216,41 @@ define([ } + get isReady() { + let sessionId = 'default'; + if (this.extensionType === 'lab' || this.extensionType === 'lite') { + let panelId = vpKernel.getLabPanelId(); + if (panelId) { + sessionId = panelId; + } + } + if (sessionId in this._isReady) { + return this._isReady[sessionId]; + } + return false; + } + + set isReady(ready) { + let sessionId = 'default'; + if (this.extensionType === 'lab' || this.extensionType === 'lite') { + let panelId = vpKernel.getLabPanelId(); + if (panelId) { + sessionId = panelId; + } + } + this._isReady[sessionId] = ready; + } + + showProtector(title='No kernel', content='You have to open the notebook or console to use Visual Python.') { + $('#vp_protector .vp-protector-title').text(title); + $('#vp_protector .vp-protector-content').text(content); + $('#vp_protector').show(); + } + + hideProtector() { + $('#vp_protector').hide(); + } + /** * Read dejault config */ @@ -299,6 +334,9 @@ define([ let that = this; // CHROME: change method to load py files ($.get -> require) return new Promise(function(resolve, reject) { + // if (that.extensionType === 'lite') { + // that.showProtector('Kernel loading', 'Required inner function is loading now...'); + // } var libraryList = [ printCommand, fileNaviCommand, pandasCommand, variableCommand, visualizationCommand ]; @@ -344,6 +382,9 @@ define([ console.log('visualpython - failed to load library', resultObj); // TODO: show to restart kernel }).finally(function() { + // if (that.extensionType === 'lite') { + // that.hideProtector(); + // } if (!failed) { console.log('visualpython - loaded libraries', libraryList); resolve(true); @@ -1005,8 +1046,8 @@ define([ /** * FIXME: before release, change it to _MODE_TYPE.RELEASE */ - // Config.serverMode = _MODE_TYPE.DEVELOP; - Config.serverMode = _MODE_TYPE.RELEASE; + Config.serverMode = _MODE_TYPE.DEVELOP; + // Config.serverMode = _MODE_TYPE.RELEASE; /** * Version diff --git a/visualpython/js/com/com_Kernel.js b/visualpython/js/com/com_Kernel.js index ec01e35a..f6e44c15 100644 --- a/visualpython/js/com/com_Kernel.js +++ b/visualpython/js/com/com_Kernel.js @@ -381,6 +381,8 @@ define([ } var future; if (vpConfig.isReady === false) { + vpConfig.isReady = true; + vpConfig.hideProtector(); vpConfig.readKernelFunction().then(function() { future = kernelConnection.requestExecute(codeObj); future.onIOPub = onIOPub; diff --git a/visualpython/js/loadVisualpython.js b/visualpython/js/loadVisualpython.js index c279b2c8..d7f57aa5 100644 --- a/visualpython/js/loadVisualpython.js +++ b/visualpython/js/loadVisualpython.js @@ -288,24 +288,35 @@ define([ // LAB: if widget is ready or changed, ready for lab kernel connected, and restart vp vpLab.shell._currentChanged.connect(function(s1, value) { var { newValue } = value; + vpLog.display(VP_LOG_TYPE.DEVELOP, 'jupyterlab shell currently changed', s1, value); // kernel restart for notebook and console if (newValue && newValue.sessionContext) { + vpConfig.hideProtector(); if (newValue.sessionContext.isReady) { - vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...'); - vpConfig.isReady = true; - vpConfig.readKernelFunction(); - vpConfig.checkVersionTimestamp(); - } - newValue.sessionContext._connectionStatusChanged.connect(function(s2, status) { - if (status === 'connected') { + if (vpConfig.isReady === false) { vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...'); vpConfig.isReady = true; vpConfig.readKernelFunction(); vpConfig.checkVersionTimestamp(); } + } + newValue.sessionContext._connectionStatusChanged.connect(function(s2, status) { + if (status === 'connected') { + if (vpConfig.isReady === false) { + vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...'); + vpConfig.isReady = true; + vpConfig.readKernelFunction(); + vpConfig.checkVersionTimestamp(); + } + } }); } else { vpLog.display(VP_LOG_TYPE.LOG, 'No widget detected...'); + vpConfig.isReady = false; + vpConfig.showProtector(); + if (vpConfig.extensionType === 'lite') { + vpLab.serviceManager.sessions.runningChanged.connect(handleRunningChanged); + } } }); } @@ -313,6 +324,22 @@ define([ return vpFrame; } + var handleRunningChanged = function(a, b) { + vpLog.display(VP_LOG_TYPE.DEVELOP, 'Current widget:', vpLab.shell.currentWidget); + if (vpLab.shell.currentWidget) { + vpLab.shell.currentWidget.sessionContext.statusChanged.connect(function(currentWidget, status) { + if (status === 'idle' && vpConfig.isReady === false) { + vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...'); + vpConfig.isReady = true; + vpConfig.hideProtector(); + vpConfig.readKernelFunction(); + vpConfig.checkVersionTimestamp(); + } + }); + vpLab.serviceManager.sessions.runningChanged.disconnect(handleRunningChanged); + } + } + return { initVisualpython: initVisualpython, readConfig: readConfig }; }); /* function, define */ From eb533a3821e9de3155ce411a6d99946fe5767767 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 11:31:33 +0900 Subject: [PATCH 09/17] Add protector hide button for user --- visualpython/js/MainFrame.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/visualpython/js/MainFrame.js b/visualpython/js/MainFrame.js index 551e0a2f..9031433c 100644 --- a/visualpython/js/MainFrame.js +++ b/visualpython/js/MainFrame.js @@ -88,6 +88,11 @@ define([ top: colabHeaderHeight + 'px' }); }); + } else if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') { + $('#vp_protectorShowWithoutKernel').click(function(evt) { + // just hide protector + vpConfig.hideProtector(); + }); } window.vpEvent = new com_Event(this); @@ -250,6 +255,19 @@ define([ { vp_note_display: vp_note_display, vp_note_width: vp_note_width }, { parent: this } ); + + // load protector for jupyterlite + if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') { + $('#vp_wrapper').append(`
    +
    +
    No kernel
    +
    You have to open the notebook or console to use Visual Python.
    + +
    +
    `) + } // consider height and width this._resizeWindow(); From a4bb32f902b9f2665c54cedcdf144d50b8f0367b Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 11:32:07 +0900 Subject: [PATCH 10/17] Fix console interaction problem on lite --- visualpython/js/com/com_interface.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/visualpython/js/com/com_interface.js b/visualpython/js/com/com_interface.js index 5a80ca98..4c12f1e5 100644 --- a/visualpython/js/com/com_interface.js +++ b/visualpython/js/com/com_interface.js @@ -111,6 +111,13 @@ define([ if (notebookPanel && notebookPanel.sessionContext){ var sessionContext = notebookPanel.sessionContext; let sessionType = sessionContext.type; + if (vpConfig.extensionType === 'lite') { + // check one more time for jupyter lite + // - it returns 'notebook' when it's console + if (notebookPanel.console !== undefined) { + sessionType = 'console'; + } + } if (sessionType === 'notebook') { var notebook = notebookPanel.content; var notebookModel = notebook.model; @@ -244,6 +251,13 @@ define([ if (notebookPanel && notebookPanel.sessionContext){ var sessionContext = notebookPanel.sessionContext; let sessionType = sessionContext.type; + if (vpConfig.extensionType === 'lite') { + // check one more time for jupyter lite + // - it returns 'notebook' when it's console + if (notebookPanel.console !== undefined) { + sessionType = 'console'; + } + } if (sessionType === 'notebook') { var notebook = notebookPanel.content; var notebookModel = notebook.model; From cb5bcb749f860770b36b52fc86ad93ba5a58efea Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 11:32:19 +0900 Subject: [PATCH 11/17] Add seaborn to be checked as a default --- visualpython/js/m_apps/Import.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/visualpython/js/m_apps/Import.js b/visualpython/js/m_apps/Import.js index 42f85f86..38b6aec6 100644 --- a/visualpython/js/m_apps/Import.js +++ b/visualpython/js/m_apps/Import.js @@ -70,10 +70,6 @@ define([ } this.importTemplatesCopy = JSON.parse(JSON.stringify(importTemplates)); - if (vpConfig.extensionType === 'lite') { - // for LITE: set default checked state as false on seaborn package - this.importTemplatesCopy['data-analysis'][3].checked = false; - } if (!this.state.importMeta || this.state.importMeta.length <= 0) { this.state.importMeta = JSON.parse(JSON.stringify(this.importTemplatesCopy[this.state.tabType])); From 5c5200af8776bf51e9b91e2d3eafb3f671508e04 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 11:34:23 +0900 Subject: [PATCH 12/17] Add scrollbar to DataSelector --- visualpython/js/com/component/DataSelector.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/visualpython/js/com/component/DataSelector.js b/visualpython/js/com/component/DataSelector.js index ca520774..d6d34108 100644 --- a/visualpython/js/com/component/DataSelector.js +++ b/visualpython/js/com/component/DataSelector.js @@ -230,6 +230,8 @@ define([ $(this).select(); $(this).autocomplete('search', $(this).val()); }).autocomplete('instance')._renderItem = function(ul, item) { + $(ul).addClass('vp-scrollbar-vertical'); + $(ul).css('max-height', '250px'); return $('
  • ').attr('data-value', item.value) .append(`
    ${item.label}
    `) .appendTo(ul); From c185b0fa43f178a416dafdca86412edaedfc12e2 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 11:50:08 +0900 Subject: [PATCH 13/17] Fix scrollbar vertical style --- visualpython/css/root.css | 1 + 1 file changed, 1 insertion(+) diff --git a/visualpython/css/root.css b/visualpython/css/root.css index fddf690e..55a7a79f 100644 --- a/visualpython/css/root.css +++ b/visualpython/css/root.css @@ -382,6 +382,7 @@ button.vp-button { .vp-scrollbar-vertical { overflow-x: hidden; overflow-y: auto; + white-space: nowrap; --webkit-mask-position: left top; } .vp-scrollbar-vertical::-webkit-scrollbar { From 3bd0c9914341bcd6fccf5d890098461fd2c4c25b Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 11:52:40 +0900 Subject: [PATCH 14/17] Add loadingSpinner on loading default data --- visualpython/js/com/component/PackageManager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/visualpython/js/com/component/PackageManager.js b/visualpython/js/com/component/PackageManager.js index 7ff40057..350e9093 100644 --- a/visualpython/js/com/component/PackageManager.js +++ b/visualpython/js/com/component/PackageManager.js @@ -325,6 +325,7 @@ define([ super.render(); let that = this; + let loadingSpinner = new LoadingSpinner($(this.wrapSelector('.vp-popup-body'))); vpConfig.getData('', 'vppackman').then(function(savedData) { // Reset abnormal data if (savedData == undefined || savedData.packageList === undefined) { @@ -335,7 +336,7 @@ define([ that.packageLib = { ...savedData.packageList }; - + loadingSpinner.remove(); // load package list that.loadPackageList(); }).catch(function(err) { @@ -344,7 +345,7 @@ define([ that.packageLib = { ...that.packageLibTemplate }; - + loadingSpinner.remove(); // load package list that.loadPackageList(); }); From bb15d082656fe9a070ee509c7508bb9328a19994 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 12:05:13 +0900 Subject: [PATCH 15/17] Add package manager config file --- visualpython/js/com/com_Kernel.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/visualpython/js/com/com_Kernel.js b/visualpython/js/com/com_Kernel.js index f6e44c15..4282c1ad 100644 --- a/visualpython/js/com/com_Kernel.js +++ b/visualpython/js/com/com_Kernel.js @@ -44,6 +44,9 @@ define([ }, 'vpimport': { + }, + 'vppackman': { + } } } @@ -697,6 +700,9 @@ define([ case 'vpimport': configFile = 'import'; break; + case 'vppackman': + configFile = 'packman'; + break; } var cmd = com_util.formatString("print(_vp_get_colab_vpcfg('{0}'))", configFile); return new Promise(function(resolve, reject) { @@ -729,6 +735,9 @@ define([ case 'vpimport': configFile = 'import'; break; + case 'vppackman': + configFile = 'packman'; + break; } // write file var sbfileSaveCmd = new com_String(); @@ -763,6 +772,9 @@ define([ case 'vpimport': configFile = 'import'; break; + case 'vppackman': + configFile = 'packman'; + break; } var cmd = com_util.formatString("print(_vp_get_lab_vpcfg('{0}'))", configFile); return new Promise(function(resolve, reject) { @@ -795,6 +807,9 @@ define([ case 'vpimport': configFile = 'import'; break; + case 'vppackman': + configFile = 'packman'; + break; } // write file var sbfileSaveCmd = new com_String(); From eaee967b85244062c6dca393c92247526c4b1bc7 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 7 Jul 2023 12:05:29 +0900 Subject: [PATCH 16/17] Fix gitignore --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 396b0deb..8eaa6c8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,8 @@ dist/ jupyterlab/_output -jupyterlab/.jupyterlite.doit.db +jupyterlab/.jupyterlite.doit* jupyterlab/lib/visualpython jupyternotebook/visualpython colab/visualpython test/ .gitignore -visualpython/js/com/com_Config.js From 47360101e455d85f0901e5092ce45d5a6ca52a11 Mon Sep 17 00:00:00 2001 From: visualpython Date: Fri, 7 Jul 2023 12:19:51 +0900 Subject: [PATCH 17/17] deploy visualpython 2.4.4 --- build.sh | 4 ++-- colab/build.colab.sh | 4 ++-- colab/manifest.json | 2 +- jupyterlab/build.jupyterlab.sh | 4 ++-- jupyterlab/package-lock.json | 4 ++-- jupyterlab/package.json | 2 +- jupyterlab/pyproject.toml | 4 ++-- jupyternotebook/build.jupyternotebook.sh | 4 ++-- jupyternotebook/setup.py | 2 +- visualpython/js/com/com_Config.js | 6 +++--- visualpython/js/com/com_Const.js | 2 +- visualpython/js/m_apps/Frame.js | 6 +++--- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/build.sh b/build.sh index d71b2bc5..c394364e 100755 --- a/build.sh +++ b/build.sh @@ -11,8 +11,8 @@ #============================================================================= # Set version and replace it #============================================================================= -VP_ORG_VER=2.4.2 -VP_NEW_VER=2.4.3 +VP_ORG_VER=2.4.3 +VP_NEW_VER=2.4.4 # update version info grep -REil "VP_ORG_VER=.+$" colab/build.colab.sh jupyterlab/build.jupyterlab.sh jupyternotebook/build.jupyternotebook.sh | xargs sed -i "s/VP_ORG_VER=.\+$/VP_ORG_VER=${VP_ORG_VER}/g" diff --git a/colab/build.colab.sh b/colab/build.colab.sh index 57471d46..0fc663f4 100755 --- a/colab/build.colab.sh +++ b/colab/build.colab.sh @@ -11,8 +11,8 @@ #============================================================================= # Replace Version #============================================================================= -VP_ORG_VER=2.4.2 -VP_NEW_VER=2.4.3 +VP_ORG_VER=2.4.3 +VP_NEW_VER=2.4.4 # update version info # update manifest version with new numbering for new version diff --git a/colab/manifest.json b/colab/manifest.json index dcbc487d..4024cf56 100644 --- a/colab/manifest.json +++ b/colab/manifest.json @@ -1,7 +1,7 @@ { "name": "Visual Python for Colab", "description": "GUI-based Python code generator for Google Colab as an extension", - "version": "2.4.3", + "version": "2.4.4", "manifest_version": 3, "icons": { "48": "icon.png", diff --git a/jupyterlab/build.jupyterlab.sh b/jupyterlab/build.jupyterlab.sh index a477fb99..9d43a172 100755 --- a/jupyterlab/build.jupyterlab.sh +++ b/jupyterlab/build.jupyterlab.sh @@ -11,8 +11,8 @@ #============================================================================= # Replace Version and Basic Files #============================================================================= -VP_ORG_VER=2.4.2 -VP_NEW_VER=2.4.3 +VP_ORG_VER=2.4.3 +VP_NEW_VER=2.4.4 # update version info grep -REil "\"version\": \"${VP_ORG_VER}\"" package.json | xargs sed -i "s/\"version\": \"${VP_ORG_VER//\./\\.}\"/\"version\": \"${VP_NEW_VER}\"/g" diff --git a/jupyterlab/package-lock.json b/jupyterlab/package-lock.json index 899cf924..1e440644 100644 --- a/jupyterlab/package-lock.json +++ b/jupyterlab/package-lock.json @@ -1,12 +1,12 @@ { "name": "jupyterlab-visualpython", - "version": "2.4.2", + "version": "2.4.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "jupyterlab-visualpython", - "version": "2.4.2", + "version": "2.4.3", "license": "GPLv3 with Visual Python special exception", "dependencies": { "@jupyterlab/cells": "^3.5.2", diff --git a/jupyterlab/package.json b/jupyterlab/package.json index be5d17d1..c0b0cba8 100644 --- a/jupyterlab/package.json +++ b/jupyterlab/package.json @@ -1,6 +1,6 @@ { "name": "jupyterlab-visualpython", - "version": "2.4.3", + "version": "2.4.4", "description": "GUI-based Python code generator for Jupyter Lab as an extension", "keywords": [ "jupyter", diff --git a/jupyterlab/pyproject.toml b/jupyterlab/pyproject.toml index 865e3110..48944c97 100644 --- a/jupyterlab/pyproject.toml +++ b/jupyterlab/pyproject.toml @@ -32,7 +32,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", ] -version = "2.4.3" +version = "2.4.4" [project.license] file = "LICENSE" @@ -92,7 +92,7 @@ file = [ ] [tool.tbump.version] -current = "2.4.3" +current = "2.4.4" regex = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)((?Pa|b|rc|.dev)(?P\\d+))?" [tool.tbump.git] diff --git a/jupyternotebook/build.jupyternotebook.sh b/jupyternotebook/build.jupyternotebook.sh index 5c52d21d..d896b220 100755 --- a/jupyternotebook/build.jupyternotebook.sh +++ b/jupyternotebook/build.jupyternotebook.sh @@ -11,8 +11,8 @@ #============================================================================= # Replace Version and Basic Files #============================================================================= -VP_ORG_VER=2.4.2 -VP_NEW_VER=2.4.3 +VP_ORG_VER=2.4.3 +VP_NEW_VER=2.4.4 # update version info grep -REil ${VP_ORG_VER//\./\\.} setup.py visualpython/js/com/com_Config.js visualpython/js/com/com_Const.js | xargs sed -i --follow-symlinks "s/${VP_ORG_VER//\./\\.}/${VP_NEW_VER}/g" diff --git a/jupyternotebook/setup.py b/jupyternotebook/setup.py index cd492f04..f41228e7 100644 --- a/jupyternotebook/setup.py +++ b/jupyternotebook/setup.py @@ -10,7 +10,7 @@ setup( name = name, - version = '2.4.3', + version = '2.4.4', packages = find_packages(), package_data = {"": ["*"], 'visualpython' : ['visualpython.yaml', 'README.md']}, scripts = ['visualpython/bin/visualpy', 'visualpython/bin/visualpy.bat'], diff --git a/visualpython/js/com/com_Config.js b/visualpython/js/com/com_Config.js index a82c078b..868d5e98 100644 --- a/visualpython/js/com/com_Config.js +++ b/visualpython/js/com/com_Config.js @@ -1046,13 +1046,13 @@ define([ /** * FIXME: before release, change it to _MODE_TYPE.RELEASE */ - Config.serverMode = _MODE_TYPE.DEVELOP; - // Config.serverMode = _MODE_TYPE.RELEASE; + // Config.serverMode = _MODE_TYPE.DEVELOP; + Config.serverMode = _MODE_TYPE.RELEASE; /** * Version */ - Config.version = "2.4.3"; + Config.version = "2.4.4"; /** * Type of mode diff --git a/visualpython/js/com/com_Const.js b/visualpython/js/com/com_Const.js index 7a936711..b4f72374 100644 --- a/visualpython/js/com/com_Const.js +++ b/visualpython/js/com/com_Const.js @@ -19,7 +19,7 @@ define ([ class Constants { } Constants.TOOLBAR_BTN_INFO = { - HELP: "Visual Python 2.4.3" + HELP: "Visual Python 2.4.4" , ICON: "vp-main-icon" , ID: "vpBtnToggle" , NAME: "toggle-vp" diff --git a/visualpython/js/m_apps/Frame.js b/visualpython/js/m_apps/Frame.js index a7538a1b..44d4727c 100644 --- a/visualpython/js/m_apps/Frame.js +++ b/visualpython/js/m_apps/Frame.js @@ -240,7 +240,7 @@ define([ that.setPreview(that.getCurrentCode()); }); - // menu on column (Deprecated on v2.3.6 - Temporarily Show on v.2.4.3) + // menu on column (Deprecated on v2.3.6 - Temporarily Show on v.2.4.4) $(document).on('contextmenu', this.wrapSelector('.' + VP_FE_TABLE + ' .' + VP_FE_TABLE_COLUMN), function(event) { event.preventDefault(); @@ -270,7 +270,7 @@ define([ that.showMenu(thisPos.left, thisPos.top + thisRect.height); }); - // menu on row (Deprecated on v2.3.6 - Temporarily Show on v.2.4.3) + // menu on row (Deprecated on v2.3.6 - Temporarily Show on v.2.4.4) $(document).on('contextmenu', this.wrapSelector('.' + VP_FE_TABLE + ' .' + VP_FE_TABLE_ROW), function(event) { event.preventDefault(); var idx = $(that.wrapSelector('.' + VP_FE_TABLE_ROW)).index(this); // 0 ~ n @@ -595,7 +595,7 @@ define([ that.loadCode(that.getTypeCode(FRAME_EDIT_TYPE.SHOW), true); }); - // click toolbar item (Deprecated on v2.3.6 - Temporarily Show on v.2.4.3) + // click toolbar item (Deprecated on v2.3.6 - Temporarily Show on v.2.4.4) $(document).on('click', this.wrapSelector('.vp-fe-toolbar-item'), function(evt) { evt.stopPropagation(); var itemType = $(this).data('type');