Author: jstowers
Date: Tue Jan 15 13:10:39 2008
New Revision: 1223
URL: http://svn.gnome.org/viewvc/conduit?rev=1223&view=rev

Log:
2008-01-16  John Carr <[EMAIL PROTECTED]>

        * conduit/datatypes/DataType.py: Use rid instead of hash when testing
        if two datatypes are equal
        
        * conduit/modules/TomboyModule.py: Add a string.partition alternative 
for
        those people using Python 2.4



Modified:
   trunk/ChangeLog
   trunk/conduit/datatypes/DataType.py
   trunk/conduit/modules/TomboyModule.py

Modified: trunk/conduit/datatypes/DataType.py
==============================================================================
--- trunk/conduit/datatypes/DataType.py (original)
+++ trunk/conduit/datatypes/DataType.py Tue Jan 15 13:10:39 2008
@@ -56,7 +56,7 @@
         """
         log.debug("COMPARE: %s <----> %s " % (self.get_UID(), B.get_UID()))
 
-        if self.get_hash() == B.get_hash():
+        if self.get_rid() == B.get_rid():
             return conduit.datatypes.COMPARISON_EQUAL
 
         mtime1 = self.get_mtime()

Modified: trunk/conduit/modules/TomboyModule.py
==============================================================================
--- trunk/conduit/modules/TomboyModule.py       (original)
+++ trunk/conduit/modules/TomboyModule.py       Tue Jan 15 13:10:39 2008
@@ -19,12 +19,21 @@
        "TomboyNoteConverter" :     { "type": "converter"       }
 }
 
+def partition(txt, sep):
+    try:
+        return txt.partition(sep)
+    except:
+        if not sep in txt:
+            return (txt, '', '')
+        else:
+            return (txt[:txt.find(sep)], sep, txt[txt.find(sep)+len(sep):])
+
 class TomboyNote(Note.Note):
     def __init__(self, title, xmlContent):
         self.xmlContent = xmlContent
         #strip the xml
         text = xmlContent.replace('<note-content 
version="0.1">','').replace('</note-content>','')
-        title, sep, contents = text.partition("\n")
+        title, sep, contents = partition(text, "\n")
         Note.Note.__init__(self, title, contents)
         
     def get_xml(self):
@@ -111,7 +120,7 @@
         log.debug("Getting note: %s" % uid)
         xmlContent=str(self.remoteTomboy.GetNoteContentsXml(uid))
         xmlContent=xmlContent.replace('<note-content 
version="0.1">','').replace('</note-content>','')
-        title, sep, contents = xmlContent.partition("\n")
+        title, sep, contents = partition(xmlContent, "\n")
         n = Note.Note(
                 title=title,
                 contents=contents
_______________________________________________
SVN-commits-list mailing list (read only)
http://mail.gnome.org/mailman/listinfo/svn-commits-list

Want to limit the commits to a few modules? Go to above URL, log in to edit 
your options and select the modules ('topics') you want.
Module maintainer? It is possible to set the reply-to to your development 
mailing list. Email [EMAIL PROTECTED] if interested.

Reply via email to