Skip to content

Add 'tsv' file on File.js options #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/m_library/pandasLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ define([
component: 'option_suggest',
options: ['None', '0']
},
{
name: 'delimiter',
type: 'text',
label: 'Delimiter'
},
{
name: 'sep',
type: 'text',
Expand Down
24 changes: 17 additions & 7 deletions js/m_apps/File.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Note : Apps > File
* License : GNU GPLv3 with Visual Python special exception
* Date : 2021. 11. 18
* Change Date :
* Change Date : 2022. 09. 03
*/

//============================================================================
Expand Down Expand Up @@ -147,7 +147,13 @@ define([
_bindEventByType(pageType) {
var that = this;
var prefix = '#vp_file' + pageType + ' ';

var fileExtensionArr = [that.state.fileExtension];

// add tsv dsv ssv extension to csv option
if(that.state.fileExtension === 'csv'){
fileExtensionArr = fileExtensionArr.concat(['tsv', 'dsv', 'ssv']);
}

// select file type
$(this.wrapSelector(prefix + '#fileType')).change(function() {
var value = $(this).val();
Expand All @@ -157,18 +163,18 @@ define([
that.renderPage(pageType);
that._bindEventByType(pageType);
});

// open file navigation
$(this.wrapSelector(prefix + '#vp_openFileNavigationBtn')).click(function() {

let type = 'save';
if (pageType == 'Read') {
type = 'open';
}

let fileNavi = new FileNavigation({
type: type,
extensions: [ that.state.fileExtension ],
extensions: fileExtensionArr,
finish: function(filesPath, status, error) {
let {file, path} = filesPath[0];
that.state.selectedFile = file;
Expand Down Expand Up @@ -244,7 +250,7 @@ define([
renderPage(pageType) {
var that = this;
var prefix = '#vp_file' + pageType + ' ';

// clear
$(this.wrapSelector(prefix + '#vp_inputOutputBox table tbody')).html('');
$(this.wrapSelector(prefix + '#vp_optionBox table tbody')).html('');
Expand Down Expand Up @@ -368,7 +374,7 @@ define([
var sbCode = new com_String;

this.saveState();

var prefix = '#vp_file' + pageType + ' ';
var userOption = new com_String();
var userOptValue = $(this.wrapSelector(prefix + '#userOption')).val();
Expand All @@ -386,6 +392,8 @@ define([
name: 'fileType',
type: 'var'
});


var result = pdGen.vp_codeGenerator(this.uuid + ' #vp_fileRead', thisPkg, userOption.toString());
sbCode.append(result);
} else if (pageType == 'Write') {
Expand All @@ -394,6 +402,8 @@ define([
name: 'fileType',
type: 'var'
});


var result = pdGen.vp_codeGenerator(this.uuid + ' #vp_fileWrite', thisPkg, userOption.toString());
sbCode.append(result);
}
Expand Down