3
Author: Jos Hirth, kaioa.com
4
License: GNU General Public License - http://www.gnu.org/licenses/gpl.html
8
DOCNAME='sodipodi:docname'
10
import sys, simplestyle
12
from xml.dom.minidom import parse
14
sys.exit('The export_gpl.py module requires PyXML. Please download the latest version from <http://pyxml.sourceforge.net/>.')
16
colortags=(u'fill',u'stroke',u'stop-color',u'flood-color',u'lighting-color')
21
if node.hasChildNodes():
22
childs=node.childNodes
27
if node.hasAttributes():
28
sa=node.getAttribute('style')
30
styles=simplestyle.parseStyle(sa)
31
for c in range(len(colortags)):
32
if colortags[c] in styles.keys():
33
addColor(styles[colortags[c]])
36
if simplestyle.isColor(col):
37
c=simplestyle.parseColor(col)
38
colors['%3i %3i %3i ' % (c[0],c[1],c[2])]=simplestyle.formatColoria(c).upper()
40
stream = open(sys.argv[-1:][0],'r')
44
print 'GIMP Palette\nName: %s\n#' % (dom.getElementsByTagName('svg')[0].getAttribute(DOCNAME).split('.')[0])
46
for k,v in sorted(colors.items()):
b'\\ No newline at end of file'