a
    )(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slJ eeej< eejd dddej d	 f qZ[d
d Zdd Zdd ZdS )OptionshostnameNz*Name of this server; purely an informativeoptParametersgroup)Z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   0lib/python3.9/site-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)Z
addCheckerr   ZFilePasswordDB)r   filenamer   r   r   
opt_passwd:   s    zOptions.opt_passwd)__name__
__module____qualname__r	   ZIUsernamePasswordZsupportedInterfacessocketZgethostnamer   r   r   r   str__annotations__r   ZCompletionsZcompDatainterfacePluginsZplgr   Z
getPluginsr   ZIProtocolPluginr    r   r   r!   r#   r   r   r   r   r      s8   
	

r   c           
      C   s   |  dg }t| d }t||}t }| jD ]B}|  |d }|d ur2| j| ||}t||}|	| q2| d D ]}	|
|	 q~|S )NcredCheckersr   r   r   )getr   ZInMemoryWordsRealmr
   ZPortalr   r*   Z
getFactoryr   ZsetServiceParentZcreateGroup)
Zconfigr+   Z
wordsRealmZwordsPortalZmsvcZplgNameZportfactoryZsvcgr   r   r   makeServiceC   s    

r/   )__doc__r'   r   typingr   r   r   Ztwistedr   Ztwisted.applicationr   Ztwisted.application.servicer   Ztwisted.credr   r	   r
   r   Ztwisted.pythonr   Ztwisted.wordsr   r   r   ZAuthOptionMixinr/   r   r   r   r   <module>   s   /