mirror of
https://github.com/pyscript/pyscript.git
synced 2022-05-01 19:47:48 +03:00
Handle strings
This commit is contained in:
@@ -68,6 +68,8 @@ def format_mime(obj):
|
|||||||
"""
|
"""
|
||||||
Formats object using _repr_x_ methods.
|
Formats object using _repr_x_ methods.
|
||||||
"""
|
"""
|
||||||
|
if isinstance(obj, str):
|
||||||
|
return obj, 'text/plain'
|
||||||
|
|
||||||
mimebundle = eval_formatter(obj, '_repr_mimebundle_')
|
mimebundle = eval_formatter(obj, '_repr_mimebundle_')
|
||||||
if isinstance(mimebundle, tuple):
|
if isinstance(mimebundle, tuple):
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ def format_mime(obj):
|
|||||||
"""
|
"""
|
||||||
Formats object using _repr_x_ methods.
|
Formats object using _repr_x_ methods.
|
||||||
"""
|
"""
|
||||||
|
if isinstance(obj, str):
|
||||||
|
return obj, 'text/plain'
|
||||||
|
|
||||||
mimebundle = eval_formatter(obj, '_repr_mimebundle_')
|
mimebundle = eval_formatter(obj, '_repr_mimebundle_')
|
||||||
if isinstance(mimebundle, tuple):
|
if isinstance(mimebundle, tuple):
|
||||||
|
|||||||
Reference in New Issue
Block a user