HEX
Server: Apache/2.4.57 (Unix) OpenSSL/1.1.1w
System: Linux server.mediaphic.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: efhamali (1088)
PHP: 7.3.33
Disabled: exec,passthru,shell_exec,system,show_source,mail,sendmail,popen,symlink,phpinfo
Upload Files
File: //lib64/python2.7/site-packages/meld3/melddiff.py
from meld3 import parse_html
import sys

def main(srcfile, tgtfile):
    srcroot = parse_html(srcfile)
    tgtroot = parse_html(tgtfile)
    changes = srcroot.diffmeld(tgtroot)
    added = changes['unreduced']['added']
    if added:
        print 'Added: %s' % ', '.join([ x.meldid() for x in added])
    removed = changes['unreduced']['removed']
    if removed:
        print 'Removed: %s' % ', '.join([ x.meldid() for x in removed])
    moved = changes['reduced']['moved']
    if moved:
        print 'Moved: %s' % ', '.join([ x.meldid() for x in moved])

if __name__ == '__main__':
    main(sys.argv[1], sys.argv[2])