
    =e                     0    d Z ddlmZ  G d d          ZdS )z'
Created on May 2, 2014

@author: sean
    )jencodec                   @    e Zd Zd Zd Z	 d	dZ	 d	dZd Zd Zd Z	dS )
ChannelsMixinc                     | j         d|}| j                            |          }|                     |dg           |                                S )o
        List the channels for owner.

        If owner is none, the currently logged in user is used.
        
/channels/   domainsessionget_check_responsejson)selfownerurlress       >lib/python3.11/site-packages/binstar_client/mixins/channels.pylist_channelszChannelsMixin.list_channels   sQ     #'+++uu5ls##S3%(((xxzz    c                     | j         d|d|}| j                            |          }|                     |dg           |                                S )r   r   /r	   r
   r   channelr   r   r   s        r   show_channelzChannelsMixin.show_channel   sW     &*[[[%%%Als##S3%(((xxzzr   Nc                     | j         d|d|}t          |||          \  }}| j                            |||          }	|                     |	dg           dS )a  
        Add a channel to the specified files

        :param channel: channel to add
        :param owner: The user to add the channel to (all files of all packages for this user)
        :param package: The package to add the channel to (all files in this package)
        :param version: The version to add the channel to (all files in this version of the package)
        :param filename: The exact file to add the channel to
        r   r   packageversionbasenamedataheaders   N)r   r   r   postr   
r   r   r   r   r   filenamer   r"   r#   r   s
             r   add_channelzChannelsMixin.add_channel&   sn     &*[[[%%%A8TTTgl$@@S3%(((((r   c                     | j         d|d|}t          |||          \  }}| j                            |||          }	|                     |	dg           dS )a  
        Remove a channel from the specified files.

        :param channel: channel to remove
        :param owner: The user to remove the channel from (all files of all packages for this user)
        :param package: The package to remove the channel from (all files in this package)
        :param version: The version to remove the channel to (all files in this version of the package)
        :param filename: The exact file to remove the channel from
        r   r   r   r!   r$   N)r   r   r   deleter   r&   s
             r   remove_channelzChannelsMixin.remove_channel7   sn     &*[[[%%%A8TTTgl!!#D'!BBS3%(((((r   c                     | j         d|d|d|}| j                            |          }|                     |dg           dS )  
        Tag all files in channel <channel> also as channel <to_channel>.

        :param channel: channel to copy
        :param owner: Perform this operation on all packages of this user
        :param to_channel: Destination name (may be a channel that already exists)
        r   r   z/copy/r$   Nr   r   r%   r   )r   r   r   
to_channelr   r   s         r   copy_channelzChannelsMixin.copy_channelH   sU     .2[[[%%%**Ul$$S3%(((((r   c                     | j         d|d|d}| j                            |          }|                     |dg           dS r-   r   r   z/lockr$   Nr.   r   s        r   lock_channelzChannelsMixin.lock_channelT   sQ     +/+++uuugggFl$$S3%(((((r   c                     | j         d|d|d}| j                            |          }|                     |dg           dS r2   )r   r   r*   r   r   s        r   unlock_channelzChannelsMixin.unlock_channel`   sQ     +/+++uuugggFl!!#&&S3%(((((r   )NNN)
__name__
__module____qualname__r   r   r(   r+   r0   r3   r5    r   r   r   r      s        
 
 

 
 
 HL) ) ) )$ HL) ) ) )"
) 
) 
)
) 
) 
)
) 
) 
) 
) 
)r   r   N)__doc__binstar_client.utilsr   r   r9   r   r   <module>r<      s_     ) ( ( ( ( (^) ^) ^) ^) ^) ^) ^) ^) ^) ^)r   