[kernel-team] 03/86: Update.

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Mon Dec 21 00:34:52 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 bc45e058f38e1ca94e6b4d40e0515abf98470b05
Author: Bastian Blank <waldi at debian.org>
Date:   Tue Mar 11 14:28:19 2008 +0000

    Update.
    
    svn path=/people/waldi/utils/kconfigeditor2/; revision=10788
---
 .../kconfigeditor/kconfig/menu/file.py             | 24 +++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/utils/kconfigeditor2/kconfigeditor/kconfig/menu/file.py b/utils/kconfigeditor2/kconfigeditor/kconfig/menu/file.py
index ea97735..8bbd169 100644
--- a/utils/kconfigeditor2/kconfigeditor/kconfig/menu/file.py
+++ b/utils/kconfigeditor2/kconfigeditor/kconfig/menu/file.py
@@ -11,14 +11,21 @@ class FileConfig(object):
     def __repr__(self):
         return "<%s(%s)>" % (self.__class__.__name__, self.name)
 
+class FileSource(object):
+    def __init__(self, filename):
+        self.filename = filename
+
+    def __repr__(self):
+        return "<%s(%s)>" % (self.__class__.__name__, self.filename)
+
 class _Parser(object):
-    def __call__(self, filename):
+    def __call__(self, fd, filename):
         lineno = 0
 
         stack = _Stack()
         _BlockRoot(stack, File(filename))
 
-        for line in file(filename):
+        for line in fd:
             line = line.rstrip()
             if not line:
                 stack.top().process_line_empty()
@@ -93,9 +100,9 @@ class _BlockContainer(object):
     (?P<ind>\s*)
     (---)?(?P<word>[a-z_]+)(---)?
     (
-        \s+(?P<rest1>.+)
+        \s*"(?P<rest2>.+)"
         |
-        "(?P<rest2>.+)"
+        \s+(?P<rest1>.+)
     )?
     \s*
 $"""
@@ -129,7 +136,7 @@ class _BlockContainerCommon(_BlockContainer):
         _BlockMenuconfig(self, text)
 
     def process_source(self, text, ind):
-        pass
+        _BlockSource(self, text)
 
 class _BlockContainerDepends(_BlockContainer):
     def process_depends(self, text, ind):
@@ -289,6 +296,12 @@ class _BlockMenuconfig(_BlockMenu):
         self.entry = parent.entry
         _BlockConfigData(self)
 
+class _BlockSource(_BlockObject):
+    def __init__(self, parent, text):
+        super(_BlockSource, self).__init__(parent)
+        self.entry = FileSource(text)
+        parent.entry.append(self.entry)
+
 class _BlockType(_BlockObject):
     def __init__(self, parent, text, ind):
         super(_BlockType, self).__init__(parent)
@@ -301,3 +314,4 @@ class _BlockType(_BlockObject):
                 self.nextline = False
         else:
             return self.recurse('process_line', text)
+

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