Example #1
0
        def chapters(self):
            ret = [self.site.Chapter(self, Util.unescape(match.group('title') or ''),
                                     match.group('url')) for match in
                   self.CHAPTER_FROM_SOURCE_REGEX.finditer(self.source)]
            ret.reverse()

            return ret
Example #2
0
        def chapter(self):
            """
            :rtype: str or None
            """
            match = self.VOLUME_AND_CHAPTER_FROM_URL_REGEX.match(self.url)

            if match is not None and match.group('chapter') is not None:
                return Util.normalize_value(match.group('chapter'))
            else:
                return None
Example #3
0
        def chapters(self):
            """
            :rtype: OrderedDict of (str, MetaChapter)
            """
            all_chapters = _.flatten([
                site.series(self.name).chapters for site in self.site.modules
            ])

            chapter_map = OrderedDict(
                Util.natural_sort(
                    _.groupBy(all_chapters, lambda chapter, index: chapter.chapter).items(),
                    key=lambda t: t[0]
                )
            )

            return OrderedDict(
                (chapter, MetaSite.MetaChapter(self, chapter, choices)) for chapter, choices in
                chapter_map.items())
Example #4
0
 def source(self):
     return Util.getSourceCode(self.url)
Example #5
0
        def chapters(self):
            ret = [self.site.Chapter(self, Util.unescape(match.group('title') or ''),
                                     self.TEMPLATE_URL.format(path=match.group('path'))) for match
                   in self.CHAPTER_FROM_SOURCE_REGEX.finditer(self.source)]

            return ret