3 \�me� � @ s� U d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z ddl mZmZ ddl mZ d Zejjd ddd dg�Zddddeed�ed�ed�gedgd�Zeee�Z eje�Zee eedd�dd�ZdS )zkeyboard: set keyboard layout� N)�dedent)�distros)�Cloud)�Config)� MetaSchema�get_meta_doc)�PER_INSTANCEZpc105�alpineZarchZdebianZredhatZsuseZcc_keyboardZKeyboardzSet keyboard layoutzHandle keyboard configuration.ze # Set keyboard layout to "us" keyboard: layout: us z� # Set specific keyboard layout, model, variant, options keyboard: layout: de model: pc105 variant: nodeadkeys options: compose:rwin z� # For Alpine Linux set specific keyboard layout and variant, # as used by setup-keymap. Model and options are ignored. keyboard: layout: gb variant: gb-extd �keyboard)�id�name�title�descriptionr ZexamplesZ frequencyZactivate_by_schema_keys)r �cfg�cloud�args�returnc C s� d|krt jd| � d S |d }|d }|jjdkrB|jdd�}n|jdt�}|jdd�}|jdd�}t jd |� |jj||||� d S ) Nr z5Skipping module named %s, no 'keyboard' section found�layoutr �model� �variant�optionszSetting keyboard layout to '%s')�LOG�debugZdistror �get�DEFAULT_KEYBOARD_MODELZ set_keymap) r r r r Zkb_cfgr r r r � r �!/usr/lib/python3.6/cc_keyboard.py�handleH s r )�__doc__Zlogging�textwrapr Z cloudinitr Zcloudinit.cloudr Zcloudinit.configr Zcloudinit.config.schemar r Zcloudinit.settingsr r ZDistroZexpand_osfamilyZsupported_distros�metaZ getLogger�__name__r �str�listr r r r r �<module> s4