Did I find the right examples for you? yes no Crawl my project Python Jobs
All Samples(2) | Call(0) | Derive(0) | Import(2)
src/b/a/babelsubs-HEAD/babelsubs/parsers/ssa.py babelsubs(Download)
import re from babelsubs.parsers.srt import SRTParser from babelsubs.utils import ( centiseconds_to_milliseconds, escape_ampersands,
class SSAParser(SRTParser): file_type = ['ssa', 'ass'] MAX_SUB_TIME = UNSYNCED_TIME_ONE_HOUR_DIGIT
src/b/a/babelsubs-HEAD/babelsubs/generators/ssa.py babelsubs(Download)
components = utils.milliseconds_to_time_clock_components( milliseconds, unsynced_val=utils.UNSYNCED_TIME_ONE_HOUR_DIGIT, use_centiseconds=True) return u'%(hours)i:%(minutes)02i:%(seconds)02i.%(centiseconds)02i' % components
src/b/a/babelsubs-HEAD/babelsubs/parsers/sbv.py babelsubs(Download)
def _get_time(self, hour, min, sec, secfr): if secfr is None: secfr = '0' res = (int(hour)*60*60+int(min)*60+int(sec)+float('.'+secfr)) * 1000 if res >= utils.UNSYNCED_TIME_ONE_HOUR_DIGIT:
src/b/a/babelsubs-HEAD/babelsubs/generators/sbv.py babelsubs(Download)
from babelsubs.generators.base import BaseGenerator, register from babelsubs.utils import UNSYNCED_TIME_ONE_HOUR_DIGIT class SBVGenerator(BaseGenerator): file_type = 'sbv'
def format_time(self, time): if time is None: time = UNSYNCED_TIME_ONE_HOUR_DIGIT seconds, milliseconds = divmod(int(time), 1000) minutes, seconds = divmod(seconds, 60)