Place the current dir on stack and change directory. Usage:\\ %pushd ['dirname']
(self, parameter_s='')
| 493 | |
| 494 | @line_magic |
| 495 | def pushd(self, parameter_s=''): |
| 496 | """Place the current dir on stack and change directory. |
| 497 | |
| 498 | Usage:\\ |
| 499 | %pushd ['dirname'] |
| 500 | """ |
| 501 | |
| 502 | dir_s = self.shell.dir_stack |
| 503 | tgt = os.path.expanduser(parameter_s) |
| 504 | cwd = os.getcwd().replace(self.shell.home_dir,'~') |
| 505 | if tgt: |
| 506 | self.cd(parameter_s) |
| 507 | dir_s.insert(0,cwd) |
| 508 | return self.shell.run_line_magic('dirs', '') |
| 509 | |
| 510 | @line_magic |
| 511 | def popd(self, parameter_s=''): |
nothing calls this directly
no test coverage detected