[xiph-cvs] cvs commit: positron/positron config.py

Stan Seibert volsung at xiph.org
Mon Jun 30 18:21:29 PDT 2003



volsung     03/06/30 21:21:29

  Modified:    positron config.py
  Log:
  Ability to disable MP3 support.  (Useful for testing beta firmware)

Revision  Changes    Path
1.3       +18 -1     positron/positron/config.py

Index: config.py
===================================================================
RCS file: /usr/local/cvsroot/positron/positron/config.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- config.py	9 Jun 2003 01:04:46 -0000	1.2
+++ config.py	1 Jul 2003 01:21:29 -0000	1.3
@@ -72,6 +72,7 @@
         self.recordingdir = None
         self.neuros_musicdir = "MUSIC"
         self.sort_database = True
+        self.mp3_support = True
         self.oggvorbis_support = False
         self.syncdirs = []
 
@@ -102,7 +103,10 @@
         """Convenience method for getting the list of music types enabled
         in the config file"""
 
-        types = ["mp3"]
+        types = []
+
+        if self.mp3_support:
+            types.append("mp3")
 
         if self.oggvorbis_support:
             types.append("oggvorbis")
@@ -212,6 +216,13 @@
                         raise Error(tokenizer.error_leader()
                                     +"Non boolean value '%s' given for %s",
                                     (value, key))
+                elif key == "mp3_support":
+                    try:
+                        self.mp3_support = parse_boolean(value)
+                    except Error:
+                        raise Error(tokenizer.error_leader()
+                                    +"Non boolean value '%s' given for %s",
+                                    (value, key))
                 else:
                     print tokenizer.error_leader() \
                           + "Ignoring unknown option %s" % (key,)
@@ -245,6 +256,12 @@
         else:
             oggvorbis_support_value = "false"
         f.write("oggvorbis_support=%s\n" % (oggvorbis_support_value,))
+
+        if self.mp3_support:
+            mp3_support_value = "true"
+        else:
+            mp3_support_value = "false"
+        f.write("mp3_support=%s\n" % (mp3_support_value,))
 
         for (src,dest) in self.syncdirs:
             f.write("\nbegin sync\n")

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list