[jumptheshark~head:9] using split(":") for timecode.

  • From: luisbg@kenai.com
  • To: commits@jumptheshark.kenai.com
  • Subject: [jumptheshark~head:9] using split(":") for timecode.
  • Date: Sun, 31 May 2009 18:01:47 +0000

Project:    jumptheshark
Repository: head
Revision:   9
Author:     luisbg
Date:       2009-05-31 18:01:10 UTC
Link:       http://kenai.com/projects/jumptheshark/sources/head/revision/9

Log Message:
------------

using split(":") for timecode.

Modified Paths:
---------------
src/jumptheshark


Diffs:
------
diff -r 171e3b4237e8 -r da4227942a57 src/jumptheshark
--- a/src/jumptheshark  Sun May 31 18:23:59 2009 +0100
+++ b/src/jumptheshark  Sun May 31 19:01:10 2009 +0100
@@ -162,15 +162,16 @@
 
     def TimecodeToSeconds(self, timecode):
         ''' Timecode to seconds '''
-        # should use len(split())
-        if len(timecode) < 8:
+
+        timecode = timecode.split(":")
+        if len(timecode) < 3:
            print "Time format is hh:mm:ss"
            print "example: 01:08:15 is 1 hour, 8 minutes and 15 seconds"
            exit()
 
-        seconds = int(timecode[6:8])
-        minutes = int(timecode[3:5])
-        hours = int(timecode[0:2])
+        hours = int(timecode[0])
+        minutes = int(timecode[1])
+        seconds = int(timecode[2])
 
         time = seconds
         time += (minutes * 60)





[jumptheshark~head:9] using split(":") for timecode.

luisbg 05/31/2009
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close