[xiph-commits] r15091 - trunk/subtle/Subtitles

jmesquita at svn.xiph.org jmesquita at svn.xiph.org
Sun Jun 29 20:35:46 PDT 2008


Author: jmesquita
Date: 2008-06-29 20:35:46 -0700 (Sun, 29 Jun 2008)
New Revision: 15091

Modified:
   trunk/subtle/Subtitles/Line.py
Log:
* Use strip('\n') instead of going on the funky C like wave. Think more Pythonic

Modified: trunk/subtle/Subtitles/Line.py
===================================================================
--- trunk/subtle/Subtitles/Line.py	2008-06-30 03:26:04 UTC (rev 15090)
+++ trunk/subtle/Subtitles/Line.py	2008-06-30 03:35:46 UTC (rev 15091)
@@ -38,10 +38,5 @@
             function because of pango markups
             and end of lines.
         """
-        j=0
-        for i in text:
-            if i == '\n':
-                continue
-            else:
-                j += 1
-        return j
+        t = text.strip('\n')
+        return len(t)



More information about the commits mailing list