Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Merging a patch/diff generated by difflib?

Reply
Thread Tools

Merging a patch/diff generated by difflib?

 
 
erikcw
Guest
Posts: n/a
 
      03-18-2008
Hi,

I'm trying to create an undo/redo feature for a webapp I'm working on
(django based). I'd like to have an undo/redo function.

My first thought was to use the difflib to generate a diff to serve as
the "backup", and then if someone wants to undo their operation, the
diff could just be merged/patched with the current text.

However, I've not be able to find a patch library. Are there any
libraries that will handle merging the diff back into the text?

Thanks!
 
Reply With Quote
 
 
 
 
Raymond Hettinger
Guest
Posts: n/a
 
      03-18-2008
On Mar 18, 6:08 am, erikcw <erikwickst...@gmail.com> wrote:
> Hi,
>
> I'm trying to create an undo/redo feature for a webapp I'm working on
> (django based). I'd like to have an undo/redo function.
>
> My first thought was to use the difflib to generate a diff to serve as
> the "backup", and then if someone wants to undo their operation, the
> diff could just be merged/patched with the current text.
>
> However, I've not be able to find a patch library. Are there any
> libraries that will handle merging the diff back into the text?


The difflib module has a restore() function.


Raymond

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
merging two Thunderbird databases WCH Firefox 2 04-12-2006 03:03 PM
AVI Merging XhArD Software 24 11-04-2005 06:37 AM
Merging flash and slot PCMCIA. AM Cisco 0 07-25-2005 08:45 AM
Merging mail folders Tony Raven Firefox 2 12-04-2004 12:56 AM
Merging datasets Dan Cooper ASP .Net 2 01-28-2004 04:21 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57