home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 June / maximum-cd-2009-06.iso / DiscContents / digsby_setup.exe / lib / msn / SOAP / WSTrust / __init__.pyo (.txt) next >
Encoding:
Python Compiled Bytecode  |  2009-02-26  |  3.1 KB  |  107 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. from __future__ import with_statement
  5. from StringIO import StringIO
  6. from util import Storage
  7. import os
  8. import os.path as path
  9. from  import generate
  10. WSDL_PATH = './src/msn/SOAP/WSTrust/WS-Trust.wsdl'
  11. _nsdict = {
  12.     'http://schemas.xmlsoap.org/ws/2005/02/trust/wsdl': 'wst_soap',
  13.     'http://schemas.xmlsoap.org/ws/2004/08/addressing': 'wsa',
  14.     'http://www.w3.org/2000/09/xmldsig#': 'xmldsig',
  15.     'http://schemas.xmlsoap.org/ws/2005/02/trust': 'wst',
  16.     'http://schemas.xmlsoap.org/ws/2003/06/secext': 'secext',
  17.     'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd': 'oasisse',
  18.     'http://schemas.xmlsoap.org/ws/2004/09/policy': 'wsp',
  19.     'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd': 'secutil',
  20.     'http://www.w3.org/XML/1998/namespace': 'xmlnsp',
  21.     'http://schemas.microsoft.com/Passport/SoapServices/PPCRL': 'ps',
  22.     'http://schemas.xmlsoap.org/ws/2003/06/utility': 'wsu' }
  23.  
  24. def __gen(filepath):
  25.     old_dir = os.getcwd()
  26.     (head, tail) = path.split(filepath)
  27.     os.chdir(head)
  28.     
  29.     try:
  30.         generate(file = tail, address = True)
  31.     finally:
  32.         os.chdir(old_dir)
  33.  
  34.  
  35. __GENERATE = False
  36. if __GENERATE:
  37.     __gen(WSDL_PATH)
  38.  
  39.  
  40. try:
  41.     from WSTrust_client import *
  42.     from WSTrust_types import *
  43.     import WSTrust_client
  44.     import WSTrust_types
  45. except ImportError:
  46.     __gen(WSDL_PATH)
  47.     from WSTrust_client import *
  48.     from WSTrust_types import *
  49.     import WSTrust_client
  50.     import WSTrust_types
  51.  
  52. from ZSI.schema import GTD
  53. nskeys = list((lambda .0: for k in .0:
  54. if k.startswith('ns'):
  55. kcontinue)(globals().iterkeys()))
  56. nss = []
  57. for key in nskeys:
  58.     g = globals()
  59.     nsclass = g[key]
  60.     nss.append(nsclass)
  61.     g[_nsdict[nsclass.targetNamespace]] = nsclass
  62.  
  63. del nskeys
  64. for namespace in nss:
  65.     for clsname in namespace.__dict__.keys():
  66.         if clsname.endswith('_Def'):
  67.             name = clsname[:-4]
  68.             
  69.             try:
  70.                 pname = (namespace.targetNamespace, name)
  71.                 pyclass = GTD(*pname)(pname).pyclass
  72.             except Exception:
  73.                 e = None
  74.                 print 'Error making pyclass for %s. error was %r' % (pname, e)
  75.             except:
  76.                 None<EXCEPTION MATCH>Exception
  77.             
  78.  
  79.         None<EXCEPTION MATCH>Exception
  80.         if clsname.endswith('_Dec'):
  81.             name = clsname[:-4]
  82.             pname = (namespace.targetNamespace, name)
  83.             
  84.             try:
  85.                 pyclass = getattr(namespace, clsname)().pyclass
  86.             except Exception:
  87.                 e = None
  88.                 print 'Error making pyclass for %s. error was %r' % (pname, e)
  89.             except:
  90.                 None<EXCEPTION MATCH>Exception
  91.             
  92.  
  93.         None<EXCEPTION MATCH>Exception
  94.         if name in vars(namespace):
  95.             print 'Found two instances of the name "%s". (%r and %r)' % (name, getattr(namespace, name), pyclass)
  96.             continue
  97.         setattr(namespace, name, pyclass)
  98.     
  99.  
  100. if __name__ == '__main__' and not __GENERATE:
  101.     __gen(__file__, WSDL_PATH)
  102.     from WSTrust_client import *
  103.     from WSTrust_types import *
  104.     import WSTrust_client
  105.     import WSTrust_types
  106.  
  107.