genelements.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:deviation-manual 作者: DeviationTX 项目源码 文件源码
def gather_elements(self, client, node, style):

        # Either use the figure style or the class
        # selected by the user
        st_name = 'figure'
        if node.get('classes'):
            st_name = node.get('classes')[0]
        style=client.styles[st_name]
        cmd=getattr(style,'commands',[])
        image=node.children[0]
        if len(node.children) > 1:
            caption = node.children[1]
        else:
            caption=None

        if len(node.children) > 2:
            legend = node.children[2:]
        else:
            legend=[]

        w=node.get('width',client.styles['figure'].colWidths[0])
        cw=[w,]
        sub_elems = client.gather_elements(node, style=None)
        t_style=TableStyle(cmd)
        table = DelayedTable([[e,] for e in sub_elems],style=t_style,
            colWidths=cw)
        table.hAlign = node.get('align','CENTER').upper()
        return [MySpacer(0, style.spaceBefore),table,
            MySpacer(0, style.spaceAfter)]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号