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