home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 June / maximum-cd-2009-06.iso / DiscContents / digsby_setup.exe / lib / jabber / jabber_util / functions.pyo (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2009-02-26  |  707 b   |  19 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. from pyxmpp.xmlextra import common_doc, COMMON_NS
  5.  
  6. def xpath_eval(node, expr, namespaces = None):
  7.     ctxt = common_doc.xpathNewContext()
  8.     ctxt.setContextNode(node)
  9.     ctxt.xpathRegisterNs('ns', COMMON_NS)
  10.     if namespaces:
  11.         for prefix, uri in namespaces.items():
  12.             ctxt.xpathRegisterNs(unicode(prefix), uri)
  13.         
  14.     
  15.     ret = ctxt.xpathEval(unicode(expr))
  16.     ctxt.xpathFreeContext()
  17.     return ret
  18.  
  19.