Skip to content

Commit

Permalink
diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
Iosu Sanchez committed May 18, 2021
1 parent 32ed8c2 commit 06cf669
Show file tree
Hide file tree
Showing 11 changed files with 33,247 additions and 0 deletions.
Binary file added diagrams/GidaBotApp-Architecture.pdf
Binary file not shown.
Binary file added diagrams/prototype.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33,216 changes: 33,216 additions & 0 deletions diagrams/staruml/GidaBotApp.mdj

Large diffs are not rendered by default.

Binary file added diagrams/staruml/pdf/App!domeinuEredua_0.pdf
Binary file not shown.
Binary file added diagrams/staruml/pdf/App!erabilpenKasuak_1.pdf
Binary file not shown.
Binary file added diagrams/staruml/pdf/App!klaseDiagrama_2.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions diagrams/staruml/svg/App!domeinuEredua_0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions diagrams/staruml/svg/App!erabilpenKasuak_1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions diagrams/staruml/svg/App!klaseDiagrama_2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions diagrams/staruml/watermark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
This script removes UNREGISTERED watermark from a StarUML exported SVG
and converts it to PDF
"""
import lxml.etree as ET
from svglib.svglib import svg2rlg
from reportlab.graphics import renderPDF
import glob, os, shutil

os.chdir("./svg")
for file in glob.glob("*.svg"):
output = file[:-4] + '.pdf'
with open(file, 'r') as f:
doc = ET.parse(f)
for elem in doc.xpath("//*[local-name() = 'text' and text()='UNREGISTERED']"):
if elem.attrib['fill'] == '#eeeeee' and elem.attrib['stroke'] == 'none' and elem.attrib['font-size'] == '24px':
parent = elem.getparent()
parent.remove(elem)
tmp = ".tmp.svg"
with open(tmp, 'wb') as f2:
f2.write(ET.tostring(doc, pretty_print=True))
drawing = svg2rlg(tmp)
renderPDF.drawToFile(drawing, output)
os.remove(tmp)
shutil.move(output, "../pdf/" + output)

print(output + " rendered.")
1 change: 1 addition & 0 deletions diagrams/staruml/watermark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3 watermark.py

0 comments on commit 06cf669

Please sign in to comment.