[yt-svn] commit/yt: 5 new changesets
Bitbucket
commits-noreply at bitbucket.org
Fri May 25 17:48:08 PDT 2012
5 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/4fbda31669a8/
changeset: 4fbda31669a8
branch: yt
user: MatthewTurk
date: 2012-05-24 08:45:56
summary: First portion of a File Open in Reason.
affected #: 3 files
diff -r d9fd498edfe2b42e4c6fc062106014352e527736 -r 4fbda31669a82d75490cbfe3f6af9e3bd5c25fc2 yt/gui/reason/extdirect_repl.py
--- a/yt/gui/reason/extdirect_repl.py
+++ b/yt/gui/reason/extdirect_repl.py
@@ -26,6 +26,7 @@
import json
import os
+import stat
import cStringIO
import logging
import uuid
@@ -459,6 +460,27 @@
return command
@lockit
+ def file_listing(self, base_dir, sub_dir):
+ if base_dir == "":
+ cur_dir = os.getcwd()
+ elif sub_dir == "":
+ cur_dir = base_dir
+ else:
+ cur_dir = os.path.join(base_dir, sub_dir)
+ fns = os.listdir(cur_dir)
+ results = []
+ for fn in sorted(fns):
+ if not os.access(fn, os.R_OK): continue
+ if os.path.isfile(fn):
+ size = os.path.getsize(fn)
+ t = "file"
+ else:
+ size = 0
+ t = "directory"
+ results.append((fn, size, t))
+ return dict(objs = results, cur_dir=cur_dir)
+
+ @lockit
def create_phase(self, objname, field_x, field_y, field_z, weight):
if weight == "None": weight = None
else: weight = "'%s'" % (weight)
diff -r d9fd498edfe2b42e4c6fc062106014352e527736 -r 4fbda31669a82d75490cbfe3f6af9e3bd5c25fc2 yt/gui/reason/html/index.html
--- a/yt/gui/reason/html/index.html
+++ b/yt/gui/reason/html/index.html
@@ -103,6 +103,9 @@
<script type="text/javascript" src="js/menu_items.js"></script><!-- THE PLOT WINDOW FUNCTIONS -->
+ <script type="text/javascript" src="js/file_open.js"></script>
+
+ <!-- THE PLOT WINDOW FUNCTIONS --><script type="text/javascript" src="js/widget_plotwindow.js"></script><!-- THE GRID VIEWER FUNCTIONS -->
diff -r d9fd498edfe2b42e4c6fc062106014352e527736 -r 4fbda31669a82d75490cbfe3f6af9e3bd5c25fc2 yt/gui/reason/html/js/file_open.js
--- /dev/null
+++ b/yt/gui/reason/html/js/file_open.js
@@ -0,0 +1,81 @@
+/**********************************************************************
+A file opener
+
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: Columbia University
+Homepage: http://yt-project.org/
+License:
+ Copyright (C) 2012 Matthew Turk. All Rights Reserved.
+
+ This file is part of yt.
+
+ yt is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+***********************************************************************/
+
+function open_file() {
+ var filestore = new Ext.data.ArrayStore({
+ fields: ['filename',
+ {name:'size', type:'float'},
+ 'type'
+ ]
+ });
+
+ function fillStore(f, a){
+ if(a.status == false){
+ Ext.Msg.alert("Error", "Something has gone wrong.");
+ examine = {f: f, a: a};
+ return;
+ }
+ examine = a;
+ filestore.removeAll();
+ var rec = [];
+ filestore.loadData(a.result['objs']);
+ }
+
+ var win = new Ext.Window({
+ layout:'fit',
+ width:480,
+ height:320,
+ modal:true,
+ resizable:true,
+ draggable:true,
+ border:false,
+ title:'Open File',
+ items: [
+ { xtype:'listview',
+ store: filestore ,
+ emptyText: 'No images to display',
+ columns: [
+ {
+ header: 'Type',
+ width: 0.1,
+ dataIndex: 'type'
+ },{
+ header: 'Filename',
+ width: .75,
+ dataIndex: 'filename'
+ },{
+ header: 'Size',
+ dataIndex: 'size',
+ tpl: '{size:fileSize}',
+ align: 'right',
+ cls: 'listview-filesize'
+ }]
+ },
+ ]
+ });
+ yt_rpc.ExtDirectREPL.file_listing(
+ {base_dir:"", sub_dir:""}, fillStore);
+ win.show(this);
+}
https://bitbucket.org/yt_analysis/yt/changeset/f1cb9a3bb222/
changeset: f1cb9a3bb222
branch: yt
user: MatthewTurk
date: 2012-05-24 10:42:00
summary: Additional functions to make load mostly work. The text field and the buttons
need to be handled still.
affected #: 5 files
diff -r 4fbda31669a82d75490cbfe3f6af9e3bd5c25fc2 -r f1cb9a3bb2225aa4d33979d677f80cc816518263 yt/gui/reason/extdirect_repl.py
--- a/yt/gui/reason/extdirect_repl.py
+++ b/yt/gui/reason/extdirect_repl.py
@@ -460,6 +460,12 @@
return command
@lockit
+ def load(self, base_dir, filename):
+ pp = os.path.join(base_dir, filename)
+ funccall = "pfs.append(load('%s'))" % pp
+ self.execute(funccall)
+ return []
+
def file_listing(self, base_dir, sub_dir):
if base_dir == "":
cur_dir = os.getcwd()
@@ -467,9 +473,10 @@
cur_dir = base_dir
else:
cur_dir = os.path.join(base_dir, sub_dir)
+ cur_dir = os.path.abspath(cur_dir)
fns = os.listdir(cur_dir)
- results = []
- for fn in sorted(fns):
+ results = [("..", 0, "directory")]
+ for fn in sorted((os.path.join(cur_dir, f) for f in fns)):
if not os.access(fn, os.R_OK): continue
if os.path.isfile(fn):
size = os.path.getsize(fn)
@@ -477,7 +484,7 @@
else:
size = 0
t = "directory"
- results.append((fn, size, t))
+ results.append((os.path.basename(fn), size, t))
return dict(objs = results, cur_dir=cur_dir)
@lockit
diff -r 4fbda31669a82d75490cbfe3f6af9e3bd5c25fc2 -r f1cb9a3bb2225aa4d33979d677f80cc816518263 yt/gui/reason/html/index.html
--- a/yt/gui/reason/html/index.html
+++ b/yt/gui/reason/html/index.html
@@ -78,7 +78,8 @@
<!-- FONTS --><!-- These will get pulled from Google, but Google might not be accessible.
In that case, it will default to whatever is in the family. -->
- <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Inconsolata">
+ <!--<link rel="stylesheet" type="text/css"
+ href="http://fonts.googleapis.com/css?family=Inconsolata">--><!-- LEAFLET STUFF --><script type="text/javascript" src="leaflet/leaflet.js"></script>
diff -r 4fbda31669a82d75490cbfe3f6af9e3bd5c25fc2 -r f1cb9a3bb2225aa4d33979d677f80cc816518263 yt/gui/reason/html/js/file_open.js
--- a/yt/gui/reason/html/js/file_open.js
+++ b/yt/gui/reason/html/js/file_open.js
@@ -30,36 +30,46 @@
'type'
]
});
-
+ var cur_dir;
function fillStore(f, a){
if(a.status == false){
Ext.Msg.alert("Error", "Something has gone wrong.");
- examine = {f: f, a: a};
return;
}
- examine = a;
filestore.removeAll();
var rec = [];
filestore.loadData(a.result['objs']);
+ cur_dir = a.result['cur_dir'];
+ win.get("current_file").setValue(cur_dir);
}
var win = new Ext.Window({
- layout:'fit',
- width:480,
- height:320,
+ layout:'vbox',
+ layoutConfig: {
+ align: 'stretch',
+ pack: 'start',
+ defaultMargins: "5px 5px 5px 5px",
+ },
+ width:540,
+ height:480,
modal:true,
resizable:true,
draggable:true,
- border:false,
title:'Open File',
items: [
- { xtype:'listview',
+ { xtype: 'textfield',
+ id: 'current_file',
+ }, {
+ xtype:'listview',
store: filestore ,
+ singleSelect:true,
emptyText: 'No images to display',
+ flex: 1.0,
columns: [
{
header: 'Type',
width: 0.1,
+ tpl: '<img src="images/file_dialog_{type}.png" width=16 height=16>',
dataIndex: 'type'
},{
header: 'Filename',
@@ -71,9 +81,39 @@
tpl: '{size:fileSize}',
align: 'right',
cls: 'listview-filesize'
- }]
+ }],
+ listeners: {
+ dblclick: function(view, index, node, e) {
+ var fileRecord = filestore.getAt(index).data;
+ if (fileRecord.type == 'directory') {
+ yt_rpc.ExtDirectREPL.file_listing(
+ {base_dir:cur_dir, sub_dir:fileRecord.filename},
+ fillStore);
+ } else {
+ yt_rpc.ExtDirectREPL.load(
+ {base_dir:cur_dir, filename:fileRecord.filename},
+ handle_result);
+ win.destroy();
+ }
+ },
+ selectionchange: function(view, index, node, e) {
+ },
+ },
+ }, {
+ xtype: 'panel',
+ height: 40,
+ layout: 'hbox',
+ layoutConfig: {
+ align: 'stretch',
+ pack: 'start',
+ defaultMargins: "5px 5px 5px 5px",
+ },
+ items: [
+ { flex: 1.0, xtype: 'button', text: 'Cancel' },
+ { flex: 1.0, xtype: 'button', text: 'Load' },
+ ],
},
- ]
+ ],
});
yt_rpc.ExtDirectREPL.file_listing(
{base_dir:"", sub_dir:""}, fillStore);
diff -r 4fbda31669a82d75490cbfe3f6af9e3bd5c25fc2 -r f1cb9a3bb2225aa4d33979d677f80cc816518263 yt/gui/reason/html/js/menu_items.js
--- a/yt/gui/reason/html/js/menu_items.js
+++ b/yt/gui/reason/html/js/menu_items.js
@@ -33,7 +33,11 @@
text: 'Menu',
id: 'main_menu',
menu: [
- {xtype:'menuitem', text: 'Open', disabled: true},
+ {xtype:'menuitem', text: 'Open File',
+ handler: function(b,e) {
+ open_file()
+ },
+ },
{xtype:'menuitem', text: 'Open Directory', disabled: true},
{xtype: 'menuseparator'},
{xtype:'menuitem', text: 'Save Script',
diff -r 4fbda31669a82d75490cbfe3f6af9e3bd5c25fc2 -r f1cb9a3bb2225aa4d33979d677f80cc816518263 yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -1322,12 +1322,12 @@
from yt.gui.reason.bottle_mods import uuid_serve_functions, PayloadHandler
hr = ExtDirectREPL(base_extjs_path)
hr.debug = PayloadHandler.debug = args.debug
+ command_line = ["pfs = []"]
if args.find:
# We just have to find them and store references to them.
- command_line = ["pfs = []"]
for fn in sorted(glob.glob("*/*.hierarchy")):
command_line.append("pfs.append(load('%s'))" % fn[:-10])
- hr.execute("\n".join(command_line))
+ hr.execute("\n".join(command_line))
bottle.debug()
uuid_serve_functions(open_browser=args.open_browser,
port=int(args.port), repl=hr)
https://bitbucket.org/yt_analysis/yt/changeset/4ee4192efd25/
changeset: 4ee4192efd25
branch: yt
user: MatthewTurk
date: 2012-05-24 11:01:52
summary: File open menu item now mostly works.
affected #: 4 files
diff -r f1cb9a3bb2225aa4d33979d677f80cc816518263 -r 4ee4192efd2532562729d774dd68e8f56b9f5634 yt/gui/reason/extdirect_repl.py
--- a/yt/gui/reason/extdirect_repl.py
+++ b/yt/gui/reason/extdirect_repl.py
@@ -474,6 +474,8 @@
else:
cur_dir = os.path.join(base_dir, sub_dir)
cur_dir = os.path.abspath(cur_dir)
+ if not os.path.isdir(cur_dir):
+ return {'change':False}
fns = os.listdir(cur_dir)
results = [("..", 0, "directory")]
for fn in sorted((os.path.join(cur_dir, f) for f in fns)):
diff -r f1cb9a3bb2225aa4d33979d677f80cc816518263 -r 4ee4192efd2532562729d774dd68e8f56b9f5634 yt/gui/reason/html/images/file_dialog_directory.png
Binary file yt/gui/reason/html/images/file_dialog_directory.png has changed
diff -r f1cb9a3bb2225aa4d33979d677f80cc816518263 -r 4ee4192efd2532562729d774dd68e8f56b9f5634 yt/gui/reason/html/images/file_dialog_file.png
Binary file yt/gui/reason/html/images/file_dialog_file.png has changed
diff -r f1cb9a3bb2225aa4d33979d677f80cc816518263 -r 4ee4192efd2532562729d774dd68e8f56b9f5634 yt/gui/reason/html/js/file_open.js
--- a/yt/gui/reason/html/js/file_open.js
+++ b/yt/gui/reason/html/js/file_open.js
@@ -36,6 +36,10 @@
Ext.Msg.alert("Error", "Something has gone wrong.");
return;
}
+ if(a.result['change'] == false) {
+ win.get("current_file").setValue(cur_dir);
+ return;
+ }
filestore.removeAll();
var rec = [];
filestore.loadData(a.result['objs']);
@@ -59,8 +63,16 @@
items: [
{ xtype: 'textfield',
id: 'current_file',
+ listeners: {
+ specialkey: function(f, e) {
+ if (e.getKey() != e.ENTER) { return; }
+ yt_rpc.ExtDirectREPL.file_listing(
+ {base_dir:f.getValue(), sub_dir:''}, fillStore);
+ }
+ }
}, {
xtype:'listview',
+ id: 'file_listing',
store: filestore ,
singleSelect:true,
emptyText: 'No images to display',
@@ -109,8 +121,21 @@
defaultMargins: "5px 5px 5px 5px",
},
items: [
- { flex: 1.0, xtype: 'button', text: 'Cancel' },
- { flex: 1.0, xtype: 'button', text: 'Load' },
+ { flex: 1.0, xtype: 'button', text: 'Cancel',
+ handler: function(b, e) { win.destroy(); } },
+ { flex: 1.0, xtype: 'button', text: 'Load',
+ handler: function(b, e) {
+ filename = "";
+ var fl = win.get("file_listing");
+ if (fl.getSelectionCount() == 1) {
+ filename = fl.getSelectedRecords()[0].data.filename;
+ }
+ yt_rpc.ExtDirectREPL.load(
+ {base_dir:cur_dir, filename:filename},
+ handle_result);
+ win.destroy();
+ }
+ },
],
},
],
https://bitbucket.org/yt_analysis/yt/changeset/a68c5073441c/
changeset: a68c5073441c
branch: yt
user: MatthewTurk
date: 2012-05-25 23:07:45
summary: Reducing the thread deadlock timeout.
affected #: 1 file
diff -r 4ee4192efd2532562729d774dd68e8f56b9f5634 -r a68c5073441cac987e2bd08b446ac0fa607c8f23 yt/gui/reason/extdirect_repl.py
--- a/yt/gui/reason/extdirect_repl.py
+++ b/yt/gui/reason/extdirect_repl.py
@@ -277,7 +277,7 @@
for i in range(30):
# Check for stop
if self.stopped: return {'type':'shutdown'} # No race condition
- if self.payload_handler.event.wait(1): # One second timeout
+ if self.payload_handler.event.wait(0.01): # One second timeout
return self.payload_handler.deliver_payloads()
if self.debug: print "### Heartbeat ... finished: %s" % (time.ctime())
return []
https://bitbucket.org/yt_analysis/yt/changeset/6a10d998272e/
changeset: 6a10d998272e
branch: yt
user: ngoldbaum
date: 2012-05-26 02:48:06
summary: Merged in MatthewTurk/yt (pull request #161)
affected #: 7 files
diff -r eef0ecf484eb4669591a6e3ff5b3950e19981767 -r 6a10d998272e8cc720768f5882392e7fac683ffe yt/gui/reason/extdirect_repl.py
--- a/yt/gui/reason/extdirect_repl.py
+++ b/yt/gui/reason/extdirect_repl.py
@@ -26,6 +26,7 @@
import json
import os
+import stat
import cStringIO
import logging
import uuid
@@ -276,7 +277,7 @@
for i in range(30):
# Check for stop
if self.stopped: return {'type':'shutdown'} # No race condition
- if self.payload_handler.event.wait(1): # One second timeout
+ if self.payload_handler.event.wait(0.01): # One second timeout
return self.payload_handler.deliver_payloads()
if self.debug: print "### Heartbeat ... finished: %s" % (time.ctime())
return []
@@ -459,6 +460,36 @@
return command
@lockit
+ def load(self, base_dir, filename):
+ pp = os.path.join(base_dir, filename)
+ funccall = "pfs.append(load('%s'))" % pp
+ self.execute(funccall)
+ return []
+
+ def file_listing(self, base_dir, sub_dir):
+ if base_dir == "":
+ cur_dir = os.getcwd()
+ elif sub_dir == "":
+ cur_dir = base_dir
+ else:
+ cur_dir = os.path.join(base_dir, sub_dir)
+ cur_dir = os.path.abspath(cur_dir)
+ if not os.path.isdir(cur_dir):
+ return {'change':False}
+ fns = os.listdir(cur_dir)
+ results = [("..", 0, "directory")]
+ for fn in sorted((os.path.join(cur_dir, f) for f in fns)):
+ if not os.access(fn, os.R_OK): continue
+ if os.path.isfile(fn):
+ size = os.path.getsize(fn)
+ t = "file"
+ else:
+ size = 0
+ t = "directory"
+ results.append((os.path.basename(fn), size, t))
+ return dict(objs = results, cur_dir=cur_dir)
+
+ @lockit
def create_phase(self, objname, field_x, field_y, field_z, weight):
if weight == "None": weight = None
else: weight = "'%s'" % (weight)
diff -r eef0ecf484eb4669591a6e3ff5b3950e19981767 -r 6a10d998272e8cc720768f5882392e7fac683ffe yt/gui/reason/html/images/file_dialog_directory.png
Binary file yt/gui/reason/html/images/file_dialog_directory.png has changed
diff -r eef0ecf484eb4669591a6e3ff5b3950e19981767 -r 6a10d998272e8cc720768f5882392e7fac683ffe yt/gui/reason/html/images/file_dialog_file.png
Binary file yt/gui/reason/html/images/file_dialog_file.png has changed
diff -r eef0ecf484eb4669591a6e3ff5b3950e19981767 -r 6a10d998272e8cc720768f5882392e7fac683ffe yt/gui/reason/html/index.html
--- a/yt/gui/reason/html/index.html
+++ b/yt/gui/reason/html/index.html
@@ -78,7 +78,8 @@
<!-- FONTS --><!-- These will get pulled from Google, but Google might not be accessible.
In that case, it will default to whatever is in the family. -->
- <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Inconsolata">
+ <!--<link rel="stylesheet" type="text/css"
+ href="http://fonts.googleapis.com/css?family=Inconsolata">--><!-- LEAFLET STUFF --><script type="text/javascript" src="leaflet/leaflet.js"></script>
@@ -103,6 +104,9 @@
<script type="text/javascript" src="js/menu_items.js"></script><!-- THE PLOT WINDOW FUNCTIONS -->
+ <script type="text/javascript" src="js/file_open.js"></script>
+
+ <!-- THE PLOT WINDOW FUNCTIONS --><script type="text/javascript" src="js/widget_plotwindow.js"></script><!-- THE GRID VIEWER FUNCTIONS -->
diff -r eef0ecf484eb4669591a6e3ff5b3950e19981767 -r 6a10d998272e8cc720768f5882392e7fac683ffe yt/gui/reason/html/js/file_open.js
--- /dev/null
+++ b/yt/gui/reason/html/js/file_open.js
@@ -0,0 +1,146 @@
+/**********************************************************************
+A file opener
+
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: Columbia University
+Homepage: http://yt-project.org/
+License:
+ Copyright (C) 2012 Matthew Turk. All Rights Reserved.
+
+ This file is part of yt.
+
+ yt is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+***********************************************************************/
+
+function open_file() {
+ var filestore = new Ext.data.ArrayStore({
+ fields: ['filename',
+ {name:'size', type:'float'},
+ 'type'
+ ]
+ });
+ var cur_dir;
+ function fillStore(f, a){
+ if(a.status == false){
+ Ext.Msg.alert("Error", "Something has gone wrong.");
+ return;
+ }
+ if(a.result['change'] == false) {
+ win.get("current_file").setValue(cur_dir);
+ return;
+ }
+ filestore.removeAll();
+ var rec = [];
+ filestore.loadData(a.result['objs']);
+ cur_dir = a.result['cur_dir'];
+ win.get("current_file").setValue(cur_dir);
+ }
+
+ var win = new Ext.Window({
+ layout:'vbox',
+ layoutConfig: {
+ align: 'stretch',
+ pack: 'start',
+ defaultMargins: "5px 5px 5px 5px",
+ },
+ width:540,
+ height:480,
+ modal:true,
+ resizable:true,
+ draggable:true,
+ title:'Open File',
+ items: [
+ { xtype: 'textfield',
+ id: 'current_file',
+ listeners: {
+ specialkey: function(f, e) {
+ if (e.getKey() != e.ENTER) { return; }
+ yt_rpc.ExtDirectREPL.file_listing(
+ {base_dir:f.getValue(), sub_dir:''}, fillStore);
+ }
+ }
+ }, {
+ xtype:'listview',
+ id: 'file_listing',
+ store: filestore ,
+ singleSelect:true,
+ emptyText: 'No images to display',
+ flex: 1.0,
+ columns: [
+ {
+ header: 'Type',
+ width: 0.1,
+ tpl: '<img src="images/file_dialog_{type}.png" width=16 height=16>',
+ dataIndex: 'type'
+ },{
+ header: 'Filename',
+ width: .75,
+ dataIndex: 'filename'
+ },{
+ header: 'Size',
+ dataIndex: 'size',
+ tpl: '{size:fileSize}',
+ align: 'right',
+ cls: 'listview-filesize'
+ }],
+ listeners: {
+ dblclick: function(view, index, node, e) {
+ var fileRecord = filestore.getAt(index).data;
+ if (fileRecord.type == 'directory') {
+ yt_rpc.ExtDirectREPL.file_listing(
+ {base_dir:cur_dir, sub_dir:fileRecord.filename},
+ fillStore);
+ } else {
+ yt_rpc.ExtDirectREPL.load(
+ {base_dir:cur_dir, filename:fileRecord.filename},
+ handle_result);
+ win.destroy();
+ }
+ },
+ selectionchange: function(view, index, node, e) {
+ },
+ },
+ }, {
+ xtype: 'panel',
+ height: 40,
+ layout: 'hbox',
+ layoutConfig: {
+ align: 'stretch',
+ pack: 'start',
+ defaultMargins: "5px 5px 5px 5px",
+ },
+ items: [
+ { flex: 1.0, xtype: 'button', text: 'Cancel',
+ handler: function(b, e) { win.destroy(); } },
+ { flex: 1.0, xtype: 'button', text: 'Load',
+ handler: function(b, e) {
+ filename = "";
+ var fl = win.get("file_listing");
+ if (fl.getSelectionCount() == 1) {
+ filename = fl.getSelectedRecords()[0].data.filename;
+ }
+ yt_rpc.ExtDirectREPL.load(
+ {base_dir:cur_dir, filename:filename},
+ handle_result);
+ win.destroy();
+ }
+ },
+ ],
+ },
+ ],
+ });
+ yt_rpc.ExtDirectREPL.file_listing(
+ {base_dir:"", sub_dir:""}, fillStore);
+ win.show(this);
+}
diff -r eef0ecf484eb4669591a6e3ff5b3950e19981767 -r 6a10d998272e8cc720768f5882392e7fac683ffe yt/gui/reason/html/js/menu_items.js
--- a/yt/gui/reason/html/js/menu_items.js
+++ b/yt/gui/reason/html/js/menu_items.js
@@ -33,7 +33,11 @@
text: 'Menu',
id: 'main_menu',
menu: [
- {xtype:'menuitem', text: 'Open', disabled: true},
+ {xtype:'menuitem', text: 'Open File',
+ handler: function(b,e) {
+ open_file()
+ },
+ },
{xtype:'menuitem', text: 'Open Directory', disabled: true},
{xtype: 'menuseparator'},
{xtype:'menuitem', text: 'Save Script',
diff -r eef0ecf484eb4669591a6e3ff5b3950e19981767 -r 6a10d998272e8cc720768f5882392e7fac683ffe yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -1322,12 +1322,12 @@
from yt.gui.reason.bottle_mods import uuid_serve_functions, PayloadHandler
hr = ExtDirectREPL(base_extjs_path)
hr.debug = PayloadHandler.debug = args.debug
+ command_line = ["pfs = []"]
if args.find:
# We just have to find them and store references to them.
- command_line = ["pfs = []"]
for fn in sorted(glob.glob("*/*.hierarchy")):
command_line.append("pfs.append(load('%s'))" % fn[:-10])
- hr.execute("\n".join(command_line))
+ hr.execute("\n".join(command_line))
bottle.debug()
uuid_serve_functions(open_browser=args.open_browser,
port=int(args.port), repl=hr)
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list