rename filter to filters to make 2to3 happy

This commit is contained in:
Matt Mackall 2014-07-15 01:33:26 -05:00
commit 7143f141f6

16
smem
View file

@ -170,7 +170,7 @@ def pidmaps(pid):
if options.mapfilter: if options.mapfilter:
f = {} f = {}
for m in maps: for m in maps:
if not filter(options.mapfilter, m, lambda x: maps[x]['name']): if not filters(options.mapfilter, m, lambda x: maps[x]['name']):
f[m] = maps[m] f[m] = maps[m]
return f return f
@ -227,7 +227,7 @@ def showamount(a, total):
return "%.2f%%" % (100.0 * a / total) return "%.2f%%" % (100.0 * a / total)
return a return a
def filter(opt, arg, *sources): def filters(opt, arg, *sources):
if not opt: if not opt:
return False return False
@ -252,8 +252,8 @@ def pidtotals(pid):
def processtotals(pids): def processtotals(pids):
totals = {} totals = {}
for pid in pids: for pid in pids:
if (filter(options.processfilter, pid, src.pidname, src.pidcmd) or if (filters(options.processfilter, pid, src.pidname, src.pidcmd) or
filter(options.userfilter, pid, pidusername)): filters(options.userfilter, pid, pidusername)):
continue continue
try: try:
p = pidtotals(pid) p = pidtotals(pid)
@ -301,8 +301,8 @@ def showpids():
def maptotals(pids): def maptotals(pids):
totals = {} totals = {}
for pid in pids: for pid in pids:
if (filter(options.processfilter, pid, src.pidname, src.pidcmd) or if (filters(options.processfilter, pid, src.pidname, src.pidcmd) or
filter(options.userfilter, pid, pidusername)): filters(options.userfilter, pid, pidusername)):
continue continue
try: try:
maps = pidmaps(pid) maps = pidmaps(pid)
@ -366,8 +366,8 @@ def showmaps():
def usertotals(pids): def usertotals(pids):
totals = {} totals = {}
for pid in pids: for pid in pids:
if (filter(options.processfilter, pid, src.pidname, src.pidcmd) or if (filters(options.processfilter, pid, src.pidname, src.pidcmd) or
filter(options.userfilter, pid, pidusername)): filters(options.userfilter, pid, pidusername)):
continue continue
try: try:
maps = pidmaps(pid) maps = pidmaps(pid)