Author: dmeyer
Date: Thu Nov 30 17:20:53 2006
New Revision: 2134

Modified:
   trunk/base/src/distribution/xmlconfig.py
   trunk/beacon/src/server/config.cxml
   trunk/popcorn/src/backends/gstreamer/config.cxml
   trunk/popcorn/src/backends/mplayer/config.cxml
   trunk/popcorn/src/backends/xine/config.cxml
   trunk/popcorn/src/config.cxml

Log:
remove <schema> from xml, use 4 spaces indent

Modified: trunk/base/src/distribution/xmlconfig.py
==============================================================================
--- trunk/base/src/distribution/xmlconfig.py    (original)
+++ trunk/base/src/distribution/xmlconfig.py    Thu Nov 30 17:20:53 2006
@@ -36,7 +36,6 @@
 
 
 def get_value(value, type):
-    print 'get', value, type
     if value is None:
         return eval('%s()' % type)
     if type is not None:
@@ -68,6 +67,14 @@
 
 class Parser(object):
 
+    def _get_schema(self, node):
+        schema = []
+        for child in node:
+            if hasattr(self, '_parse_%s' % child.name):
+                schema.append(child)
+        return schema
+
+    
     def parse(self, node, fd, deep=''):
         fd.write('%s(' % node.name.capitalize())
         first = True
@@ -118,42 +125,33 @@
         
 
     def _parse_group(self, node, fd, deep, first):
-        for child in node:
-            if child.name not in ('schema',):
-                continue
-            if not first:
-                fd.write(', ')
-            first = False
-            if child.name == 'schema':
-                deep = deep + '  '
-                fd.write('schema=[\n\n' + deep)
-                for schema in child.children:
-                    self.parse(schema, fd, deep)
-                    fd.write(',\n\n' + deep)
-                deep = deep[:-2]
-                fd.write(']\n' + deep)
+        if not first:
+            fd.write(', ')
+        deep = deep + '  '
+        fd.write('schema=[\n\n' + deep)
+        for s in self._get_schema(node):
+            self.parse(s, fd, deep)
+            fd.write(',\n\n' + deep)
+        deep = deep[:-2]
+        fd.write(']\n' + deep)
         fd.write(')')
     
     
     def _parse_list(self, node, fd, deep, first):
-        for child in node:
-            if child.name not in ('schema',):
-                continue
-            if not first:
-                fd.write(', ')
-            first = False
-            if child.name == 'schema':
-                fd.write('schema=')
-                if len(child.children) > 1:
-                    deep = deep + '  '
-                    fd.write('[\n\n' + deep)
-                for schema in child.children:
-                    self.parse(schema, fd, deep)
-                    if len(child.children) > 1:
-                        fd.write(',\n\n' + deep)
-                if len(child.children) > 1:
-                    deep = deep[:-2]
-                    fd.write(']\n' + deep)
+        if not first:
+            fd.write(', ')
+        schema = self._get_schema(node)
+        fd.write('schema=')
+        if len(schema) > 1:
+            deep = deep + '  '
+            fd.write('[\n\n' + deep)
+        for s in schema:
+            self.parse(s, fd, deep)
+            if len(schema) > 1:
+                fd.write(',\n\n' + deep)
+        if len(schema) > 1:
+            deep = deep[:-2]
+            fd.write(']\n' + deep)
         fd.write(')')
 
 

Modified: trunk/beacon/src/server/config.cxml
==============================================================================
--- trunk/beacon/src/server/config.cxml (original)
+++ trunk/beacon/src/server/config.cxml Thu Nov 30 17:20:53 2006
@@ -1,48 +1,40 @@
 <?xml version="1.0"?>
 <config>
-  <desc lang="en">Beacon configuration</desc>
-  <schema>
+    <desc lang="en">Beacon configuration</desc>
 
     <list name="monitors" default="True">
-      <desc lang="en">
-        List of directories to monitor, e.g.
-        monitors[0] = /media/mp3
-        monitors[1] = $(HOME)/mp3
-      </desc>
-      <schema>
+        <desc lang="en">
+            List of directories to monitor, e.g.
+            monitors[0] = /media/mp3
+            monitors[1] = $(HOME)/mp3
+        </desc>
         <var type="str">
