[kernel-team] 61/86: bin/show-enabled.py: Add.
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Mon Dec 21 00:34:59 UTC 2015
This is an automated email from the git hooks/post-receive script.
benh pushed a commit to branch benh/kconfigeditor2
in repository kernel-team.
commit e769904df2fda685b18fb5a8218a5e4ae8c1f0f1
Author: Bastian Blank <waldi at debian.org>
Date: Fri Dec 4 14:02:07 2009 +0000
bin/show-enabled.py: Add.
svn path=/people/waldi/utils/kconfigeditor2/; revision=14724
---
utils/kconfigeditor2/bin/show-enabled.py | 56 ++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/utils/kconfigeditor2/bin/show-enabled.py b/utils/kconfigeditor2/bin/show-enabled.py
new file mode 100755
index 0000000..22f9b08
--- /dev/null
+++ b/utils/kconfigeditor2/bin/show-enabled.py
@@ -0,0 +1,56 @@
+#!/usr/bin/python2.6
+
+import itertools
+import optparse
+import os
+import sys
+
+
+class Option(object):
+ def __init__(self, name):
+ self.name = name
+ self.values = {}
+
+ def add(self, value, filename):
+ v = self.values.setdefault(value, [])
+ v.append(filename)
+
+
+class Main(object):
+ def __init__(self, package):
+ from kconfigeditor.package import Package
+
+ package = Package(package)
+
+ options = {}
+
+ for filename, data in package.items():
+ for name, value in data.file.iteritems():
+ option = options.setdefault(name, Option(name))
+ option.add(value, filename)
+
+ for name, option in sorted(options.iteritems()):
+ if len(option.values) > 1:
+ for value, filenames in option.values.iteritems():
+ print value
+ print 'in', ' '.join(sorted(filenames))
+ print
+
+
+if __name__ == '__main__':
+ try:
+ import kconfigeditor
+ except ImportError:
+ sys.path.append(os.path.join(sys.path[0], '../lib'))
+
+ options = optparse.OptionParser(
+ usage = "%prog [OPTION]... PACKAGE"
+ )
+
+ opts, args = options.parse_args()
+
+ if len(args) != 1:
+ options.error("Too less arguments")
+
+ Main(*args)
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/kernel-team.git
More information about the Kernel-svn-changes
mailing list