Commits

Matthew Turk committed 4baa28b

Fixing some debugging things, and also manually waiting for the execution queue
to clear when starting up the REPL.

Comments (0)

Files changed (3)

yt/gui/reason/bottle_mods.py

             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 "============================================================================="
         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

yt/gui/reason/extdirect_repl.py

 
     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)
         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',

yt/utilities/command_line.py

         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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.