관리-도구
편집 파일: groups_manager.cpython-36.pyc
3 �f�4 � @ s� d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl mZmZ d dl Z d dlZ dZejdje��Zejd�Zdddd �Zd d� Zdd � Zdd� Ze jjG dd� de jj��ZdS )� )�absolute_import)�unicode_literalsN)�_�loggerz -a-z0-9_.:z^[{}]+$z^[-a-zA-Z0-9_.@]+$T)Zdefault_explicitZuservisible_explicitZempty_groupsc C s t j| �stjtd���| S )zgroup id validatorzInvalid group id)�RE_GROUP_ID�match�argparse�ArgumentTypeErrorr )�value� r �$/usr/lib/python3.6/groups_manager.py� group_id_type. s r c C sN | j dd�}t|�dkr&tjtd���|\}}tj|�sFtjtd���||fS )ztranslated texts validator�:� z6Invalid translated data, should be in form 'lang:text'z*Invalid/empty language for translated data)�split�lenr r r �RE_LANGr )r �data�lang�textr r r �translation_type5 s r c C s: | j � }tjdjt�d|�}|s6tjjtd�j| ���|S )z#generate group id based on its namez[^{}]� zFCan't generate group id from '{}'. Please specify group id using --id.) �lower�re�sub�format�RE_GROUP_ID_VALID�dnf�cli�CliErrorr )r �group_idr r r � text_to_idA s r! c sd e Zd ZdZed�Z� fdd�Zedd� �Zdd� Z d d � Z dd� Zd d� Zdd� Z dd� Z� ZS )�GroupsManagerCommand�groups-managerz$create and edit groups metadata filec s t t| �j|� tj� | _d S )N)�superr"