(self, user, chapter_data)
return chapter
Parse a chapter to be added
Parse a chapter to be added
Parse a chapter to be added
def parse_new(self, user, chapter_data):
        """Parse a chapter to be added"""
        chapter = Chapter()
        if not "start" in chapter_data:
            raise ParameterMissing("start parameter missing")
        chapter.start = parse_time(chapter_data["start"])

        if not "end" in chapter_data:
            raise ParameterMissing("end parameter missing")
        chapter.end = parse_time(chapter_data["end"])

        chapter.label = chapter_data.get("label", "")
        chapter.advertisement = chapter_data.get("advertisement", False)
        return chapter
def parse_new ( self , user , chapter_data ) : chapter = Chapter ( ) if not "start" in chapter_data : raise ParameterMissing ( "start parameter missing" ) chapter . start = parse_time ( chapter_data [ "start" ] ) if not "end" in chapter_data : raise ParameterMissing ( "end parameter missing" ) chapter . end = parse_time ( chapter_data [ "end" ] ) chapter . label = chapter_data . get ( "label" , "" ) chapter . advertisement = chapter_data . get ( "advertisement" , False ) return chapter