Author: dmeyer
Date: Sun Mar 18 14:04:49 2007
New Revision: 9349

Modified:
   trunk/tvserver/src/favorite.py
   trunk/tvserver/src/recording.py
   trunk/tvserver/src/server.py

Log:
use new fxdparser and not kaa.xml

Modified: trunk/tvserver/src/favorite.py
==============================================================================
--- trunk/tvserver/src/favorite.py      (original)
+++ trunk/tvserver/src/favorite.py      Sun Mar 18 14:04:49 2007
@@ -37,7 +37,6 @@
 import logging
 
 # kaa imports
-from kaa import xml
 from kaa.strutils import unicode_to_str, str_to_unicode
 
 # record imports
@@ -224,11 +223,11 @@
                (self.id, unicode_to_str(name), self.priority, once, substring)
 
 
-    def __xml__(self):
+    def toxml(self, root):
         """
         Dump informations about the favorite in a fxd file node.
         """
-        node = xml.Node('favorite', id=self.id)
+        node = root.add_child('favorite', id=self.id)
         for var in ('name', 'priority', 'url', 'fxdname'):
             if getattr(self, var):
                 node.add_child(var, getattr(self, var))

Modified: trunk/tvserver/src/recording.py
==============================================================================
--- trunk/tvserver/src/recording.py     (original)
+++ trunk/tvserver/src/recording.py     Sun Mar 18 14:04:49 2007
@@ -40,9 +40,11 @@
 import os
 
 # kaa imports
-from kaa import xml
 from kaa.strutils import unicode_to_str, str_to_unicode
 
+# freevo imports
+import freevo.fxdparser2
+
 # record imports
 from config import config
 from record_types import *
@@ -196,11 +198,11 @@
                 stop_padding, unicode_to_str(status))
 
 
-    def __xml__(self):
+    def toxml(self, root):
         """
         Dump informations about the recording in a fxd file node.
         """
-        node = xml.Node('recording', id=self.id)
+        node = root.add_child('recording', id=self.id)
         for var in ('name', 'channel', 'priority', 'status',
                     'subtitle', 'fxdname', 'episode', 'description'):
             if getattr(self, var):
@@ -271,7 +273,7 @@
             return
 
         # create root node
-        fxd = xml.Document(root='freevo')
+        fxd = freevo.fxdparser2.Document()
 
         # create <movie> with title
         title = self.name

Modified: trunk/tvserver/src/server.py
==============================================================================
--- trunk/tvserver/src/server.py        (original)
+++ trunk/tvserver/src/server.py        Sun Mar 18 14:04:49 2007
@@ -40,10 +40,10 @@
 
 import kaa.notifier
 from kaa.notifier import Timer, OneShotTimer, Callback, execute_in_timer
-from kaa import xml
 
 # freevo imports
 import freevo.ipc
+import freevo.fxdparser2
 
 # record imports
 from config import config
@@ -255,12 +255,12 @@
             return
 
         try:
-            fxd = xml.Document(self.fxdfile, 'freevo')
+            fxd = freevo.fxdparser2.Document(self.fxdfile)
         except Exception, e:
             log.exception('recordserver.load: %s corrupt:' % self.fxdfile)
             sys.exit(1)
 
-        for child in fxd:
+        for child in fxd.children:
             if child.name == 'recording':
                 try:
                     r = Recording(node=child)
@@ -293,11 +293,11 @@
         save the fxd file
         """
         log.info('save fxd file')
-        fxd = xml.Document(root='freevo')
+        fxd = freevo.fxdparser2.Document()
         for r in self.recordings:
-            fxd.add_child(r)
+            r.toxml(fxd)
         for f in self.favorites:
-            fxd.add_child(f)
+            f.toxml(fxd)
         fxd.save(self.fxdfile)
 
 

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