  
      def discover(self,path):
          d = discoverer.Discoverer(path)
-diff -ru subtle/Subtitles/Discoverer.py subtle-new-with-kate/Subtitles/Discoverer.py
---- subtle/Subtitles/Discoverer.py	2008-06-30 11:32:29.000000000 +0100
-+++ subtle-new-with-kate/Subtitles/Discoverer.py	2008-06-30 20:59:45.000000000 +0100
-@@ -21,6 +21,7 @@
- 
- import os
- from SubRip import SubRip
-+from Kate import KateLoader
- 
- def discoverer(file):
+diff -ru /mnt/cdrom/svn/xiph/subtle/Subtitles/Discoverer.py subtle/Subtitles/Discoverer.py
+--- /mnt/cdrom/svn/xiph/subtle/Subtitles/Discoverer.py	2008-08-08 16:52:38.000000000 +0100
++++ subtle/Subtitles/Discoverer.py	2008-08-09 19:37:23.000000000 +0100
+@@ -41,10 +41,10 @@
+ 
+     for func in discover_funcs:
+         print "Testing this func: %s" % func
+-        handle = func(file)
+-        if handle is not None:
+-            print "I have found a handle: %s" % handle
+-            return handle(file)
++        handles = func(file)
++        if handles is not None:
++            print "I have found a handle list: %s" % handles
++            return handles
+     else:
+         print '----'            
+ 
+diff -ru /mnt/cdrom/svn/xiph/subtle/Subtitles/Formats/Softni.py subtle/Subtitles/Formats/Softni.py
+--- /mnt/cdrom/svn/xiph/subtle/Subtitles/Formats/Softni.py	2008-08-08 16:52:38.000000000 +0100
++++ subtle/Subtitles/Formats/Softni.py	2008-08-09 19:59:44.000000000 +0100
+@@ -53,6 +53,9 @@
+         file.
      """
-@@ -32,5 +33,12 @@
-     # TODO: For text based files we should check using
-     ## regex , not extensions
-     if extension == ".srt":
--        return SubRip(file)
-+        return { 'lone': SubRip(file) }
-+
-+    # Try Kate streams
-+    kate = KateLoader(file)
-+    subs = kate.get_subs()
-+    if subs:
-+        return subs
-+
-     return None
-diff -ru subtle/Subtitles/__init__.py subtle-new-with-kate/Subtitles/__init__.py
---- subtle/Subtitles/__init__.py	2008-06-30 11:32:29.000000000 +0100
-+++ subtle-new-with-kate/Subtitles/__init__.py	2008-06-30 21:16:12.000000000 +0100
-@@ -18,5 +18,5 @@
- #       along with this program; if not, write to the Free Software
- #       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- #       MA 02110-1301, USA.
--__all__=["Subtitles", "SubRip","Discoverer","Line"]
-+__all__=["Subtitles", "SubRip", "Kate", "Discoverer","Line"]
- 
-diff -ru subtle/Subtitles/Sub.py subtle-new-with-kate/Subtitles/Sub.py
---- subtle/Subtitles/Sub.py	2008-06-30 11:32:29.000000000 +0100
-+++ subtle-new-with-kate/Subtitles/Sub.py	2008-07-26 12:11:59.000000000 +0100
-@@ -77,4 +77,12 @@
-             Set the subtitle text and this method will rearrange the
-             structure of lines as well as all other attributes.
-         """
-+        self.lines = []
-+        self._processText(text)
-         pass
-+
-+    def getSubStartTime(self):
-+        return self.start_time
-+
-+    def getSubEndTime(self):
-+        return self.end_time
-diff -ru subtle/Subtitles/SubRip.py subtle-new-with-kate/Subtitles/SubRip.py
---- subtle/Subtitles/SubRip.py	2008-06-30 11:32:29.000000000 +0100
-+++ subtle-new-with-kate/Subtitles/SubRip.py	2008-07-01 07:21:47.000000000 +0100
-@@ -47,8 +47,8 @@
+ 
++    # FIXME: magic has no open function in my copy of python-magic, so bypass this for now
++    return
++
+     m = magic.open(magic.MAGIC_COMPRESS | magic.MAGIC_MIME)
+     status = m.load()
+ 
+@@ -70,7 +73,7 @@
+     regex = re.compile(rawstr,  re.MULTILINE| re.VERBOSE)
+ 
+     if regex.search(data):
+-        return Softni
++        return Softni(file)
+     return
+     
+ class Softni(Subtitles):
+diff -ru /mnt/cdrom/svn/xiph/subtle/Subtitles/Formats/SubRip.py subtle/Subtitles/Formats/SubRip.py
+--- /mnt/cdrom/svn/xiph/subtle/Subtitles/Formats/SubRip.py	2008-08-08 16:52:38.000000000 +0100
++++ subtle/Subtitles/Formats/SubRip.py	2008-08-09 19:44:26.000000000 +0100
+@@ -45,6 +45,9 @@
+         file.
+     """ 
+ 
++    # FIXME: magic has no open function in my copy of python-magic, so bypass this for now
++    return
++
+     m = magic.open(magic.MAGIC_COMPRESS | magic.MAGIC_MIME)
+     status = m.load()
+     
+@@ -64,7 +67,7 @@
+     print "BEGIN: Test for SubRip"
+     if regex.search(data):
+         print "END: Test for SubRip"
+-        return SubRip
++        return SubRip(file)
+     return
+ 
+ class SubRip(Subtitles):
+@@ -94,8 +97,8 @@
      ## Save subtitles.
      # Save subtitles to the file.
      # \param FN - file name.

     ## Get subtitle supported types.
     # Get subtitle supported types
     # \return supported subtitle types 
diff -ru subtle/Subtle.py subtle-new-with-kate/Subtle.py
--- subtle/Subtle.py	2008-06-30 11:32:29.000000000 +0100
+++ subtle-new-with-kate/Subtle.py	2008-07-27 20:47:32.000000000 +0100
@@ -246,8 +246,8 @@
             model, iter = result
             if self.subsListStore.iter_is_valid(iter):
                 cur, sTime, eTime = self.subsListStore.get(iter, 0, 1, 2)

+            parser.link(self.oggmux)
+            self.parsers.append(parser)
+
+            parser.set_state(gst.STATE_READY)
+            queue.set_state(gst.STATE_READY)
+            self.oggmux_sources.append(parser)
+            self.oggmux_sources.append(queue)
+
+
+
+
+
+class Kate(Subtitles):
+    """
+        This class handles the Kate subtitle format
+    """
+
+    def __init__(self, filename):
+        """
+            constructor: loads subtitles from a file
+        """
+
+        print 'Kate subtitles module init for %s' % filename
+        Subtitles.__init__(self, filename)
+        self.encoding = "FIXME: I have no idea what this is for ? character encoding ?"
+        self.subType = "Kate"
+        self.subUserdata = None
+
+    def subSave(self, filename, subs):
+        kate = KateSaver(filename, subs)
+
+    def subInit(self, language, category, serial):
+        """
+            Sets up the subtitles object with information read from a Kate stream
+        """
+
+        print 'Kate subtitles module subInit for %s %s on %s' % (language, category, serial)
+        self.subLanguage = language
+        self.subCategory = category
+        self.subUserdata = serial
