[gnome-getting-started-docs] first stab at rewriting the rebrandning/cleanup script in python
- From: Jakub Steiner <jimmac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-getting-started-docs] first stab at rewriting the rebrandning/cleanup script in python
- Date: Thu, 13 Dec 2012 15:22:49 +0000 (UTC)
commit 316c1e709733dbe38d0e7b60122481f958282753
Author: Jakub Steiner <jimmac gmail com>
Date: Thu Dec 13 16:21:38 2012 +0100
first stab at rewriting the rebrandning/cleanup script in python
- python was used for the animation, so it makes sense to use teh same language
figures/goa1.svg | 41 ++++++++++++++++++++++++++++--------
figures/render-figures.py | 21 ++++++++++++++++++
getting-started/C/figures/goa1.svg | 11 ++++++++-
3 files changed, 63 insertions(+), 10 deletions(-)
---
diff --git a/figures/goa1.svg b/figures/goa1.svg
index 94116e5..f27c8c7 100644
--- a/figures/goa1.svg
+++ b/figures/goa1.svg
@@ -8,9 +8,10 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="800"
+ width="810"
height="400"
id="svg10075"
version="1.1"
@@ -42,6 +43,16 @@
offset="1"
id="stop11076" />
</linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#GNOME"
+ id="linearGradient8407"
+ gradientTransform="scale(1.1451743,0.87322954)"
+ x1="-18.33782"
+ y1="490.54935"
+ x2="713.42854"
+ y2="490.54935"
+ gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
@@ -50,17 +61,17 @@
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
- inkscape:zoom="0.70710678"
- inkscape:cx="406.04766"
- inkscape:cy="175.48329"
+ inkscape:zoom="1"
+ inkscape:cx="369.93497"
+ inkscape:cy="103.93705"
inkscape:document-units="px"
- inkscape:current-layer="layer1"
+ inkscape:current-layer="layer2"
showgrid="false"
borderlayer="true"
inkscape:showpageshadow="false"
inkscape:window-width="1279"
- inkscape:window-height="1376"
- inkscape:window-x="2880"
+ inkscape:window-height="1375"
+ inkscape:window-x="2879"
inkscape:window-y="27"
inkscape:window-maximized="0" />
<metadata
@@ -79,9 +90,10 @@
inkscape:label="bg"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(0,-652.36217)">
+ transform="translate(0,-652.36217)"
+ sodipodi:insensitive="true">
<rect
- style="fill:url(#GNOME);"
+ style="fill:url(#GNOME)"
id="background"
width="838"
height="639"
@@ -351,5 +363,16 @@
x="-293.25"
y="348.72986">System Settings</tspan></text>
</g>
+ <text
+ xml:space="preserve"
+ style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ x="293"
+ y="579"
+ id="text8409"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan8411"
+ x="293"
+ y="579">this isn't reflected 3</tspan></text>
</g>
</svg>
diff --git a/figures/render-figures.py b/figures/render-figures.py
new file mode 100755
index 0000000..de35997
--- /dev/null
+++ b/figures/render-figures.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+import glob
+import os
+from xml.etree import ElementTree
+
+TEMP = './tmp.svg'
+
+def rebrand(f, brand):
+ svg = ElementTree.parse(fname)
+ for e in svg.iterfind("/svg/g/rect[ id='background']"):
+ print(e)
+ e.set('style', 'fill:url(#%s);' % (brand,))
+ print svg.dump(e)
+ svg.write(TEMP)
+
+for fname in glob.glob('*svg'):
+ print fname
+ rebrand(fname, "RHEL7")
+ os.system("inkscape --vacuum-defs -l ../getting-started/C/figures/%s %s" % (fname, TEMP))
+ os.unlink(TEMP)
diff --git a/getting-started/C/figures/goa1.svg b/getting-started/C/figures/goa1.svg
index 0b6ddda..d4886f4 100644
--- a/getting-started/C/figures/goa1.svg
+++ b/getting-started/C/figures/goa1.svg
@@ -9,7 +9,7 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
- width="800"
+ width="810"
height="400"
id="svg10075">
<defs
@@ -278,5 +278,14 @@
y="348.72986"
id="tspan6941">System Settings</tspan></text>
</g>
+ <text
+ x="293"
+ y="579"
+ id="text8409"
+ xml:space="preserve"
+ style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
+ x="293"
+ y="579"
+ id="tspan8411">this isn't reflected 3</tspan></text>
</g>
</svg>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]