Improved listing of unused modules.
This commit is contained in:
parent
2759e769be
commit
bf86f69321
1 changed files with 6 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
|||
import os
|
||||
import datetime
|
||||
from optparse import OptionParser
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
|
||||
|
@ -78,10 +79,13 @@ if options.list_unused :
|
|||
print "Unused modules:"
|
||||
print "-"*78
|
||||
avail_modules = []
|
||||
p = subprocess.Popen("module -l av " + modulepattern, shell=True, stderr=subprocess.PIPE).stderr
|
||||
r = re.compile("\(.*\)")
|
||||
p = subprocess.Popen("module av -t " + modulepattern, shell=True, stderr=subprocess.PIPE).stderr
|
||||
for line in p :
|
||||
if line[0] == '/' :
|
||||
continue
|
||||
if modulepattern in line :
|
||||
avail_modules.append(line.split()[0])
|
||||
avail_modules.append(r.sub('', line.strip()))
|
||||
for module in avail_modules :
|
||||
if not module in modulestats :
|
||||
print module
|
||||
|
|
Loading…
Reference in a new issue