ó
¢¿[Mc           @   s7   d  Z  d d l Z d d l Z d d l Z d „  Z d S(   s‚   General utility functions common to client and server.

  This module contains a collection of general purpose utility functions.
iÿÿÿÿNc         C   sx   y t  j |  SWnb t k
 rs y6 y t j t j d |  ƒ SWn t j k
 rS n XWn t k
 rh n Xt	 |  ƒ SXd S(   s¡  Converts an IID to a string interface name.  
	
	Used primarily for debugging purposes, this allows a cryptic IID to
	be converted to a useful string name.  This will firstly look for interfaces
	known (ie, registered) by pythoncom.  If not known, it will look in the
	registry for a registered interface.

	iid -- An IID object.

	Result -- Always a string - either an interface name, or '<Unregistered interface>'
	s   Interface\%sN(
   t	   pythoncomt   ServerInterfacest   KeyErrort   win32apit   RegQueryValuet   win32cont   HKEY_CLASSES_ROOTt   errort   ImportErrort   str(   t   iid(    (    s0   K:\RCS\Python\Lib\site-packages\win32com\util.pyt   IIDToInterfaceName   s    (   t   __doc__R    R   R   R   (    (    (    s0   K:\RCS\Python\Lib\site-packages\win32com\util.pyt   <module>   s   