Changeset 2951
- Timestamp:
- 01/19/08 05:32:18 (11 months ago)
- Files:
-
- ipython/trunk/IPython/hooks.py (modified) (3 diffs)
- ipython/trunk/IPython/iplib.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ipython/trunk/IPython/hooks.py
r2899 r2951 49 49 50 50 import os,bisect 51 from genutils import Term 51 from genutils import Term,shell 52 52 from pprint import PrettyPrinter 53 53 … … 56 56 __all__ = ['editor', 'fix_error_editor', 'result_display', 57 57 'input_prefilter', 'shutdown_hook', 'late_startup_hook', 58 'generate_prompt', 'generate_output_prompt' ]58 'generate_prompt', 'generate_output_prompt','shell_hook'] 59 59 60 60 pformat = PrettyPrinter().pformat … … 214 214 ip = self.api 215 215 return str(ip.IP.outputcache.prompt_out) 216 217 def shell_hook(self,cmd): 218 """ Run system/shell command a'la os.system() """ 219 220 shell(cmd, header=self.rc.system_header, verbose=self.rc.system_verbose) 221 ipython/trunk/IPython/iplib.py
r2930 r2951 491 491 # and it allows interpolation of variables in the user's namespace. 492 492 self.system = lambda cmd: \ 493 shell(self.var_expand(cmd,depth=2), 494 header=self.rc.system_header, 495 verbose=self.rc.system_verbose) 493 self.hooks.shell_hook(self.var_expand(cmd,depth=2)) 496 494 497 495 # These are for getoutput and getoutputerror:
