##// END OF EJS Templates
Tidy up CStr and Str traits from newapp merge.
Thomas Kluyver -
Show More
@@ -318,6 +318,8 b' class Client(HasTraits):'
318 if os.path.isfile(exec_key):
318 if os.path.isfile(exec_key):
319 extra_args['keyfile'] = exec_key
319 extra_args['keyfile'] = exec_key
320 else:
320 else:
321 if isinstance(exec_key, unicode):
322 exec_key = exec_key.encode('ascii')
321 extra_args['key'] = exec_key
323 extra_args['key'] = exec_key
322 self.session = Session(**extra_args)
324 self.session = Session(**extra_args)
323
325
@@ -30,7 +30,7 b' from zmq.eventloop.zmqstream import ZMQStream'
30 # internal:
30 # internal:
31 from IPython.utils.importstring import import_item
31 from IPython.utils.importstring import import_item
32 from IPython.utils.traitlets import (
32 from IPython.utils.traitlets import (
33 HasTraits, Instance, Int, Unicode, Dict, Set, Tuple, CStr
33 HasTraits, Instance, Int, Unicode, Dict, Set, Tuple, Bytes
34 )
34 )
35
35
36 from IPython.parallel import error, util
36 from IPython.parallel import error, util
@@ -111,10 +111,10 b' class EngineConnector(HasTraits):'
111 heartbeat (str): identity of heartbeat XREQ socket
111 heartbeat (str): identity of heartbeat XREQ socket
112 """
112 """
113 id=Int(0)
113 id=Int(0)
114 queue=CStr()
114 queue=Bytes()
115 control=CStr()
115 control=Bytes()
116 registration=CStr()
116 registration=Bytes()
117 heartbeat=CStr()
117 heartbeat=Bytes()
118 pending=Set()
118 pending=Set()
119
119
120 class HubFactory(RegistrationFactory):
120 class HubFactory(RegistrationFactory):
@@ -39,7 +39,7 b' from zmq.eventloop import ioloop, zmqstream'
39 # local imports
39 # local imports
40 from IPython.external.decorator import decorator
40 from IPython.external.decorator import decorator
41 from IPython.config.loader import Config
41 from IPython.config.loader import Config
42 from IPython.utils.traitlets import Instance, Dict, List, Set, Int, Str, Enum
42 from IPython.utils.traitlets import Instance, Dict, List, Set, Int, Enum
43
43
44 from IPython.parallel import error
44 from IPython.parallel import error
45 from IPython.parallel.factory import SessionFactory
45 from IPython.parallel.factory import SessionFactory
@@ -47,7 +47,7 b' from zmq.eventloop.zmqstream import ZMQStream'
47 from IPython.config.configurable import Configurable, LoggingConfigurable
47 from IPython.config.configurable import Configurable, LoggingConfigurable
48 from IPython.utils.importstring import import_item
48 from IPython.utils.importstring import import_item
49 from IPython.utils.jsonutil import extract_dates, squash_dates, date_default
49 from IPython.utils.jsonutil import extract_dates, squash_dates, date_default
50 from IPython.utils.traitlets import CStr, Unicode, Bool, Any, Instance, Set
50 from IPython.utils.traitlets import Bytes, Unicode, Bool, Any, Instance, Set
51
51
52 #-----------------------------------------------------------------------------
52 #-----------------------------------------------------------------------------
53 # utility functions
53 # utility functions
@@ -238,7 +238,7 b' class Session(Configurable):'
238 else:
238 else:
239 self.unpack = import_item(str(new))
239 self.unpack = import_item(str(new))
240
240
241 session = CStr('', config=True,
241 session = Bytes(b'', config=True,
242 help="""The UUID identifying this session.""")
242 help="""The UUID identifying this session.""")
243 def _session_default(self):
243 def _session_default(self):
244 return bytes(uuid.uuid4())
244 return bytes(uuid.uuid4())
@@ -247,7 +247,7 b' class Session(Configurable):'
247 help="""Username for the Session. Default is your system username.""")
247 help="""Username for the Session. Default is your system username.""")
248
248
249 # message signature related traits:
249 # message signature related traits:
250 key = CStr('', config=True,
250 key = Bytes(b'', config=True,
251 help="""execution key, for extra authentication.""")
251 help="""execution key, for extra authentication.""")
252 def _key_changed(self, name, old, new):
252 def _key_changed(self, name, old, new):
253 if new:
253 if new:
General Comments 0
You need to be logged in to leave comments. Login now