Message116970
| Author |
terry.reedy |
| Recipients |
BreamoreBoy, stefanv, swixel, techtonik, terry.reedy, twhitema |
| Date |
2010年09月20日.20:57:58 |
| SpamBayes Score |
2.3126707e-07 |
| Marked as misclassified |
No |
| Message-id |
<1285016281.01.0.155492319441.issue2057@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Given that difflib produces unified diffs (among 3 others) and that diff.py is a thin command-line wrapper that provides access to all 4 formats (with no default), I consider those two files 'ready'. So I presume you are referring to your patch.py, which is still labelled experimental.
Difflib works by analyzing sequences a and b with SequenceMatcher to produce a sequence of edits that would produce b from a. It then formats the edits into 1 of 4 formats.
Ideally, a patchlib would have a core SequenceEditor that would apply a sequence of edits (in the same format as SequenceMatcher's outputs) to sequence a to output sequence b. That much seems relatively easy. To be complete, it should also have at least 3 if not 4 parse functions that would produce edit sequences. A corresponding patch.py would then be a thin command-line wrapper over patchlib.
Your comments and a perusal of your code indicates that it has a unified diff parser, a sequence matcher, and command-line wrapper. I guess the immediate question is whether this would be enough for a start. |
|