[kernel-team] 38/86: lib/kconfigeditor/kconfig: Update.

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Mon Dec 21 00:34:56 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 939a63024f44d8765a1ae73bb8a4765644e2ec73
Author: Bastian Blank <waldi at debian.org>
Date:   Wed May 7 20:04:22 2008 +0000

    lib/kconfigeditor/kconfig: Update.
    
    svn path=/people/waldi/utils/kconfigeditor2/; revision=11323
---
 .../lib/kconfigeditor/kconfig/menu/all.py            |  8 ++++----
 .../lib/kconfigeditor/kconfig/menu/file.py           | 13 ++++++++++---
 .../lib/kconfigeditor/kconfig/package/files.py       | 20 ++++++++++++++++----
 3 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/all.py b/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/all.py
index 2404629..a82f445 100644
--- a/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/all.py
+++ b/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/all.py
@@ -15,9 +15,9 @@ class All(object):
             while work:
                 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].append(filename)
-                else:
+
+                self.filenames_arch[arch].append(filename)
+                if not (filename_list[0] == 'arch' or filename_list[0] == 'drivers' and filename_list[1] in arches):
                     self.filenames_all.append(filename)
 
                 if filename in self.files:
@@ -35,7 +35,7 @@ class All(object):
 
         self.files_arch = {}
         for arch in arches:
-            f = self.files_all.copy()
+            f = {}
             for i in self.filenames_arch[arch]:
                 f[i] = self.files[i]
             self.files_arch[arch] = f
diff --git a/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/file.py b/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/file.py
index 2939842..0e7ebd5 100644
--- a/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/file.py
+++ b/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/file.py
@@ -22,11 +22,14 @@ class FileChoice(list):
         return "<%s(%r)>" % (self.__class__.__name__, self.prompt)
 
 class FileConfig(object):
-    def __init__(self, name, prompt = None):
-        self.name, self.prompt = name, prompt
+    TYPE_BOOL = 1
+    TYPE_TRISTATE = 2
+
+    def __init__(self, name, type = None, prompt = None):
+        self.name, self.type, self.prompt = name, type, prompt
 
     def __repr__(self):
-        return "<%s(%r, %r)>" % (self.__class__.__name__, self.name, self.prompt)
+        return "<%s(%r, %r, %r)>" % (self.__class__.__name__, self.name, self.type, self.prompt)
 
 class FileSource(object):
     def __init__(self, filename):
@@ -242,6 +245,7 @@ $"""
             _Expression(self, text)
 
     def process_bool(self, text, ind):
+        self.entry.type = FileConfig.TYPE_BOOL
         # TODO
         self._process_prompt(text, ind)
 
@@ -251,9 +255,11 @@ $"""
         _Expression(self, text)
 
     def process_def_bool(self, text, ind):
+        self.entry.type = FileConfig.TYPE_BOOL
         _Expression(self, text)
 
     def process_def_tristate(self, text, ind):
+        self.entry.type = FileConfig.TYPE_TRISTATE
         _Expression(self, text)
 
     def process_help(self, text, ind):
@@ -287,6 +293,7 @@ $"""
         self._process_prompt(text, ind)
 
     def process_tristate(self, text, ind):
+        self.entry.type = FileConfig.TYPE_TRISTATE
         # TODO
         self._process_prompt(text, ind)
 
diff --git a/utils/kconfigeditor2/lib/kconfigeditor/kconfig/package/files.py b/utils/kconfigeditor2/lib/kconfigeditor/kconfig/package/files.py
index 8c1b3ec..6c04b1c 100644
--- a/utils/kconfigeditor2/lib/kconfigeditor/kconfig/package/files.py
+++ b/utils/kconfigeditor2/lib/kconfigeditor/kconfig/package/files.py
@@ -112,11 +112,19 @@ class File(dict):
 
     def _dump_file_choice(self, processed, ignored, have_prompt, f):
         ret = []
+        nr = 0
         for i in f:
             if isinstance(i, FileConfig):
-                ret.extend(self._dump_file_config(processed, ignored, have_prompt, i))
+                r = self._dump_file_config(processed, ignored, have_prompt, i)
+                if r:
+                    ret.extend(r)
+                    nr += 1
+        incomplete = len(f) != nr
         if ret:
-            ret.insert(0, "## choice: %s" % f.prompt)
+            if incomplete and 0:
+                ret.insert(0, "## choice: INCOMPLETE: %s" % f.prompt)
+            else:
+                ret.insert(0, "## choice: %s" % f.prompt)
             ret.append('## end choice')
         return ret
 
@@ -134,7 +142,7 @@ class File(dict):
                 ignored.add(i.name)
                 return []
         processed.add(i.name)
-        return e.dump()
+        return e.dump(i)
 
     def _dump_file(self, processed, ignored, have_prompt, f):
         ret = []
@@ -242,8 +250,12 @@ class FileEntry(object):
     def __init__(self, name, comments):
         self.name, self.comments = name, comments
 
-    def dump(self):
+    def dump(self, config):
         ret = ["#. %s" % i for i in self.comments]
+#        if config.type == FileConfig.TYPE_BOOL:
+#            ret.append("# type: bool")
+#        elif config.type == FileConfig.TYPE_TRISTATE:
+#            ret.append("# type: tristate")
         ret.append(str(self))
         return ret
 

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