Merge lp://staging/~duke-eml/ipython/ipython-saveappend into lp://staging/ipython
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~duke-eml/ipython/ipython-saveappend |
Merge into: | lp://staging/ipython |
Diff against target: |
31 lines (+8/-4) 1 file modified
IPython/core/magic.py (+8/-4) |
To merge this branch: | bzr merge lp://staging/~duke-eml/ipython/ipython-saveappend |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | Abstain | ||
Review via email: mp+46268@code.staging.launchpad.net |
Description of the change
I have made a small change to allow the magic_save function to append to an existing file rather than overwrite it.
In using IPython, I often would like to build up a file gradually from the command line history, and the default behavior of overwriting existing files makes this difficult, hence the modification.
I haven't written any tests because I don't know how to put one in the testing framework, but in principle, the test would involve reading an existing file, running magic_save, then checking the file to see that the intended lines were appended correctly.
Unmerged revisions
- 1370. By Marmaduke Woodman
-
In the magic function 'save', when the file exists, instead of
overwriting, the option to append has been added.
Note that all IPython development is now on Github - this is just Launchpad importing the branch from git.