Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
A couple more fixes
  • Loading branch information
pitrou committed May 23, 2017
commit cb2f13aaf54bb0651c01596ff3119774d18a140f
2 changes: 2 additions & 0 deletions distributed/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from io import BytesIO
from thread import get_ident as get_thread_identity
from inspect import getargspec
from cgi import escape as html_escape

reload = reload # flake8: noqa
unicode = unicode # flake8: noqa
Expand Down Expand Up @@ -54,6 +55,7 @@ def cache_from_source(path):
from importlib import invalidate_caches
from importlib.util import cache_from_source
from inspect import getfullargspec as getargspec
from html import escape as html_escape

PY2 = False
PY3 = True
Expand Down
4 changes: 2 additions & 2 deletions distributed/diagnostics/progressbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from .progress import format_time, Progress, MultiProgress

from ..compatibility import html_escape
from ..core import connect, coerce_to_address, CommClosedError
from ..client import default_client, futures_of
from ..protocol.pickle import dumps
Expand Down Expand Up @@ -227,13 +228,12 @@ def __init__(self, keys, scheduler=None, minimum=0, interval=0.1, func=key_split

def make_widget(self, all):
from ipywidgets import FloatProgress, HBox, VBox, HTML
import cgi
self.elapsed_time = HTML('')
self.bars = {key: FloatProgress(min=0, max=1, description='',
height='10px')
for key in all}
self.bar_texts = {key: HTML('', width = "140px") for key in all}
self.bar_labels = {key: HTML('<div style=\"padding: 0px 10px 0px 10px; text-align:left; word-wrap: break-word;\">' + cgi.escape(key.decode() if isinstance(key, bytes) else key) + '</div>')
self.bar_labels = {key: HTML('<div style=\"padding: 0px 10px 0px 10px; text-align:left; word-wrap: break-word;\">' + html_escape(key.decode() if isinstance(key, bytes) else key) + '</div>')
for key in all}

def key(kv):
Expand Down
2 changes: 1 addition & 1 deletion distributed/http/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def resource_collect(pid=None):
return {'cpu_percent': psutil.cpu_percent(),
'status': p.status(),
'memory_percent': p.memory_percent(),
'memory_info_ex': p.memory_info_ex(),
'memory_info': p.memory_info(),
'disk_io_counters': metrics.disk_io_counters(),
'net_io_counters': metrics.net_io_counters()}

Expand Down
2 changes: 1 addition & 1 deletion distributed/nanny.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def resource_collect(self):
'cpu_percent': psutil.cpu_percent(),
'status': p.status(),
'memory_percent': p.memory_percent(),
'memory_info_ex': p.memory_info_ex()._asdict(),
'memory_info': p.memory_info()._asdict(),
'disk_io_counters': disk_io_counters()._asdict(),
'net_io_counters': net_io_counters()._asdict()}

Expand Down