o
    ߥiY                     @   s@   d dl mZ d dlmZ d dlmZ dd ZG dd deZdS )	    )ArgumentParser)
CLICommand)HubApic                 C   s   t | S )z> Function which will be called for a specific sub parser.
    )LoginCMDargs r   H/home/ubuntu/.local/lib/python3.10/site-packages/modelscope/cli/login.pysubparser_func	   s   r
   c                   @   s2   e Zd ZdZdd ZedefddZdd Zd	S )
r   loginc                 C   s
   || _ d S Nr   )selfr   r   r   r	   __init__   s   
zLoginCMD.__init__parsersc                 C   s.   |  tj}|jdtddd |jtd dS )z( define args for login command.
        z--tokenTz The Access Token for modelscope.)typerequiredhelp)funcN)
add_parserr   nameadd_argumentstrset_defaultsr
   )r   parserr   r   r	   define_args   s   zLoginCMD.define_argsc                 C   s   t  }|| jj d S r   )r   r   r   token)r   apir   r   r	   execute!   s   zLoginCMD.executeN)	__name__
__module____qualname__r   r   staticmethodr   r   r   r   r   r   r	   r      s    r   N)argparser   modelscope.cli.baser   modelscope.hub.apir   r
   r   r   r   r   r	   <module>   s
   