diff --git a/IPython/config/tests/test_configurable.py b/IPython/config/tests/test_configurable.py index 4073912..9ce47fa 100644 --- a/IPython/config/tests/test_configurable.py +++ b/IPython/config/tests/test_configurable.py @@ -28,7 +28,7 @@ from IPython.config.configurable import ( ) from IPython.utils.traitlets import ( - Int, Float, Str + Int, Float, Unicode ) from IPython.config.loader import Config @@ -42,7 +42,7 @@ from IPython.config.loader import Config class MyConfigurable(Configurable): a = Int(1, config=True, help="The integer a.") b = Float(1.0, config=True, help="The integer b.") - c = Str('no config') + c = Unicode('no config') mc_help=u"""MyConfigurable options @@ -56,11 +56,11 @@ MyConfigurable.b : Float class Foo(Configurable): a = Int(0, config=True, help="The integer a.") - b = Str('nope', config=True) + b = Unicode('nope', config=True) class Bar(Foo): - b = Str('gotit', config=False, help="The string b.") + b = Unicode('gotit', config=False, help="The string b.") c = Float(config=True, help="The string c.") diff --git a/IPython/core/formatters.py b/IPython/core/formatters.py index 19c519b..655aca9 100644 --- a/IPython/core/formatters.py +++ b/IPython/core/formatters.py @@ -28,7 +28,7 @@ from StringIO import StringIO # Our own imports from IPython.config.configurable import Configurable from IPython.lib import pretty -from IPython.utils.traitlets import Bool, Dict, Int, Str, CStr +from IPython.utils.traitlets import Bool, Dict, Int, Unicode, CUnicode #----------------------------------------------------------------------------- @@ -191,11 +191,11 @@ class BaseFormatter(Configurable): returned and this format type is not used. """ - format_type = Str('text/plain') + format_type = Unicode('text/plain') enabled = Bool(True, config=True) - print_method = Str('__repr__') + print_method = Unicode('__repr__') # The singleton printers. # Maps the IDs of the builtin singleton objects to the format functions. @@ -337,14 +337,14 @@ class PlainTextFormatter(BaseFormatter): """ # The format type of data returned. - format_type = Str('text/plain') + format_type = Unicode('text/plain') # This subclass ignores this attribute as it always need to return # something. enabled = Bool(True, config=False) # Look for a _repr_pretty_ methods to use for pretty printing. - print_method = Str('_repr_pretty_') + print_method = Unicode('_repr_pretty_') # Whether to pretty-print or not. pprint = Bool(True, config=True) @@ -356,12 +356,12 @@ class PlainTextFormatter(BaseFormatter): max_width = Int(79, config=True) # The newline character. - newline = Str('\n', config=True) + newline = Unicode('\n', config=True) # format-string for pprinting floats - float_format = Str('%r') + float_format = Unicode('%r') # setter for float precision, either int or direct format-string - float_precision = CStr('', config=True) + float_precision = CUnicode('', config=True) def _float_precision_changed(self, name, old, new): """float_precision changed, set float_format accordingly. @@ -454,9 +454,9 @@ class HTMLFormatter(BaseFormatter): could be injected into an existing DOM. It should *not* include the ````` or ```
`` tags. """ - format_type = Str('text/html') + format_type = Unicode('text/html') - print_method = Str('_repr_html_') + print_method = Unicode('_repr_html_') class SVGFormatter(BaseFormatter): @@ -471,9 +471,9 @@ class SVGFormatter(BaseFormatter): ```