Example #1
0
 def __slug__(self):
     """
     Returns slugified name for identification
     """
     return u"{0}.{1}".format(
         slugify(self.category),
         slugify(self.name)
     )
Example #2
0
    def register_panel(self, panel_component):
        """
        Decorator to register Panels.
        """
        ins = panel_component()
        assert isinstance(ins, Panel), "{}.{} is not a GUI Panel instance"\
            .format(ins.__module__, panel_component.__name__)
        slug = ins.__slug__

        # Append panel to instance manager
        self._panels[slug] = panel_component

        # Category handling
        category = slugify(ins.category)
        if category not in self._categories:
            self._categories[category] = []
        self._categories[category].append(ins)
Example #3
0
    def register_panel(self, panel_component):
        """
        Decorator to register Panels.
        """
        ins = panel_component()
        assert isinstance(ins, Panel), "{}.{} is not a GUI Panel instance"\
            .format(ins.__module__, panel_component.__name__)
        slug = ins.__slug__

        # Append panel to instance manager
        self._panels[slug] = panel_component

        # Category handling
        category = slugify(ins.category)
        if category not in self._categories:
            self._categories[category] = []
        self._categories[category].append(ins)
Example #4
0
    def __init__(self):
        if not self.id and self.name:
            self.id = slugify(self.name)

        self._map_sections()
Example #5
0
    def __init__(self, backup=None):
        if backup:
            self.backup = backup

        if not self.id and self.name:
            self.id = "{}".format(slugify(self.name))
Example #6
0
    def __init__(self):
        if not self.id and self.name:
            self.id = slugify(self.name)

        self._map_sections()
Example #7
0
    def __init__(self, backup=None):
        if backup:
            self.backup = backup

        if not self.id and self.name:
            self.id = "{}".format(slugify(self.name))