Add timestamp offset for block header
[p2pool.git] / SOAPpy / NS.py
1 from __future__ import nested_scopes
2
3 """
4 ################################################################################
5 #
6 # SOAPpy - Cayce Ullman       (cayce@actzero.com)
7 #          Brian Matthews     (blm@actzero.com)
8 #          Gregory Warnes     (Gregory.R.Warnes@Pfizer.com)
9 #          Christopher Blunck (blunck@gst.com)
10 #
11 ################################################################################
12 # Copyright (c) 2003, Pfizer
13 # Copyright (c) 2001, Cayce Ullman.
14 # Copyright (c) 2001, Brian Matthews.
15 #
16 # All rights reserved.
17 #
18 # Redistribution and use in source and binary forms, with or without
19 # modification, are permitted provided that the following conditions are met:
20 # Redistributions of source code must retain the above copyright notice, this
21 # list of conditions and the following disclaimer.
22 #
23 # Redistributions in binary form must reproduce the above copyright notice,
24 # this list of conditions and the following disclaimer in the documentation
25 # and/or other materials provided with the distribution.
26 #
27 # Neither the name of actzero, inc. nor the names of its contributors may
28 # be used to endorse or promote products derived from this software without
29 # specific prior written permission.
30 #
31 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
35 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
36 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
38 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 #
42 ################################################################################
43 """
44
45 ident = '$Id: NS.py 1468 2008-05-24 01:55:33Z warnes $'
46 from version import __version__
47
48 ##############################################################################
49 # Namespace Class
50 ################################################################################
51 def invertDict(dict):
52     d = {}
53
54     for k, v in dict.items():
55         d[v] = k
56
57     return d
58
59 class NS:
60     XML  = "http://www.w3.org/XML/1998/namespace"
61
62     ENV  = "http://schemas.xmlsoap.org/soap/envelope/"
63     ENC  = "http://schemas.xmlsoap.org/soap/encoding/"
64
65     XSD  = "http://www.w3.org/1999/XMLSchema"
66     XSD2 = "http://www.w3.org/2000/10/XMLSchema"
67     XSD3 = "http://www.w3.org/2001/XMLSchema"
68
69     XSD_L = [XSD, XSD2, XSD3]
70     EXSD_L= [ENC, XSD, XSD2, XSD3]
71
72     XSI   = "http://www.w3.org/1999/XMLSchema-instance"
73     XSI2  = "http://www.w3.org/2000/10/XMLSchema-instance"
74     XSI3  = "http://www.w3.org/2001/XMLSchema-instance"
75     XSI_L = [XSI, XSI2, XSI3]
76
77     URN   = "http://soapinterop.org/xsd"
78
79     # For generated messages
80     XML_T = "xml"
81     ENV_T = "SOAP-ENV"
82     ENC_T = "SOAP-ENC"
83     XSD_T = "xsd"
84     XSD2_T= "xsd2"
85     XSD3_T= "xsd3"
86     XSI_T = "xsi"
87     XSI2_T= "xsi2"
88     XSI3_T= "xsi3"
89     URN_T = "urn"
90
91     NSMAP       = {ENV_T: ENV, ENC_T: ENC, XSD_T: XSD, XSD2_T: XSD2,
92                     XSD3_T: XSD3, XSI_T: XSI, XSI2_T: XSI2, XSI3_T: XSI3,
93                     URN_T: URN}
94     NSMAP_R     = invertDict(NSMAP)
95
96     STMAP       = {'1999': (XSD_T, XSI_T), '2000': (XSD2_T, XSI2_T),
97                     '2001': (XSD3_T, XSI3_T)}
98     STMAP_R     = invertDict(STMAP)
99
100     def __init__(self):
101         raise Error, "Don't instantiate this"
102
103
104