##// END OF EJS Templates
Merge pull request #1535 from doerwalter/master...
Merge pull request #1535 from doerwalter/master Fix pretty printing dispatch. This patch fixes a problem mentioned here: http://mail.scipy.org/pipermail/ipython-dev/2012-March/008874.html Search for the best method to use for pretty printing an object now no longer prefers any registered printer in `type_printers` for the class or any of the base classes over a `_repr_pretty_` method defined in the class or any of its base classes. Instead the mro is walked, looking for both registered printers and `_repr_pretty_` methods, so that the inheritance hierarchy will be taken into account.

File last commit:

r6455:15863dc1
r6483:81039be0 merge
Show More
task2.py
50 lines | 924 B | text/x-python | PythonLexer
#!/usr/bin/env python
# encoding: utf-8
from IPython.parallel import Client
import time
import sys
flush = sys.stdout.flush
rc = Client()
v = rc.load_balanced_view()
mux = rc[:]
for i in range(24):
v.apply(time.sleep, 1)
for i in range(6):
time.sleep(1.0)
print("Queue status (vebose=False)")
print(v.queue_status(verbose=False))
flush()
for i in range(24):
v.apply(time.sleep, 1)
for i in range(6):
time.sleep(1.0)
print("Queue status (vebose=True)")
print(v.queue_status(verbose=True))
flush()
for i in range(12):
v.apply(time.sleep, 2)
print("Queue status (vebose=True)")
print(v.queue_status(verbose=True))
flush()
# qs = v.queue_status(verbose=True)
# queued = qs['scheduled']
for msg_id in v.history[-4:]:
v.abort(msg_id)
for i in range(6):
time.sleep(1.0)
print("Queue status (vebose=True)")
print(v.queue_status(verbose=True))
flush()