home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Shareware / Comunicatii / jyte / jyte.exe / pyscript_rexec.py < prev    next >
Text File  |  2002-05-29  |  2KB  |  35 lines

  1. # A version of the ActiveScripting engine that enables rexec support
  2. # This version supports hosting by IE - however, due to Python's
  3. # rexec module being neither completely trusted nor private, it is
  4. # *not* enabled by default.
  5.  
  6. import pythoncom
  7. from win32com.axscript import axscript
  8. import winerror
  9. import pyscript
  10.  
  11. INTERFACE_USES_DISPEX = 0x00000004    # Object knows to use IDispatchEx
  12. INTERFACE_USES_SECURITY_MANAGER = 0x00000008 # Object knows to use IInternetHostSecurityManager
  13.  
  14. class PyScriptRExec(pyscript.PyScript):
  15.     # Setup the auto-registration stuff...
  16.     _reg_verprogid_ = "Python.AXScript-rexec.2"
  17.     _reg_progid_ = "Python" # Same ProgID as the standard engine.
  18. #    _reg_policy_spec_ = default
  19.     _reg_catids_ = [axscript.CATID_ActiveScript,axscript.CATID_ActiveScriptParse]
  20.     _reg_desc_ = "Python ActiveX Scripting Engine (with rexec support)"
  21.     _reg_clsid_ = "{69c2454b-efa2-455b-988c-c3651c4a2f69}"
  22.     _reg_class_spec_ = "win32com.axscript.client.pyscript_rexec.PyScriptRExec"
  23.     _reg_remove_keys_ = [(".pys",), ("pysFile",)]
  24.     _reg_threading_ = "Apartment"
  25.  
  26.     def _GetSupportedInterfaceSafetyOptions(self):
  27.         # print "**** calling", pyscript.PyScript._GetSupportedInterfaceSafetyOptions, "**->", pyscript.PyScript._GetSupportedInterfaceSafetyOptions(self)
  28.         return INTERFACE_USES_DISPEX | \
  29.                INTERFACE_USES_SECURITY_MANAGER | \
  30.                axscript.INTERFACESAFE_FOR_UNTRUSTED_DATA | \
  31.                axscript.INTERFACESAFE_FOR_UNTRUSTED_CALLER
  32.  
  33. if __name__=='__main__':
  34.     pyscript.Register(PyScriptRExec)
  35.