-          <desc>Path of directory</desc>
+            <desc>Path of directory</desc>
         </var>
-      </schema>
     </list>
 
     <group name="crawler">
-      <desc>Settings for filesystem crawler</desc>
-      <schema>
+        <desc>Settings for filesystem crawler</desc>
         <var name="scantime" type="float" default="0.04">
-          <desc>
-            Internal timer for scanning. Decreasing it will speed up the 
scanner
-            but slow down the system. Increasing it will save CPU time and slow
-            machines.
-          </desc>
+            <desc>
+                Internal timer for scanning. Decreasing it will speed up the 
scanner
+                but slow down the system. Increasing it will save CPU time and 
slow
+                machines.
+            </desc>
         </var>
         <var name="growscan" default="10">
-          <desc>
-            Internal in seconds how often still growing files should be
-            scanned
-          </desc>
+            <desc>
+                Internal in seconds how often still growing files should be
+                scanned
+            </desc>
         </var>
-      </schema>
     </group>
 
     <dict name="plugins">
-      <desc>Dict of plugins to enable (True/False)</desc>
-      <schema>
+        <desc>Dict of plugins to enable (True/False)</desc>
         <var default="False">
-          <desc>Enable plugin</desc>
+            <desc>Enable plugin</desc>
         </var>
-      </schema>
     </dict>
 
-  </schema>
 </config>

Modified: trunk/popcorn/src/backends/gstreamer/config.cxml
==============================================================================
--- trunk/popcorn/src/backends/gstreamer/config.cxml    (original)
+++ trunk/popcorn/src/backends/gstreamer/config.cxml    Thu Nov 30 17:20:53 2006
@@ -1,9 +1,7 @@
 <?xml version="1.0"?>
 <config>
-  <desc lang="en">gstreamer configuration</desc>
-  <schema>
+    <desc lang="en">gstreamer configuration</desc>
     <var name="activate" default="False">
-      <desc lang="en">activate backend</desc>
+        <desc lang="en">activate backend</desc>
     </var>
-  </schema>
 </config>

Modified: trunk/popcorn/src/backends/mplayer/config.cxml
==============================================================================
--- trunk/popcorn/src/backends/mplayer/config.cxml      (original)
+++ trunk/popcorn/src/backends/mplayer/config.cxml      Thu Nov 30 17:20:53 2006
@@ -1,9 +1,7 @@
 <?xml version="1.0"?>
 <config>
-  <desc lang="en">mplayer configuration</desc>
-  <schema>
+    <desc lang="en">mplayer configuration</desc>
     <var name="activate" default="True">
-      <desc lang="en">activate backend</desc>
+        <desc lang="en">activate backend</desc>
     </var>
-  </schema>
 </config>

Modified: trunk/popcorn/src/backends/xine/config.cxml
==============================================================================
--- trunk/popcorn/src/backends/xine/config.cxml (original)
+++ trunk/popcorn/src/backends/xine/config.cxml Thu Nov 30 17:20:53 2006
@@ -1,27 +1,23 @@
 <?xml version="1.0"?>
 <config>
-  <desc lang="en">mplayer configuration</desc>
-  <schema>
+    <desc lang="en">mplayer configuration</desc>
     <var name="activate" default="True">
-      <desc lang="en">activate backend</desc>
+        <desc lang="en">activate backend</desc>
     </var>
     <group name="deinterlacer">
-      <desc>Deinterlacer options</desc>
-      <schema>
+        <desc>Deinterlacer options</desc>
         <var name="method" default="GreedyH">
-          <desc lang="en">
-            tvtime method to use, e.g. TomsMoComp, GreedyH, LinearBlend, etc.
-          </desc>
+            <desc lang="en">
+                tvtime method to use, e.g. TomsMoComp, GreedyH, LinearBlend, 
etc.
+            </desc>
         </var>
         <var name="chroma_filter" default="False">
-          <desc lang="en">
-            Enable chroma filtering (better quality, higher cpu usage)         
 
-          </desc>
+            <desc lang="en">
+                Enable chroma filtering (better quality, higher cpu usage)
+            </desc>
         </var>
