diff options
author | Sumit-Sahu | 2020-05-19 20:22:16 +0530 |
---|---|---|
committer | GitHub | 2020-05-19 20:22:16 +0530 |
commit | b2332467ca0d261644373b6578349bfcddc240ab (patch) | |
tree | 9d36ef8af6ecbf458f1ad544950b0e8bc1e0a998 /src | |
parent | 0e8a9866a7101233820273e9d97598af31382ef0 (diff) | |
download | Chemical-PFD-b2332467ca0d261644373b6578349bfcddc240ab.tar.gz Chemical-PFD-b2332467ca0d261644373b6578349bfcddc240ab.tar.bz2 Chemical-PFD-b2332467ca0d261644373b6578349bfcddc240ab.zip |
Delete svghandler.py
Diffstat (limited to 'src')
-rw-r--r-- | src/main/python/shapes/svghandler.py | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/main/python/shapes/svghandler.py b/src/main/python/shapes/svghandler.py deleted file mode 100644 index fa976cf..0000000 --- a/src/main/python/shapes/svghandler.py +++ /dev/null @@ -1,44 +0,0 @@ -import re - -from PyQt5.QtCore import QFile, QIODevice -from PyQt5.QtXml import QDomDocument - - -class SvgHandler(): - def __init__(self, file): - self.doc = QDomDocument("doc") - self.file = file - if not self.doc.setContent(self.file): - print("Cannot parse the content") - self.file.close() - exit(-1) - self.file.close() - self.docElem = self.doc.documentElement() - - def checkViewBox(self): - viewbox = self.docElem.attributes().namedItem("viewBox").nodeValue().split(" ") - width = self.docElem.attributes().namedItem("width").nodeValue() - height = self.docElem.attributes().namedItem("height").nodeValue() - if viewbox[2] == width and viewbox[3] == height: - return True - else: - return False - - def setColor(self, value): - paths = self.docElem.elementsByTagName("path") - for index in range(paths.size()): - path = paths.at(index) - style = path.attributes().namedItem("style") - output = re.sub("stroke:[^;]*;", f"stroke:{value};", style.nodeValue()) - style.setNodeValue(output) - - def setStrokeWidth(self,value): - paths = self.docElem.elementsByTagName("path") - for index in range(paths.size()): - path = paths.at(index) - style = path.attributes().namedItem("style") - output = re.sub("stroke-width:[^;]*;", f"stroke-width:{value};", style.nodeValue()) - style.setNodeValue(output) - print(self.doc.toString()) - # output = re.sub('="stroke-width:[\d.]*;', f'="stroke-width:{target};', self.svg) - # output = re.sub('stroke-width:[\d.]*;', f'stroke-width:{target};', self.svg) |