Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(26)  |  Call(26)  |  Derive(0)  |  Import(0)

src/b/a/babelsubs-HEAD/babelsubs/parsers/base.py   babelsubs(Download)
                    item = self._get_data(match.groupdict())
                    text = self.get_markup(item['text'])
                    self.sub_set.append_subtitle(item['start'], item['end'], text, escape=False)
                if match is None:
                    raise ValueError("No subs found")

src/b/a/babelsubs-HEAD/babelsubs/parsers/youtube.py   babelsubs(Download)
                    end = start + duration
                    text = item.text and unescape_html(item.text) or u''
                    self.sub_set.append_subtitle(start, end, text)
                    has_subs = True
                if not has_subs:

src/b/a/babelsubs-HEAD/babelsubs/parsers/txt.py   babelsubs(Download)
                if not valid and ''.join(item['text'].split()):
                    valid = True
                self.sub_set.append_subtitle(item['start'], item['end'], item['text'])
            if not valid:
                raise SubtitleParserError("No subs")

src/b/a/babelsubs-HEAD/babelsubs/parsers/json_parser.py   babelsubs(Download)
 
            for sub in data:
                self.sub_set.append_subtitle(sub['start'], sub['end'],
                    sub['text'])
 

src/b/a/babelsubs-HEAD/babelsubs/tests/test_storage.py   babelsubs(Download)
    def test_new_paragraph(self):
        dfxp = storage.SubtitleSet('en')
        # first sub is always a paragraph break ;)
        dfxp.append_subtitle(0, 1000, "paragraph 1 - A")
        dfxp.append_subtitle(1000, 2000, "paragraph 1 - B")
        dfxp.append_subtitle(2000, 3000, "paragraph 2 - A", new_paragraph=True)
        dfxp.append_subtitle(3000, 4000, "paragraph 2 - B", new_paragraph=False)
        dfxp.append_subtitle(3000, 4000, "paragraph 2 - C")

src/b/a/babelsubs-HEAD/babelsubs/tests/test_txt.py   babelsubs(Download)
    def test_linebreaks(self):
        sset = SubtitleSet('en')
        sset.append_subtitle(0, 1000, '''line 1<br />line 2<br />line 3''',
                             escape=False)
        sset.append_subtitle(1000,200, 'second sub')

src/b/a/babelsubs-HEAD/babelsubs/tests/test_dfxp.py   babelsubs(Download)
    def test_dfxp_merge(self):
        en_subs = SubtitleSet('en')
        es_subs = SubtitleSet('es')
        fr_subs = SubtitleSet('fr')
        en_subs.append_subtitle(1000, 1500, 'content')
        es_subs.append_subtitle(1000, 1500, 'spanish content')
        fr_subs.append_subtitle(1000, 1500, 'french content')

src/b/a/babelsubs-HEAD/babelsubs/tests/test_ssa.py   babelsubs(Download)
    def test_generate_centiseconds(self):
        sset = storage.SubtitleSet('en')
        sset.append_subtitle(133, 238,'hey')
        output = unicode(SSAGenerator(sset))
        # make sure time is 230 milliseconds not 38 and that
    def test_timing_generator(self):
        sset = storage.SubtitleSet('en')
        sset.append_subtitle(40, 2930,"We started Universal Subtitles because we believe")
        generated = unicode(SSAGenerator(sset))
        self.assertIn('Dialogue: 0,0:00:00.04,0:00:02.93,Default,,0000,0000,0000,,We started Universal Subtitles because we believe', generated)