Skip to content

Commit ee84a90

Browse files
committed
deploy visualpython 2.4.9
1 parent fb08194 commit ee84a90

28 files changed

+163
-100
lines changed

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#=============================================================================
1212
# Set version and replace it
1313
#=============================================================================
14-
VP_ORG_VER=2.4.7
15-
VP_NEW_VER=2.4.8
14+
VP_ORG_VER=2.4.8
15+
VP_NEW_VER=2.4.9
1616

1717
# update version info
1818
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"

colab/build.colab.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#=============================================================================
1212
# Replace Version
1313
#=============================================================================
14-
VP_ORG_VER=2.4.7
15-
VP_NEW_VER=2.4.8
14+
VP_ORG_VER=2.4.8
15+
VP_NEW_VER=2.4.9
1616

1717
# update version info
1818
# update manifest version with new numbering for new version

colab/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Visual Python for Colab",
33
"description": "GUI-based Python code generator for Google Colab as an extension",
4-
"version": "2.4.8",
4+
"version": "2.4.9",
55
"manifest_version": 3,
66
"icons": {
77
"48": "icon.png",

jupyterlab/build.jupyterlab.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#=============================================================================
1212
# Replace Version and Basic Files
1313
#=============================================================================
14-
VP_ORG_VER=2.4.7
15-
VP_NEW_VER=2.4.8
14+
VP_ORG_VER=2.4.8
15+
VP_NEW_VER=2.4.9
1616

1717
# update version info
1818
grep -REil "\"version\": \"${VP_ORG_VER}\"" package.json | xargs sed -i "s/\"version\": \"${VP_ORG_VER//\./\\.}\"/\"version\": \"${VP_NEW_VER}\"/g"

jupyterlab/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jupyterlab/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab-visualpython",
3-
"version": "2.4.8",
3+
"version": "2.4.9",
44
"description": "GUI-based Python code generator for Jupyter Lab as an extension",
55
"keywords": [
66
"jupyter",

jupyterlab/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ classifiers = [
3232
"Programming Language :: Python :: 3.9",
3333
"Programming Language :: Python :: 3.10",
3434
]
35-
version = "2.4.8"
35+
version = "2.4.9"
3636

3737
[project.license]
3838
file = "LICENSE"
@@ -92,7 +92,7 @@ file = [
9292
]
9393

9494
[tool.tbump.version]
95-
current = "2.4.8"
95+
current = "2.4.9"
9696
regex = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)((?P<channel>a|b|rc|.dev)(?P<release>\\d+))?"
9797

9898
[tool.tbump.git]

jupyternotebook/build.jupyternotebook.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#=============================================================================
1212
# Replace Version and Basic Files
1313
#=============================================================================
14-
VP_ORG_VER=2.4.7
15-
VP_NEW_VER=2.4.8
14+
VP_ORG_VER=2.4.8
15+
VP_NEW_VER=2.4.9
1616

1717
# update version info
1818
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"

jupyternotebook/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name = name,
13-
version = '2.4.8',
13+
version = '2.4.9',
1414
packages = find_packages(),
1515
package_data = {"": ["*"], 'visualpython' : ['visualpython.yaml', 'README.md']},
1616
scripts = ['visualpython/bin/visualpy', 'visualpython/bin/visualpy.bat'],

visualpython/css/component/multiSelector.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
display: grid;
55
grid-template-columns: calc(47% - 15px) 50px calc(47% - 15px);
66
grid-auto-rows: 100%;
7+
position: relative;
78
}
89
.vp-cs-select-container input.vp-cs-select-search {
910
width: 100%;
@@ -86,4 +87,15 @@
8687
float: right;
8788
top: 4px;
8889
cursor: pointer;
90+
}
91+
.vp-cs-refresh {
92+
display: inline-block;
93+
width: 20px;
94+
height: 20px;
95+
line-height: 20px;
96+
vertical-align: middle;
97+
cursor: pointer;
98+
position: absolute;
99+
bottom: 5px;
100+
right: 5px;
89101
}

