"""Subclass of SelectLibraries, which is generated by wxFormBuilder."""

import wxx
from activity.models.ui import ui as ui
import model
from builtin import *


# Implementing SelectLibraries
class SelectLibrariesDialog(ui.SelectLibraries):
    """
    This dialog allows to add or remove
    libraries for the current project
    """
    @wxx.SetInfo(__doc__)
    def __init__(self, parent, container):
        """initialize dialog"""
        super(SelectLibrariesDialog, self).__init__(parent)
        self._project = container.project
        self._libraries = self._project(model.LibrariesFolder, filter=lambda x: x.parent == self._project, cut=True)
        pos = 0
        for key in libraries:
            self.m_checkList6.Insert(key, pos, libraries[key])

    def get_kwargs(self):
        """Returns kwargs dictionary suitable for objects creation"""
        for item in range(0, self.m_checkList6.GetCount()):
            method = self.m_checkList6.GetClientData(item)
            method(self._libraries[0])
        return None

