Permalink
Browse files

Tidy up CStr and Str traits from newapp merge.

  • Loading branch information...
1 parent 97ea6aa commit 352cd71177efd9d079066a505559c7e4bf1b7d3e @takluyver committed Jun 21, 2011
@@ -318,6 +318,8 @@ def __init__(self, url_or_file=None, profile='default', profile_dir=None, ipytho
if os.path.isfile(exec_key):
extra_args['keyfile'] = exec_key
else:
+ if isinstance(exec_key, unicode):
+ exec_key = exec_key.encode('ascii')
extra_args['key'] = exec_key
self.session = Session(**extra_args)
@@ -30,7 +30,7 @@
# internal:
from IPython.utils.importstring import import_item
from IPython.utils.traitlets import (
- HasTraits, Instance, Int, Unicode, Dict, Set, Tuple, CStr
+ HasTraits, Instance, Int, Unicode, Dict, Set, Tuple, Bytes
)
from IPython.parallel import error, util
@@ -111,10 +111,10 @@ class EngineConnector(HasTraits):
heartbeat (str): identity of heartbeat XREQ socket
"""
id=Int(0)
- queue=CStr()
- control=CStr()
- registration=CStr()
- heartbeat=CStr()
+ queue=Bytes()
+ control=Bytes()
+ registration=Bytes()
+ heartbeat=Bytes()
pending=Set()
class HubFactory(RegistrationFactory):
@@ -39,7 +39,7 @@
# local imports
from IPython.external.decorator import decorator
from IPython.config.loader import Config
-from IPython.utils.traitlets import Instance, Dict, List, Set, Int, Str, Enum
+from IPython.utils.traitlets import Instance, Dict, List, Set, Int, Enum
from IPython.parallel import error
from IPython.parallel.factory import SessionFactory
View
@@ -47,7 +47,7 @@
from IPython.config.configurable import Configurable, LoggingConfigurable
from IPython.utils.importstring import import_item
from IPython.utils.jsonutil import extract_dates, squash_dates, date_default
-from IPython.utils.traitlets import CStr, Unicode, Bool, Any, Instance, Set
+from IPython.utils.traitlets import Bytes, Unicode, Bool, Any, Instance, Set
#-----------------------------------------------------------------------------
# utility functions
@@ -238,7 +238,7 @@ def _unpacker_changed(self, name, old, new):
else:
self.unpack = import_item(str(new))
- session = CStr('', config=True,
+ session = Bytes(b'', config=True,
help="""The UUID identifying this session.""")
def _session_default(self):
return bytes(uuid.uuid4())
@@ -247,7 +247,7 @@ def _session_default(self):
help="""Username for the Session. Default is your system username.""")
# message signature related traits:
- key = CStr('', config=True,
+ key = Bytes(b'', config=True,
help="""execution key, for extra authentication.""")
def _key_changed(self, name, old, new):
if new:

0 comments on commit 352cd71

Please sign in to comment.