##// END OF EJS Templates
add '-s' for startup script in ipengine...
MinRK -
Show More
@@ -113,6 +113,9 class IPEngineAppConfigLoader(ClusterDirConfigLoader):
113 paa('-c',
113 paa('-c',
114 type=str, dest='Global.extra_exec_lines',
114 type=str, dest='Global.extra_exec_lines',
115 help='specify a command to be run at startup')
115 help='specify a command to be run at startup')
116 paa('-s',
117 type=unicode, dest='Global.extra_exec_file',
118 help='specify a script to be run at startup')
116
119
117 factory.add_session_arguments(self.parser)
120 factory.add_session_arguments(self.parser)
118 factory.add_registration_arguments(self.parser)
121 factory.add_registration_arguments(self.parser)
@@ -142,6 +145,7 class IPEngineApp(ApplicationWithClusterDir):
142 # Global config attributes
145 # Global config attributes
143 self.default_config.Global.exec_lines = []
146 self.default_config.Global.exec_lines = []
144 self.default_config.Global.extra_exec_lines = ''
147 self.default_config.Global.extra_exec_lines = ''
148 self.default_config.Global.extra_exec_file = u''
145
149
146 # Configuration related to the controller
150 # Configuration related to the controller
147 # This must match the filename (path not included) that the controller
151 # This must match the filename (path not included) that the controller
@@ -167,6 +171,10 class IPEngineApp(ApplicationWithClusterDir):
167 self.find_url_file()
171 self.find_url_file()
168 if self.master_config.Global.extra_exec_lines:
172 if self.master_config.Global.extra_exec_lines:
169 self.master_config.Global.exec_lines.append(self.master_config.Global.extra_exec_lines)
173 self.master_config.Global.exec_lines.append(self.master_config.Global.extra_exec_lines)
174 if self.master_config.Global.extra_exec_file:
175 enc = sys.getfilesystemencoding() or 'utf8'
176 cmd="execfile(%r)"%self.master_config.Global.extra_exec_file.encode(enc)
177 self.master_config.Global.exec_lines.append(cmd)
170
178
171 # def find_key_file(self):
179 # def find_key_file(self):
172 # """Set the key file.
180 # """Set the key file.
@@ -674,8 +674,10 class Client(HasTraits):
674 md[name] = s + content['data']
674 md[name] = s + content['data']
675 elif msg_type == 'pyerr':
675 elif msg_type == 'pyerr':
676 md.update({'pyerr' : self._unwrap_exception(content)})
676 md.update({'pyerr' : self._unwrap_exception(content)})
677 elif msg_type == 'pyin':
678 md.update({'pyin' : content['code']})
677 else:
679 else:
678 md.update({msg_type : content['data']})
680 md.update({msg_type : content.get('data', '')})
679
681
680 # reduntant?
682 # reduntant?
681 self.metadata[msg_id] = md
683 self.metadata[msg_id] = md
@@ -764,8 +764,10 class Hub(LoggingFactory):
764
764
765 elif msg_type == 'pyerr':
765 elif msg_type == 'pyerr':
766 d['pyerr'] = content
766 d['pyerr'] = content
767 elif msg_type == 'pyin':
768 d['pyin'] = content['code']
767 else:
769 else:
768 d[msg_type] = content['data']
770 d[msg_type] = content.get('data', '')
769
771
770 self.db.update_record(msg_id, d)
772 self.db.update_record(msg_id, d)
771
773
@@ -39,8 +39,15 def printer(*args):
39 pprint(args, stream=sys.__stdout__)
39 pprint(args, stream=sys.__stdout__)
40
40
41
41
42 class _Passer:
42 class _Passer(zmqstream.ZMQStream):
43 """Empty class that implements `send()` that does nothing."""
43 """Empty class that implements `send()` that does nothing.
44
45 Subclass ZMQStream for StreamSession typechecking
46
47 """
48 def __init__(self, *args, **kwargs):
49 pass
50
44 def send(self, *args, **kwargs):
51 def send(self, *args, **kwargs):
45 pass
52 pass
46 send_multipart = send
53 send_multipart = send
General Comments 0
You need to be logged in to leave comments. Login now