示例#1
0
文件: base.py 项目: coredamage/iosfu
 def __slug__(self):
     """
     Returns slugified name for identification
     """
     return u"{0}.{1}".format(
         slugify(self.category),
         slugify(self.name)
     )
示例#2
0
文件: core.py 项目: FarooqMulla/iosfu
    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)
示例#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)
示例#4
0
    def __init__(self):
        if not self.id and self.name:
            self.id = slugify(self.name)

        self._map_sections()
示例#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))
示例#6
0
文件: base.py 项目: FarooqMulla/iosfu
    def __init__(self):
        if not self.id and self.name:
            self.id = slugify(self.name)

        self._map_sections()
示例#7
0
文件: base.py 项目: FarooqMulla/iosfu
    def __init__(self, backup=None):
        if backup:
            self.backup = backup

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