Mini Shell
3
C��e� � @ s� d dddgZ ddlZddlZddlmZ ddlmZ ddlmZ dd l m
Z
e
e�Zd
Z
ddd�ZG d
d� de�ZG dd� de�ZG dd � d e�ZdS )�AddonSection�
AddonRegistry� AddonData�collect_addon_paths� N)�Section)�progress_message)�N_)�get_module_loggerZADDON_placeholder�guic C s g g g d�}�x| D ]�}yt j|�}W n tk
r> g }Y nX x�|D ]�}t jj||d�}t jj|�r�|d jd| |f� tjd|� t jj|||d�}t jj|�r�|d jd||f |f� tjd|� t jj||d�}t jj|�rF|d jd | |f� tjd
|� qFW qW |S )a� This method looks into the directories present
in toplevel_addon_paths and registers each subdirectory
as a new addon identified by that subdirectory name.
It then registers spokes, categories and data (ks)
paths for the application to use. By default is looks
for spokes and categories in <addon>/gui/ subdirectory
but that can be changed using the ui_subdir argument.)�spokes�ks�
categoriesr z %s.ks.%%sz0Loading ks section into module path for addon %sr z%s.%s.spokes.%%sz,Loading spokes into module path for addon %sr
z%s.categories.%%sz0Loading categories into module path for addon %s) �os�listdir�OSError�path�join�isdir�append�log�debug) Ztoplevel_addon_pathsZ ui_subdirZmodule_pathsr Zdirectories�addon_idZ
addon_ks_pathZaddon_spoke_pathZaddon_category_path� r �/usr/lib64/python3.6/addons.pyr # s,
c @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
S )r z�This class represents the ksdata.addons object and
maintains the ids and data structures for loaded
addons.
FIXME: This class is deprecated and should be removed.
It acts as a proxy during kickstart save.
c C s
|| _ d S )N)�__dict__)�selfZ
dictionaryr r r �__init__V s zAddonRegistry.__init__c C s t jdd� | jj� d�S )Nc S s | t |d � S )N� )�str)ZaccZid_addonr r r �<lambda>Z s z'AddonRegistry.__str__.<locals>.<lambda>� )� functools�reducer �items)r r r r �__str__Y s
zAddonRegistry.__str__c C sD x>| j j� D ]0}t|d�rttd�|j � |j||||� qW dS )z7This method calls execute on all the registered addons.�executezExecuting %s addonN)r �values�hasattrr r �namer% )r �storage�ksdata�users�payload�vr r r r% ] s
zAddonRegistry.executec C s� i }x6| j j� D ](\}}|jtks,|||<