def init_html(self): self.html = HTML(tag=self.html_tag, id=self.html_id, class_name=self.html_class_name) for child in self.children: self.html.add_child(child.html_script) self.html_script = self.html.html_script
def init_html(self): self.html = HTML(tag=self.html_tag, id=self.html_id, class_name=self.html_class_name) if type(self.children) is not list: self.children = [self.children] for child in self.children: self.html.add_child(child.html_script) self.html_script = self.html.html_script
def init_html(self): self.html = HTML(tag=self.html_tag, id=self.html_id, class_name=self.html_class_name) if self.compo_clip is not None: clip_img = '<img src="' + self.compo_clip + '" class="clip_img">\n' self.html.add_child(clip_img) if type(self.children) is not list: self.children = [self.children] for child in self.children: self.html.add_child(child.html_script) self.html_script = self.html.html_script
def generate_html_list(self): list_html = '' tags = {'Compo': 'div', 'Text': 'div'} if self.list_type == 'multiple': groups = self.compos_df.groupby('list_item').groups list_item_html = '' for i in groups: list_items = self.compos_df.loc[groups[i]] elements_html = '' for j in range(len(list_items)): item = list_items.iloc[j] # html of elements elements_html += HTML(tag=tags[item['class']], class_name=item['group']).html # html of list_items list_item_html += HTML(tag='li', children=elements_html).html list_html = HTML(tag='ul', children=list_item_html).html elif self.list_type == 'single': list_item_html = '' for i in range(len(self.compos_df)): item = self.compos_df.iloc[i] elements_html = HTML(tag=tags[item['class']], class_name=item['group']).html list_item_html += HTML(tag='li', children=elements_html).html list_html = HTML(tag='ul', children=list_item_html).html self.list_html = list_html
def init_html(self): self.html = HTML(tag=self.html_tag, id=self.html_id, class_name=self.html_class_name) if len(self.sub_blocks) > 1: # add compos of sub blocks for sub_block in self.sub_blocks: self.html.add_child(sub_block.html_script) else: for compo in self.compos: self.html.add_child(compo.html_script) self.html_script = self.html.html_script