[kernel] r11323 - in people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig: menu package

Bastian Blank waldi at alioth.debian.org
Wed May 7 20:04:23 UTC 2008


Author: waldi
Date: Wed May  7 20:04:22 2008
New Revision: 11323

Log:
lib/kconfigeditor/kconfig: Update.


Modified:
   people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/all.py
   people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/file.py
   people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/package/files.py

Modified: people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/all.py
==============================================================================
--- people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/all.py	(original)
+++ people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/all.py	Wed May  7 20:04:22 2008
@@ -15,9 +15,9 @@
             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 @@
 
         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

Modified: people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/file.py
==============================================================================
--- people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/file.py	(original)
+++ people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/menu/file.py	Wed May  7 20:04:22 2008
@@ -22,11 +22,14 @@
         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)
 

Modified: people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/package/files.py
==============================================================================
--- people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/package/files.py	(original)
+++ people/waldi/utils/kconfigeditor2/lib/kconfigeditor/kconfig/package/files.py	Wed May  7 20:04:22 2008
@@ -112,11 +112,19 @@
 
     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 @@
                 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 @@
     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
 



More information about the Kernel-svn-changes mailing list