Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
text_diff.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
# Copyright 2015 The PDFium Authors
3
# Use of this source code is governed by a BSD-style license that can be
4
# found in the LICENSE file.
5
6
import
difflib
7
import
sys
8
9
10
def
main
(argv):
11
if
len(argv) != 3:
12
print
(
'%s: invalid arguments'
% argv[0])
13
return
2
14
filename1 = argv[1]
15
filename2 = argv[2]
16
try
:
17
with
open
(filename1,
"r"
)
as
f1:
18
str1 = f1.readlines()
19
with
open
(filename2,
"r"
)
as
f2:
20
str2 = f2.readlines()
21
diffs = difflib.unified_diff(
22
str1, str2, fromfile=filename1, tofile=filename2)
23
except
Exception
as
e:
24
print
(
"something went astray: %s"
% e)
25
return
1
26
status_code = 0
27
for
diff
in
diffs:
28
sys.stdout.write(diff)
29
status_code = 1
30
return
status_code
31
32
33
if
__name__ ==
'__main__'
:
34
sys.exit(
main
(sys.argv))
main
int main()
[0]
Definition
doc_src_objecttrees.cpp:5
print
QDebug print(QDebug debug, QSslError::SslError error)
Definition
qsslerror.cpp:349
open
file open(QIODevice::ReadOnly)
qtwebengine
src
3rdparty
chromium
third_party
pdfium
testing
tools
text_diff.py
Generated on Mon Mar 10 2025 01:11:10 for Qt by
1.13.2