$52 GRAYBYTE WORDPRESS FILE MANAGER $79

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/lxml/html/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/lxml/html//_diffcommand.py
from __future__ import absolute_import

import optparse
import sys
import re
import os
from .diff import htmldiff

description = """\
"""

parser = optparse.OptionParser(
    usage="%prog [OPTIONS] FILE1 FILE2\n"
    "%prog --annotate [OPTIONS] INFO1 FILE1 INFO2 FILE2 ...",
    description=description,
    )

parser.add_option(
    '-o', '--output',
    metavar="FILE",
    dest="output",
    default="-",
    help="File to write the difference to",
    )

parser.add_option(
    '-a', '--annotation',
    action="store_true",
    dest="annotation",
    help="Do an annotation")

def main(args=None):
    if args is None:
        args = sys.argv[1:]
    options, args = parser.parse_args(args)
    if options.annotation:
        return annotate(options, args)
    if len(args) != 2:
        print('Error: you must give two files')
        parser.print_help()
        sys.exit(1)
    file1, file2 = args
    input1 = read_file(file1)
    input2 = read_file(file2)
    body1 = split_body(input1)[1]
    pre, body2, post = split_body(input2)
    result = htmldiff(body1, body2)
    result = pre + result + post
    if options.output == '-':
        if not result.endswith('\n'):
            result += '\n'
        sys.stdout.write(result)
    else:
        with open(options.output, 'wb') as f:
            f.write(result)

def read_file(filename):
    if filename == '-':
        c = sys.stdin.read()
    elif not os.path.exists(filename):
        raise OSError(
            "Input file %s does not exist" % filename)
    else:
        with open(filename, 'rb') as f:
            c = f.read()
    return c

body_start_re = re.compile(
    r"<body.*?>", re.I|re.S)
body_end_re = re.compile(
    r"</body.*?>", re.I|re.S)
    
def split_body(html):
    pre = post = ''
    match = body_start_re.search(html)
    if match:
        pre = html[:match.end()]
        html = html[match.end():]
    match = body_end_re.search(html)
    if match:
        post = html[match.start():]
        html = html[:match.start()]
    return pre, html, post

def annotate(options, args):
    print("Not yet implemented")
    sys.exit(1)
    

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.24 PM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
ElementSoup.py
0.313 KB
17 Apr 2025 8.10 PM
root / root
0644
__init__.py
63.415 KB
17 Apr 2025 8.10 PM
root / root
0644
_diffcommand.py
2.071 KB
17 Apr 2025 8.10 PM
root / root
0644
_html5builder.py
3.17 KB
17 Apr 2025 8.10 PM
root / root
0644
_setmixin.py
1.156 KB
17 Apr 2025 8.10 PM
root / root
0644
builder.py
4.387 KB
17 Apr 2025 8.10 PM
root / root
0644
clean.cpython-311-x86_64-linux-gnu.so
314.469 KB
17 Apr 2025 8.11 PM
root / root
0755
clean.py
27.652 KB
17 Apr 2025 8.10 PM
root / root
0644
defs.py
4.137 KB
17 Apr 2025 8.10 PM
root / root
0644
diff.cpython-311-x86_64-linux-gnu.so
412.289 KB
17 Apr 2025 8.11 PM
root / root
0755
diff.py
29.837 KB
17 Apr 2025 8.10 PM
root / root
0644
formfill.py
9.462 KB
17 Apr 2025 8.10 PM
root / root
0644
html5parser.py
8.432 KB
17 Apr 2025 8.10 PM
root / root
0644
soupparser.py
9.964 KB
17 Apr 2025 8.10 PM
root / root
0644
usedoctest.py
0.243 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF