alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: David Henningsson <david.henningsson@canonical.com>
To: tiwai@suse.de, perex@perex.cz, alsa-devel@alsa-project.org
Cc: David Henningsson <david.henningsson@canonical.com>
Subject: [PATCH] hda-analyzer: Make parsing code more robust against future proc file changes
Date: Thu,  7 Feb 2013 14:47:33 +0100	[thread overview]
Message-ID: <1360244853-22301-1-git-send-email-david.henningsson@canonical.com> (raw)

Historically, new additions to the codec proc file has crashed hda-analyzer.
With this patch, new additions will instead be ignored.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 hda-analyzer/hda_proc.py |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/hda-analyzer/hda_proc.py b/hda-analyzer/hda_proc.py
index 3d544c8..10aa662 100644
--- a/hda-analyzer/hda_proc.py
+++ b/hda-analyzer/hda_proc.py
@@ -644,9 +644,8 @@ class HDACodecProc(HDACodec, HDABaseProc):
     if line == 'Invalid AFG subtree':
       print "Invalid AFG subtree for codec %s?" % self.proc_codec_id
       return
-    while line.startswith('Power-Map: ') or \
-          line.startswith('Analog Loopback: '):
-      print 'Sigmatel specific "%s" verb ignored for the moment' % line
+    while not line.startswith('Node '):
+      print 'Vendor specific "%s" verb ignored at the moment' % line
       idx += 1
       line = lines[idx].strip()
     node = None
@@ -728,7 +727,7 @@ class HDACodecProc(HDACodec, HDABaseProc):
         elif line.startswith('  Volume-Knob: '):
           node.add_volknob(line[15:])
         else:
-          self.wrongfile(line)
+          print 'Node line "%s" ignored at the moment' % line
         idx += 1
         if idx < len(lines):
           line = lines[idx]
-- 
1.7.9.5

                 reply	other threads:[~2013-02-07 13:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360244853-22301-1-git-send-email-david.henningsson@canonical.com \
    --to=david.henningsson@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).