-      </schema>
     </group>
     <var name="vsync" default="True">
-      <desc lang="en">Enable vsync via OpenGL (applies only to X11 
visuals)</desc>
+        <desc lang="en">Enable vsync via OpenGL (applies only to X11 
visuals)</desc>
     </var>
-  </schema>
 </config>

Modified: trunk/popcorn/src/config.cxml
==============================================================================
--- trunk/popcorn/src/config.cxml       (original)
+++ trunk/popcorn/src/config.cxml       Thu Nov 30 17:20:53 2006
@@ -1,76 +1,69 @@
 <?xml version="1.0"?>
 <config>
-  <desc lang="en">player configuration</desc>
-  <schema>
-
+    <desc lang="en">player configuration</desc>
     <var name="preferred" default="xine">
-      <values>
-       <value>xine</value>
-       <value>mplayer</value>
-       <value>gstreamer</value>
-      </values>
-      <desc lang="en">
-        Preferred player backend.
-      </desc>
+        <values>
+            <value>xine</value>
+            <value>mplayer</value>
+            <value>gstreamer</value>
+        </values>
+        <desc lang="en">
+            Preferred player backend.
+        </desc>
     </var>
 
     <var name="widescreen" default="bars">
-      <values>
-        <value>bars</value>
-        <value>zoom</value>
-        <value>scale</value>
-      </values>
-      <desc lang="en">
-        How to handle 4:3 content on 16:9 screens. Possible values are
-        bars:  add black bars on the left and on the right
-        zoom:  zoom into the video, drop content on top and bottom
-        scale: ignore aspect ratio and fill the screen
-      </desc>
+        <values>
+            <value>bars</value>
+            <value>zoom</value>
+            <value>scale</value>
+        </values>
+        <desc lang="en">
+            How to handle 4:3 content on 16:9 screens. Possible values are
+            bars:  add black bars on the left and on the right
+            zoom:  zoom into the video, drop content on top and bottom
+            scale: ignore aspect ratio and fill the screen
+        </desc>
     </var>
-    
+
     <group name="audio">
-      <desc lang="en">audio settings</desc>
-      <schema>
+        <desc lang="en">audio settings</desc>
         <var name="driver" default="alsa">
-          <values>
-            <value>alsa</value>
-            <value>oss</value>
-          </values>
-          <desc>audio driver (alsa or oss)</desc>
+            <values>
+                <value>alsa</value>
+                <value>oss</value>
+            </values>
+            <desc>audio driver (alsa or oss)</desc>
         </var>
         <group name="device">
-          <desc lang="en">
-            Device settings (only used by alsa). Set them to a specific alsa
-            device, e.g. hw:0,0 or default or special devices like
-            plug:front:default. If not set, player defaults will be used.
-          </desc>
-          <schema>
+            <desc lang="en">
+                Device settings (only used by alsa). Set them to a specific 
alsa
+                device, e.g. hw:0,0 or default or special devices like
+                plug:front:default. If not set, player defaults will be used.
+            </desc>
             <var name="mono" type="str"/>
             <var name="stereo" type="str"/>
             <var name="surround40" type="str"/>
             <var name="surround51" type="str"/>
             <var name="passthrough" type="str"/>
-          </schema>
         </group>
         <var name="channels" default="2">
-          <values>
-            <value>2</value>
-            <value>4</value>
-            <value>6</value>
-          </values>
-          <desc>number of channels (2, 4 or 6)</desc>
+            <values>
+                <value>2</value>
+                <value>4</value>
+                <value>6</value>
+            </values>
+            <desc>number of channels (2, 4 or 6)</desc>
         </var>
         <var name="passthrough" default="False">
-          <desc>AC3 and DTS passthrough</desc>
+            <desc>AC3 and DTS passthrough</desc>
         </var>
-      </schema>
     </group>
-  </schema>
 
-  <code>
-    import backends
-    
-    for n, c in backends.config:
-      config.add_variable(n, c)
-  </code>
+    <code>
+        import backends
+
+        for n, c in backends.config:
+        config.add_variable(n, c)
+    </code>
 </config>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to