<commit_before>enyo.kind({
	name: "Harmonia",
	kind: "FittableColumns",
	handlers: {
		onSelect: "newSelect",
		onDeselect: "newDeselect",
	},
	components: [
	    {name: "provideList", kind: "ProviderList", onSelectProvider: "selectProvider"},
		{kind: "HermesFileTree", fit: true, onFileClick: "selectFile", onFolderClick: "selectFolder", 
			onNewFileConfirm: "newFileConfirm", onNewFolderConfirm: "newFolderConfirm", 
			onRenameConfirm: "renameConfirm", onDeleteConfirm: "deleteConfirm",
			onCopyFileConfirm: "copyFileConfirm"}
	],
	providerListNeeded: true,
	create: function() {
		this.inherited(arguments);
		// TODO provider list should probably go out of Harmonia
		if (this.providerListNeeded === false) {
			this.$.provideList.setShowing(false);
		}
	},
	selectProvider: function(inSender, inInfo) {
		//this.log("service='"+JSON.stringify(inInfo.service)+"'");
		// super hack
		var auth = inInfo.service ? inInfo.service.auth : null;
		var url = inInfo.service ? inInfo.service.url : null;
		var jsonp = inInfo.service ? inInfo.service.useJsonp : false;

		//this.log("service: auth: "+auth+" url: "+url+" jsonp: "+jsonp);
		var serviceObj = {
			auth: auth,
			url: url,
			jsonp: jsonp
		};
		this.$.hermesFileTree.setConfig({service: serviceObj});
		this.$.hermesFileTree.reset();
		this.$.hermesFileTree.fileOps2Hide(true);
	},
	setConfig: function(config) {
		console.dir(config);
		this.$.hermesFileTree.setConfig(config);
		if (config !== null) {
			this.$.hermesFileTree.getSubFileView(config.firstNodeName, config.folderId);
			this.$.hermesFileTree.fileOps2Show();		
		} else this.$.hermesFileTree.reset();
	},
	//TODO: How much of the file manipulation code lives here, vs. in HermesFileTree?
	selectFile: function(inSender, inEvent) {
		console.log("Selected file: "+inEvent.file.path);
		console.dir(inEvent.file);
	},
	selectFolder: function(inSender, inEvent) {
		console.log("Selected folder: "+inEvent.file.path);
		console.dir(inEvent.file);
	},
	newSelect: function(inSender, inEvent) {
		if (inSender.name !== "providerList") {
			this.selectedFile=inEvent.file;
		}
	},
	newDeselect: function(inSender, inEvent) {
		this.selectedFile=inEvent.file;
	},
	// File Operations
	newFileConfirm: function(inSender, inEvent) {
		var folderId = inEvent.folderId;
		var name = inEvent.fileName.trim();
		var nameStem = name.substring(0, name.lastIndexOf("."));
		var type = name.substring(name.lastIndexOf(".")+1);<commit_msg>ENYO-1115 HermesFileTree should display only allowed actions<commit_after>enyo.kind({
	name: "Harmonia",
	kind: "FittableColumns",
	handlers: {
		onSelect: "newSelect",
		onDeselect: "newDeselect",
	},
	components: [
	    {name: "provideList", kind: "ProviderList", onSelectProvider: "selectProvider"},
		{kind: "HermesFileTree", fit: true, onFileClick: "selectFile", onFolderClick: "selectFolder", 
			onNewFileConfirm: "newFileConfirm", onNewFolderConfirm: "newFolderConfirm", 
			onRenameConfirm: "renameConfirm", onDeleteConfirm: "deleteConfirm",
			onCopyFileConfirm: "copyFileConfirm"}
	],
	providerListNeeded: true,
	create: function() {
		this.inherited(arguments);
		// TODO provider list should probably go out of Harmonia
		if (this.providerListNeeded === false) {
			this.$.provideList.setShowing(false);
		}
	},
	selectProvider: function(inSender, inInfo) {
		//this.log("service='"+JSON.stringify(inInfo.service)+"'");
		// super hack
		var auth = inInfo.service ? inInfo.service.auth : null;
		var url = inInfo.service ? inInfo.service.url : null;
		var jsonp = inInfo.service ? inInfo.service.useJsonp : false;

		//this.log("service: auth: "+auth+" url: "+url+" jsonp: "+jsonp);
		var serviceObj = {
			auth: auth,
			url: url,
			jsonp: jsonp
		};
		this.$.hermesFileTree.setConfig({service: serviceObj});
		this.$.hermesFileTree.reset();
		this.$.hermesFileTree.fileOps2Hide(true);
	},
	setConfig: function(config) {
		console.dir(config);
		this.$.hermesFileTree.setConfig(config);
		if (config !== null) {
			this.$.hermesFileTree.getSubFileView(config.firstNodeName, config.folderId);
			this.$.hermesFileTree.fileOps2Show();		
		} else {
			this.$.hermesFileTree.reset();
			this.$.hermesFileTree.fileOps2Hide(true);
		}
	},
	//TODO: How much of the file manipulation code lives here, vs. in HermesFileTree?
	selectFile: function(inSender, inEvent) {
		console.log("Selected file: "+inEvent.file.path);
		console.dir(inEvent.file);
	},
	selectFolder: function(inSender, inEvent) {
		console.log("Selected folder: "+inEvent.file.path);
		console.dir(inEvent.file);
	},
	newSelect: function(inSender, inEvent) {
		if (inSender.name !== "providerList") {
			this.selectedFile=inEvent.file;
		}
	},
	newDeselect: function(inSender, inEvent) {
		this.selectedFile=inEvent.file;
	},
	// File Operations
	newFileConfirm: function(inSender, inEvent) {
		var folderId = inEvent.folderId;
		var name = inEvent.fileName.trim();
		var nameStem = name.substring(0, name.lastIndexOf("."));
		var type = name.substring(name.lastIndexOf(".")+1);
{'fraction_non_alphanumeric': 0.1543074155506696, 'fraction_numerical': 0.002598440935438737, 'mean_word_length': 4.845794392523365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1851028', 'n_tokens_mistral': 1827, 'n_tokens_neox': 1709, 'n_words': 328}