ignore modules
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
import inspect
|
import inspect
|
||||||
import re
|
import re
|
||||||
|
import types
|
||||||
import weakref
|
import weakref
|
||||||
|
|
||||||
import ipywidgets
|
import ipywidgets
|
||||||
@ -11,7 +12,7 @@ FOOTER = '</td></tr></table></div>'
|
|||||||
SEP = '</td></tr><tr><td>'
|
SEP = '</td></tr><tr><td>'
|
||||||
LINE = '{0}</td><td>{1}</td><td>{2}</td><td>{3}'
|
LINE = '{0}</td><td>{1}</td><td>{2}</td><td>{3}'
|
||||||
|
|
||||||
IGNORE = ("In", "Out", "exit", "quit", "get_ipython")
|
IGNORE_NAMES = ("In", "Out", "exit", "quit", "get_ipython")
|
||||||
|
|
||||||
SNIP = " ...✀... "
|
SNIP = " ...✀... "
|
||||||
|
|
||||||
@ -88,7 +89,8 @@ def sorted_naturally(iterable, reverse=False):
|
|||||||
return sorted(iterable, key=natural, reverse=reverse)
|
return sorted(iterable, key=natural, reverse=reverse)
|
||||||
|
|
||||||
def is_good_entry(k, v):
|
def is_good_entry(k, v):
|
||||||
return not k.startswith("_") and k not in IGNORE and not isinstance(v, VariableInspector)
|
ignore_types = (VariableInspector, types.ModuleType)
|
||||||
|
return not k.startswith("_") and k not in IGNORE_NAMES and not isinstance(v, ignore_types)
|
||||||
|
|
||||||
def typename(obj):
|
def typename(obj):
|
||||||
return type(obj).__name__
|
return type(obj).__name__
|
||||||
|
Reference in New Issue
Block a user