-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultiDiff.py
More file actions
executable file
·34 lines (28 loc) · 1.01 KB
/
Copy pathmultiDiff.py
File metadata and controls
executable file
·34 lines (28 loc) · 1.01 KB
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
#!/usr/bin/env python
import sys
import string
import re
import argparse
import subprocess
def VTEversion(string):
if re.match(r'\d+', string):
return string
parser = argparse.ArgumentParser(description='Auto diff VTE differences.log')
parser.add_argument('--rev', dest='revision', required=True, type=VTEversion,
help='indicate VTE revision to diff')
parser.add_argument('--from', dest='fromNum', type=int,
help='indicate from witch file number to start diff')
args = parser.parse_args()
count = 0
in_file = open("vte_updater/" + args.revision + "/differences.log", "r")
while True:
count += 1
in_line = in_file.readline()
if in_line == "":
break
if count < args.fromNum:
continue
in_line = in_line[2:-1]
if raw_input("Proceed with next file ([{}] {})? [y]/n: ".format(count, in_line)).lower() in ('y', 'yes', ''):
subprocess.call(['vimdiff', in_line, 'vte_updater/' + args.revision + '/backup/vte/' + in_line])
in_file.close()