diff --git a/extensions/fablabchemnitz_color_alpha_replace.py b/extensions/fablabchemnitz_color_alpha_replace.py index 3a591c18..e653677a 100644 --- a/extensions/fablabchemnitz_color_alpha_replace.py +++ b/extensions/fablabchemnitz_color_alpha_replace.py @@ -27,14 +27,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' -import inkex,sys,re +import inkex +import sys +import re from lxml import etree class ReplaceColorAlpha(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) - self.arg_parser.add_argument("-f", "--from_color", default="000000", help="Replace color") - self.arg_parser.add_argument("-t", "--to_color", default="000000", help="By color + Alpha") + self.arg_parser.add_argument("--from_color", default="000000", help="Replace color") + self.arg_parser.add_argument("--to_color", default="000000", help="By color + Alpha") def effect(self): saveout = sys.stdout @@ -53,8 +55,7 @@ class ReplaceColorAlpha(inkex.Effect): for element in svg.iter("*"): style = element.get('style') if style: - #print style.lower().find('fill-opacity:'+alphaFr[:5]) != -1 - if (style.lower().find('fill:#'+fr[:6]) != -1 and len(fr) == 6) or (style.lower().find('fill-opacity:'+alphaFr[:5]) != -1 and len(fr)==8 and style.lower().find('fill:#'+fr[:6]) != -1): + if (style.lower().find('fill:#'+fr[:6]) != -1 and len(fr) == 6) or (style.lower().find('fill-opacity:'+alphaFr[:4]) != -1 and len(fr)==8 and style.lower().find('fill:#'+fr[:6]) != -1): style = re.sub('fill-opacity:.*?(;|$)', '\\1', style) @@ -65,7 +66,7 @@ class ReplaceColorAlpha(inkex.Effect): style = style + ";fill-opacity:" + alphaTo element.set('style',style) - if (style.lower().find('stroke:#'+fr[:6]) != -1 and len(fr) == 6) or (style.lower().find('stroke:#'+fr[:6]) != -1 and style.lower().find('stroke-opacity:'+alphaFr[:5]) != -1 and len(fr)==8): + if (style.lower().find('stroke:#'+fr[:6]) != -1 and len(fr) == 6) or (style.lower().find('stroke:#'+fr[:6]) != -1 and style.lower().find('stroke-opacity:'+alphaFr[:4]) != -1 and len(fr)==8): style = re.sub('stroke-opacity:.*?(;|$)', '\\1', style) diff --git a/extensions/fablabchemnitz_drawdirections.py b/extensions/fablabchemnitz_drawdirections.py index 42053a0f..502b9d87 100644 --- a/extensions/fablabchemnitz_drawdirections.py +++ b/extensions/fablabchemnitz_drawdirections.py @@ -29,7 +29,5 @@ class StartEndPoints(inkex.Effect): else: #open contour with start and end point self.drawCircle(dot_group, '#FF0000', start) self.drawCircle(dot_group, '#0000FF', end) - - - + StartEndPoints().run() \ No newline at end of file