code: def _generateSrt(self,captions):
          
          caption_number = 0
          srt_output = []
          for caption in captions:
              caption_number += 1
              #CAPTION NUMBER
              srt_output.append(str(caption_number))
              #TIME
              time_from = ( caption['time']['hours'], caption['time']['min'], caption['time']['sec'], caption['time']['msec'] ) 
              if len(captions)>caption_number:
                  #display caption until next one
                  next_caption_time = captions[caption_number]['time']
                  time_to = ( next_caption_time['hours'], next_caption_time['min'], next_caption_time['sec'], next_caption_time['msec'] )
              else:
                  #display caption for 2 seconds
                  time_to = (time_from[0],time_from[1]+2,time_from[2],time_from[3]) 
              srt_output.append( (":").join([str(i) for i in time_from[0:-1]])+","+str(time_from[-1])+" --> "+(":").join([str(i) for i in time_to[0:-1]])+","+str(time_to[-1]))
              #CAPTIONS
              for caption_line in caption['textlines']:
                  srt_output.append(caption_line)
              #Add two empty lines to serarate every caption showed
              srt_output.append("")
              srt_output.append("")
          return srt_output
docs: INPUT: array with captions, i.e.
                  [{'texlines': [u"So, I'm going to rewrite this", 'in a more concise form as'],
                  'time': {'hours':'1', 'min':'2','sec':44,'msec':232} }]
              OUTPUT: srtformated string