Commit e3bb2065 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

process shapes: get images out of shapes.svg

parent f9fe4945
#!/usr/bin/env python3
import argparse
import os
import os.path
import xml.etree.ElementTree as ET
from pathlib import Path
from download_bbb import parser
def process_shapes(meeting):
"""Extract images from shapes.svg"""
for child in ET.parse(f'data/{meeting}/shapes.svg').getroot():
if child.attrib['class'] != 'slide':
attrs = {key: val for key, val in child.attrib.items() if key != 'style'}
svg = ET.Element('svg', {'xmlns': ''})
ET.SubElement(svg, 'image', attrs)
with open(f'data/{meeting}/{child.attrib["id"]}.svg', 'wb') as fileh:
for line in ET.tostringlist(svg):
def main():
"""script entry point"""
args = parser.parse_args()
if __name__ == '__main__':
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment