[Yt-svn] commit/yt: MatthewTurk: Fixing some debugging things, and also manually waiting for the execution queue
Bitbucket
commits-noreply at bitbucket.org
Fri Jun 3 15:07:39 PDT 2011
1 new changeset in yt:
http://bitbucket.org/yt_analysis/yt/changeset/4baa28b756bc/
changeset: 4baa28b756bc
branches:
user: MatthewTurk
date: 2011-06-04 00:07:14
summary: Fixing some debugging things, and also manually waiting for the execution queue
to clear when starting up the REPL.
affected #: 3 files (105 bytes)
--- a/yt/gui/reason/bottle_mods.py Fri Jun 03 17:11:18 2011 -0400
+++ b/yt/gui/reason/bottle_mods.py Fri Jun 03 15:07:14 2011 -0700
@@ -152,6 +152,9 @@
print "WARNING: %s has no _route_prefix attribute. Not notifying."
continue
w._route_prefix = token
+ repl.activate()
+ while not repl.execution_thread.queue.empty():
+ time.sleep(1)
print
print
print "============================================================================="
@@ -195,7 +198,7 @@
import yt.utilities.rocket as rocket
server_type = YTRocketServer
log = logging.getLogger('Rocket')
- log.setLevel(logging.INFO)
+ log.setLevel(logging.WARNING)
kwargs = {'timeout': 600, 'max_threads': 2}
if repl is not None:
repl.server = YTRocketServer.server_info
--- a/yt/gui/reason/extdirect_repl.py Fri Jun 03 17:11:18 2011 -0400
+++ b/yt/gui/reason/extdirect_repl.py Fri Jun 03 15:07:14 2011 -0700
@@ -106,24 +106,24 @@
def run(self):
while 1:
- print "Checking for a queue ..."
+ #print "Checking for a queue ..."
try:
task = self.queue.get(True, 10)
except (Queue.Full, Queue.Empty):
if self.repl.stopped: return
continue
- print "Received the task", task
+ #print "Received the task", task
if task['type'] == 'code':
self.execute_one(task['code'], task['hide'])
self.queue.task_done()
elif task['type'] == 'add_widget':
- print "Adding new widget"
+ #print "Adding new widget"
self.queue.task_done()
new_code = self.repl._add_widget(
task['name'], task['widget_data_name'])
- print "Got this command:", new_code
+ #print "Got this command:", new_code
self.repl.execute(new_code, hide=True)
- print "Executed!"
+ #print "Executed!"
def execute_one(self, code, hide):
self.repl.executed_cell_texts.append(code)
@@ -237,13 +237,13 @@
self.execute("data_objects = []", hide = True)
self.locals['load_script'] = ext_load_script
self.locals['deliver_image'] = deliver_image
+
+ def activate(self):
self._setup_logging_handlers()
-
# Setup our heartbeat
self.last_heartbeat = time.time()
self._check_heartbeat()
self.execution_thread.start()
- if self.debug: time.sleep(3)
def exception_handler(self, exc):
result = {'type': 'cell_results',
--- a/yt/utilities/command_line.py Fri Jun 03 17:11:18 2011 -0400
+++ b/yt/utilities/command_line.py Fri Jun 03 15:07:14 2011 -0700
@@ -1120,6 +1120,7 @@
bottle.debug()
uuid_serve_functions(open_browser=opts.open_browser,
port=int(opts.port), repl=hr)
+
def do_remote(self, subcmd, opts):
import getpass, sys, socket, time, webbrowser
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