-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathrmdupes-srg.py
More file actions
29 lines (25 loc) · 824 Bytes
/
rmdupes-srg.py
File metadata and controls
29 lines (25 loc) · 824 Bytes
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
#!/usr/bin/python
# Filter srg removing names that didn't change
import sys
import srglib
for line in sys.stdin.readlines():
line = line.strip()
tokens = line.split(" ")
kind = tokens[0]
args = tokens[1:]
if kind == "PK:": # package
print line
elif kind == "CL:": # class
inName, outName = args
if inName != outName:
print kind, inName, outName
elif kind == "FD:": # field
inName, outName = args
if srglib.splitBaseName(inName) != srglib.splitBaseName(outName):
print kind, inName, outName
elif kind == "MD:": # method
inName, inSig, outName, outSig = args
if srglib.splitBaseName(inName) != srglib.splitBaseName(outName):
print kind, inName, inSig, outName, outSig
else:
print line