| 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 |
|
|---|
| 29 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 30 |
#~ Constants / Variables / Etc. |
|---|
| 31 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 32 |
|
|---|
| 33 |
SVGElementFactories = { |
|---|
| 34 |
## Long names |
|---|
| 35 |
('http://www.w3.org/2000/svg',): EF.CachedTryList([ |
|---|
| 36 |
EF.NodeImport('RBRapier.Formats.SVG.SVGSkin'), |
|---|
| 37 |
EF.StaticImport('RBRapier.Formats.SVG.SVGSkin.UnknownElement', 'UnknownElement'), |
|---|
| 38 |
]), |
|---|
| 39 |
|
|---|
| 40 |
('http://www.w3.org/1999/xlink',): None, # hum... need support for this |
|---|
| 41 |
|
|---|
| 42 |
None: EF.StaticImport('RBRapier.Formats.SVG.SVGSkin.metadata', 'metadata'), # everything that is unknown must be metadata ;) |
|---|
| 43 |
} |
|---|
| 44 |
|
|---|
| 45 |
SVGNamespaceSynonyms = { |
|---|
| 46 |
'svg':'http://www.w3.org/2000/svg', |
|---|
| 47 |
None:'http://www.w3.org/2000/svg', |
|---|
| 48 |
} |
|---|
| 49 |
|
|---|
| 50 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 51 |
#~ Definitions |
|---|
| 52 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 53 |
|
|---|
| 54 |
class SVGSkinner(_XMLSkinner): |
|---|
| 55 |
ElementFactories = _XMLSkinner.ElementFactories.copy() |
|---|
| 56 |
ElementFactories.update(SVGElementFactories) |
|---|
| 57 |
|
|---|
| 58 |
NamespaceSynonyms = _XMLSkinner.NamespaceSynonyms.copy() |
|---|
| 59 |
NamespaceSynonyms.update(SVGNamespaceSynonyms) |
|---|
| 60 |
|
|---|
| 61 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 62 |
|
|---|
| 63 |
def SkinFile(*args, **kw): |
|---|
| 64 |
return SVGSkinner().SkinFile(*args, **kw) |
|---|
| 65 |
|
|---|
| 66 |
def SkinXML(*args, **kw): |
|---|
| 67 |
return SVGSkinner().SkinXML(*args, **kw) |
|---|
| 68 |
|
|---|