visualpython/css/component/popupComponent.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,14 @@
222222
margin-top: 9px;
223223
margin-right: 10px;
224224
}
225-
.vp-popup-run-button {
225+
.vp-popup-runadd-box > .vp-popup-button.vp-popup-run-button {
226226
display: inline-block;
227227
width: 60px;
228228
min-width: 60px;
229229
border-radius: 3px 0px 0px 3px;
230230
border-right: 0.25px solid white !important;
231231
}
232-
.vp-popup-button.vp-popup-show-detail-button {
232+
.vp-popup-runadd-box > .vp-popup-button.vp-popup-show-detail-button {
233233
display: inline-block;
234234
width: 20px;
235235
min-width: 20px;

visualpython/js/com/com_Config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ define([
10521052
/**
10531053
* Version
10541054
*/
1055-
Config.version = "2.4.8";
1055+
Config.version = "2.4.9";
10561056

10571057
/**
10581058
* Type of mode

visualpython/js/com/com_Const.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ define ([
1919
class Constants { }
2020

2121
Constants.TOOLBAR_BTN_INFO = {
22-
HELP: "Visual Python 2.4.8"
22+
HELP: "Visual Python 2.4.9"
2323
, ICON: "vp-main-icon"
2424
, ID: "vpBtnToggle"
2525
, NAME: "toggle-vp"

visualpython/js/com/com_generatorV2.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,20 @@ define([
12821282
let targetId = $(tag).data('target');
12831283
let colSelector = new MultiSelector(
12841284
pageThis.wrapSelector('#' + compId),
1285-
{ mode: 'columns', parent: (pageThis.state[targetId] || ''), selectedList: pageThis.state[compId] }
1285+
{
1286+
mode: 'columns', parent: (pageThis.state[targetId] || ''), selectedList: pageThis.state[compId],
1287+
change: function(type, list) {
1288+
let value = list.map(data => { return data.code }).join(',');
1289+
if (list.length == 0) {
1290+
value = '';
1291+
} else if (list.length > 0) {
1292+
value = '[' + value + ']';
1293+
}
1294+
pageThis.state[compId] = list.map(data => { return data.code });
1295+
pageThis.state[id] = value;
1296+
$(pageThis.wrapSelector('#'+id)).val(value);
1297+
}
1298+
}
12861299
);
12871300
pageThis.autoGen = {
12881301
[id]: colSelector,

visualpython/js/com/component/FileNavigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ define([
633633
let { msg, result } = resultObj;
634634
// show error using alert
635635

636-
if (msg.content.evalue) {
636+
if (msg.content && msg.content.evalue) {
637637
let resultStr = msg.content.evalue;
638638
//t.match(/\[Errno [0-9]+?\] (.*)/)[1]
639639
// get error message from traceback

visualpython/js/com/component/InstanceEditor.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,15 @@ define([
349349
// add targetid as state if exists
350350
if (targetId) {
351351
popupState[targetId] = targetCode;
352+
that.state[targetId] = targetCode;
353+
}
354+
if (that.optionPopup) {
355+
that.optionPopup.remove();
356+
that.optionPopup = null;
352357
}
353358
that.optionPopup = new LibraryComponent(popupState,
354359
{
355360
pageThis: that,
356-
useInputVariable: true,
357361
targetSelector: that.pageThis.wrapSelector('#' + that.targetId),
358362

359363
finish: function(code) {
@@ -554,16 +558,5 @@ define([
554558
}
555559
}
556560

557-
558-
559-
560-
561-
562-
563-
564-
565-
566-
567-
568561
return InstanceEditor;
569562
})

visualpython/js/com/component/MultiSelector.js

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,37 +89,45 @@ define([
8989
this.dataList = dataList; // [ { value, code, type }, ... ]
9090
this.pointer = { start: -1, end: -1 };
9191

92+
this.loadDataList();
93+
}
94+
95+
render() {
96+
;
97+
}
98+
99+
loadDataList() {
92100
var that = this;
93101

94-
if (mode !== 'variable' && mode !== 'data') {
95-
if (parent == null || parent === '' || (Array.isArray(parent) && parent.length == 0)) {
102+
if (this.mode !== 'variable' && this.mode !== 'data') {
103+
if (this.parent == null || this.parent === '' || (Array.isArray(this.parent) && this.parent.length == 0)) {
96104
this._executeCallback([]);
97105
return;
98106
}
99107
}
100-
switch (mode) {
108+
switch (this.mode) {
101109
case 'columns':
102-
this._getColumnList(parent, function(dataList) {
110+
this._getColumnList(this.parent, function(dataList) {
103111
that._executeCallback(dataList);
104112
});
105113
break;
106114
case 'variable':
107-
this._getVariableList(type, function(dataList) {
115+
this._getVariableList(this.type, function(dataList) {
108116
that._executeCallback(dataList);
109117
});
110118
break;
111119
case 'index':
112-
this._getRowList(parent, function(dataList) {
120+
this._getRowList(this.parent, function(dataList) {
113121
that._executeCallback(dataList);
114122
});
115123
break;
116124
case 'ndarray0':
117-
this._getNdarray(parent, 0, function(dataList) {
125+
this._getNdarray(this.parent, 0, function(dataList) {
118126
that._executeCallback(dataList);
119127
});
120128
break;
121129
case 'ndarray1':
122-
this._getNdarray(parent, 1, function(dataList) {
130+
this._getNdarray(this.parent, 1, function(dataList) {
123131
that._executeCallback(dataList);
124132
});
125133
break;
@@ -129,10 +137,6 @@ define([
129137
}
130138
}
131139

132-
// render() {
133-
// ;
134-
// }
135-
136140
_executeCallback(dataList) {
137141
if (this.includeList && this.includeList.length > 0) {
138142
dataList = dataList.filter(data => this.includeList.includes(data.code));
@@ -260,7 +264,7 @@ define([
260264
}
261265

262266
load() {
263-
$(this.frameSelector).html(this.render());
267+
$(this.frameSelector).html(this.templateForMultiSelector());
264268
this.bindEvent();
265269
this.bindDraggable();
266270
this._bindItemClickEvent();
@@ -282,7 +286,7 @@ define([
282286
return dataList;
283287
}
284288

285-
render() {
289+
templateForMultiSelector() {
286290
var that = this;
287291

288292
var tag = new com_String();
@@ -341,6 +345,7 @@ define([
341345
tag.appendLine('<div class="vp-cs-add-item-btn vp-icon-plus"></div>');
342346
}
343347
tag.appendLine('</div>'); // APP_SELECT_RIGHT
348+
tag.appendLine('<span class="vp-cs-refresh vp-icon-refresh" title="Clear and Re-load this list"></span>');
344349
tag.appendLine('</div>'); // APP_SELECT_CONTAINER
345350
return tag.toString();
346351
}
@@ -525,6 +530,11 @@ define([
525530
}
526531
});
527532

533+
// refresh
534+
$(this.wrapSelector('.vp-cs-refresh')).on('click', function(event) {
535+
that.loadDataList();
536+
});
537+
528538
this._bindItemClickEvent();
529539
}
530540

visualpython/js/com/component/PopupComponent.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,26 @@ define([
484484
break;
485485
case 'show-detail':
486486
$(that.wrapSelector('.vp-popup-run-detailbox')).show();
487+
// set run button
488+
vpConfig.getData('runType', 'vpcfg').then(function(data) {
489+
vpLog.display(VP_LOG_TYPE.DEVELOP, 'Runtype get data', data);
490+
if (data == undefined || data == null || data === '') {
491+
data = 'run'; // default = run
492+
}
493+
that.config.runType = data;
494+
$(that.wrapSelector(`.vp-popup-run-type[value="${data}"]`)).prop('checked', true);
495+
$(that.wrapSelector('.vp-popup-run-button')).attr('data-type', data);
496+
let runTitle = 'Run code';
497+
switch (data) {
498+
case 'run-save':
499+
runTitle = 'Save to block & Run code';
500+
break;
501+
case 'add':
502+
runTitle = 'Add code to cell';
503+
break;
504+
}
505+
$(that.wrapSelector('.vp-popup-run-button')).prop('title', runTitle);
506+
});
487507
evt.stopPropagation();
488508
break;
489509
case 'save':
@@ -729,7 +749,7 @@ define([
729749
let that = this;
730750
vpConfig.getData('runType', 'vpcfg').then(function(data) {
731751
vpLog.display(VP_LOG_TYPE.DEVELOP, 'Runtype get data', data);
732-
if (data == null || data === '') {
752+
if (data == undefined || data == null || data === '') {
733753
data = 'run'; // default = run
734754
}
735755
that.config.runType = data;

0 commit comments

Comments
 (0)