[kernel-team] 71/86: kconfigeditor/kconfig/menu/all.py: - Always only accept files included by arch. - Don't exclude arch/Kconfig.

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Mon Dec 21 00:35:00 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 7ad87e6d137542aaf831b62cb9a1878ac30f7f84
Author: Bastian Blank <waldi at debian.org>
Date:   Tue Sep 10 20:20:44 2013 +0000

    kconfigeditor/kconfig/menu/all.py:
    - Always only accept files included by arch.
    - Don't exclude arch/Kconfig.
    
    svn path=/people/waldi/utils/kconfigeditor2/; revision=20595
---
 .../kconfigeditor/kconfig/menu/all.py              | 37 +++++++++++-----------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/utils/kconfigeditor2/kconfigeditor/kconfig/menu/all.py b/utils/kconfigeditor2/kconfigeditor/kconfig/menu/all.py
index 044fe75..da01767 100644
--- a/utils/kconfigeditor2/kconfigeditor/kconfig/menu/all.py
+++ b/utils/kconfigeditor2/kconfigeditor/kconfig/menu/all.py
@@ -10,12 +10,13 @@ class All(object):
     def __init__(self, root, arches):
         self.root = root
 
-        self._files = {}
-        self._filenames = set()
-        self._filenames_arch = {}
+        files = self._files = {}
+        files_global = files[None] = []
+
+        cache = {}
 
         for arch in arches:
-            self._filenames_arch[arch] = set()
+            files_arch = files[arch] = []
 
             work = ["arch/%s/Kconfig" % arch]
 
@@ -23,29 +24,27 @@ class All(object):
                 filename = work.pop(0)
                 filename_list = filename.split('/')
 
-                if filename_list[0] == 'arch' or filename_list[0] == 'drivers' and filename_list[1] in arches:
-                    self._filenames_arch[arch].add(filename)
-                else:
-                    self._filenames.add(filename)
-
-                if filename in self._files:
-                    f = self._files[filename]
-                else:
-                    f = self._files.setdefault(filename, self.read(filename))
+                f = cache.get(filename)
+                if not f:
+                    f = cache[filename] = self.read(filename)
 
                 for i in f:
                     if isinstance(i, MenuEntrySource):
                         work.append(i.filename)
 
+                files_arch.append(f)
+
+                if not (filename_list[0] == 'arch' and len(filename_list) > 2 or
+                        filename_list[0] == 'drivers' and filename_list[1] in arches):
+                    files_global.append(f)
+
     def __iter__(self):
-        for filename in self._filenames:
-            yield self._files[filename]
+        for i in self._files[None]:
+            yield i
 
     def arch(self, arch):
-        for filename in self._filenames_arch[arch]:
-            yield self._files[filename]
-        for filename in self._filenames:
-            yield self._files[filename]
+        for i in self._files[arch]:
+            yield i
 
     def read(self, filename):
          return Parser()(file(os.path.join(self.root, filename)), filename)

-- 
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