B
    EDb{	  ã               @   sl   d dl Z d dlZd dlZd dlZd dlT d dlmZ i add„ Zdd„ Z	dd	„ Z
d
d„ Zd dlZd dlZdS )é    N)Ú*)ÚBaseInterfacec             C   sT   t  | ¡ t¡rP|  ¡ }t|ƒtkr2t| jddƒ‚|t	krHt| jddƒ‚| t	|< | S )aÄ  
	This is a decorator for service interfaces. It basically checks that
	the interface classes which are exposed meets the requirements for
	interface implementations.
	It adds the interface to a global interface-cache.
	All default ladon interfaces are added using this decorator, if you are
	extending Ladon with a new interface use this decorator.
	Requirements:
	------------
	Interfaces must inherit the ladon.interfaces.base.BaseInterface class.
	ZwefewzpInterfaces must implement the static _interface_name method to return a unique string identifying the interface.Zwefwez?The interface name is already being used by anothere interface.)
ÚinspectZgetmroÚcountr   Z_interface_nameÚtypeÚstrZExposeInterfaceExceptionÚ__name__Ú_interfaces)Z
class_typeZif_name© r
   ú9G:\easytimepro\master/mysite/ladon\interfaces\__init__.pyÚexpose   s    r   c             C   s2   g }x(t  ¡ D ]\}}| | ¡r||g7 }qW |S )N)r	   ÚitemsZ_accept_basetype)ÚtypÚresult_interfacesÚkÚvr
   r
   r   Úaccept_basetype0   s
    
r   c              C   s,   g } x"t D ]\}}| ¡ r
| |g7 } q
W | S )N)r	   Z_accept_list)r   r   r   r
   r
   r   Úaccept_list8   s
    r   c             C   s   | t krt |  S d S )N)r	   )Zifnamer
   r
   r   Úname_to_interface@   s    r   )ÚsysZimpÚosr   Z"mysite.ladon.exceptions.interfacesZmysite.ladon.interfaces.baser   r	   r   r   r   r   Zmysite.ladon.interfaces.soapÚmysiteZmysite.ladon.interfaces.jsonwspr
   r
   r
   r   Ú<module>   s    