diff --git a/data/m_library/pandasLibrary.js b/data/m_library/pandasLibrary.js index d1f38172..50d0d173 100644 --- a/data/m_library/pandasLibrary.js +++ b/data/m_library/pandasLibrary.js @@ -160,6 +160,11 @@ define([ component: 'option_suggest', options: ['None', '0'] }, + { + name: 'delimiter', + type: 'text', + label: 'Delimiter' + }, { name: 'sep', type: 'text', diff --git a/js/m_apps/File.js b/js/m_apps/File.js index 3ae75c07..ba2d3da8 100644 --- a/js/m_apps/File.js +++ b/js/m_apps/File.js @@ -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 */ //============================================================================ @@ -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(); @@ -157,7 +163,7 @@ define([ that.renderPage(pageType); that._bindEventByType(pageType); }); - + // open file navigation $(this.wrapSelector(prefix + '#vp_openFileNavigationBtn')).click(function() { @@ -165,10 +171,10 @@ define([ 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; @@ -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(''); @@ -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(); @@ -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') { @@ -394,6 +402,8 @@ define([ name: 'fileType', type: 'var' }); + + var result = pdGen.vp_codeGenerator(this.uuid + ' #vp_fileWrite', thisPkg, userOption.toString()); sbCode.append(result); }