o
    ¯bt
  ã                   @   s¢   d Z ddlZddlZddlmZmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZmZmZmZ ddlmZ dd	lmZmZ G d
d„ dejejƒZdd„ ZdS )z
Shiny new words service maker
é    N)ÚListÚOptionalÚSequence)Úplugin)Ústrports)ÚMultiService)ÚcheckersÚcredentialsÚportalÚstrcred)Úusage)ÚiwordsÚservicec                   @   s¸   e Zd ZU ejgZdde ¡ dfgZe	e
ee   ed< ejdgd�Zi ZdZe ej¡D ]Zejevs6J ‚eeej< e ejd dddej d	 f¡ q-[d
d„ Zdd„ Zdd„ ZdS )ÚOptionsÚhostnameNz*Name of this server; purely an informativeÚoptParametersÚgroup)ÚmultiUseú-portz2strports description of the port to bind for the  z serverc                 O   s&   t jj| g|¢R i |¤Ž g | d< d S )NÚgroups)r   r   Ú__init__)ÚselfÚaÚkw© r   ú3/usr/lib/python3/dist-packages/twisted/words/tap.pyr   2   s   zOptions.__init__c                 C   s   | d   | tjj¡¡ dS )z"Specify a group which should existr   N)ÚappendÚdecodeÚsysÚstdinÚencoding)r   Únamer   r   r   Ú	opt_group6   s   zOptions.opt_groupc                 C   s   |   t |¡¡ dS )z•
        Name of a passwd-style file. (This is for
        backwards-compatibility only; you should use the --auth
        command instead.)
        N)Ú
addCheckerr   ÚFilePasswordDB)r   Úfilenamer   r   r   Ú
opt_passwd:   s   zOptions.opt_passwd)Ú__name__Ú
__module__Ú__qualname__r	   ÚIUsernamePasswordÚsupportedInterfacesÚsocketÚgethostnamer   r   r   r   ÚstrÚ__annotations__r   ÚCompletionsÚcompDataÚinterfacePluginsÚplgr   Ú
getPluginsr   ÚIProtocolPluginr!   r   r   r"   r&   r   r   r   r   r      s:   
 üÿ	
ÿþüÿ
r   c           
      C   s’   |   dg ¡}t | d ¡}t ||¡}tƒ }| jD ]!}|   |d ¡}|d ur:| j|  ||¡}t ||¡}| 	|¡ q| d D ]}	| 
|	¡ q?|S )NÚcredCheckersr   r   r   )Úgetr   ÚInMemoryWordsRealmr
   ÚPortalr   r2   Ú
getFactoryr   ÚsetServiceParentÚcreateGroup)
Úconfigr6   Ú
wordsRealmÚwordsPortalÚmsvcÚplgNameÚportÚfactoryÚsvcÚgr   r   r   ÚmakeServiceC   s    

ÿ
€rF   )Ú__doc__r,   r   Útypingr   r   r   Útwistedr   Útwisted.applicationr   Útwisted.application.servicer   Útwisted.credr   r	   r
   r   Útwisted.pythonr   Útwisted.wordsr   r   r   ÚAuthOptionMixinrF   r   r   r   r   Ú<module>   s   /