root/trunk/RBRapier/RBRapier/Formats/SVG/SVGSkinner.py

Revision 677, 2.2 kB (checked in by sholloway, 5 years ago)

"use" and "symbol" elements now workcorrectly

Line 
1 #!/usr/bin/env python
2 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 ##~ License
4 ##~
5 ##- The RuneBlade Foundation library is intended to ease some
6 ##- aspects of writing intricate Jabber, XML, and User Interface (wxPython, etc.)
7 ##- applications, while providing the flexibility to modularly change the
8 ##- architecture. Enjoy.
9 ##~
10 ##~ Copyright (C) 2002  TechGame Networks, LLC.
11 ##~
12 ##~ This library is free software; you can redistribute it and/or
13 ##~ modify it under the terms of the BSD style License as found in the
14 ##~ LICENSE file included with this distribution.
15 ##~
16 ##~ TechGame Networks, LLC can be reached at:
17 ##~ 3578 E. Hartsel Drive #211
18 ##~ Colorado Springs, Colorado, USA, 80920
19 ##~
20 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
22 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 #~ Imports
24 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25
26 from RBSkinning.XMLSkinner import XMLSkinner as _XMLSkinner
27 from RBFoundation.XMLClassBuilder import ElementFactory as EF
28 from RBFoundation import XMLNode
29
30 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 #~ Constants / Variables / Etc.
32 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
34 SVGElementFactories = {
35     ## Long names
36     ('http://www.w3.org/2000/svg',): EF.CachedTryList([
37         EF.NodeImport('RBRapier.Formats.SVG.SVGSkin'),
38         EF.StaticImport('RBRapier.Formats.SVG.SVGSkin.UnknownElement', 'UnknownElement'),
39         ]),
40
41     ('http://www.w3.org/1999/xlink',): None, # hum... need support for this
42
43     None: EF.Static(XMLNode.NodeXML),
44     }
45
46 SVGNamespaceSynonyms = {
47     'svg':'http://www.w3.org/2000/svg',
48     None:'http://www.w3.org/2000/svg',
49     }
50
51 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52 #~ Definitions
53 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54
55 class SVGSkinner(_XMLSkinner):
56     ElementFactories = _XMLSkinner.ElementFactories.copy()
57     ElementFactories.update(SVGElementFactories)
58
59     NamespaceSynonyms = _XMLSkinner.NamespaceSynonyms.copy()
60     NamespaceSynonyms.update(SVGNamespaceSynonyms)
61
62 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63
64 def SkinFile(*args, **kw):
65     return SVGSkinner().SkinFile(*args, **kw)
66
67 def SkinXML(*args, **kw):
68     return SVGSkinner().SkinXML(*args, **kw)
69
Note: See TracBrowser for help on using the browser.